@azure/storage-file-share 12.27.0 → 12.28.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (998) hide show
  1. package/README.md +105 -155
  2. package/dist/browser/AccountSASPermissions.d.ts +61 -0
  3. package/dist/browser/AccountSASPermissions.d.ts.map +1 -0
  4. package/dist/browser/AccountSASPermissions.js.map +1 -0
  5. package/dist/browser/AccountSASResourceTypes.d.ts +38 -0
  6. package/dist/browser/AccountSASResourceTypes.d.ts.map +1 -0
  7. package/dist/browser/AccountSASResourceTypes.js.map +1 -0
  8. package/dist/browser/AccountSASServices.d.ts +40 -0
  9. package/dist/browser/AccountSASServices.d.ts.map +1 -0
  10. package/dist/browser/AccountSASServices.js.map +1 -0
  11. package/dist/browser/AccountSASSignatureValues.d.ts +73 -0
  12. package/dist/browser/AccountSASSignatureValues.d.ts.map +1 -0
  13. package/dist/browser/AccountSASSignatureValues.js +71 -0
  14. package/dist/browser/AccountSASSignatureValues.js.map +1 -0
  15. package/dist/browser/Clients.d.ts +3114 -0
  16. package/dist/browser/Clients.d.ts.map +1 -0
  17. package/dist/browser/Clients.js +2882 -0
  18. package/dist/browser/Clients.js.map +1 -0
  19. package/dist/browser/FileDownloadResponse-browser.d.mts.map +1 -0
  20. package/dist/browser/FileDownloadResponse-browser.mjs.map +1 -0
  21. package/dist/browser/FileDownloadResponse.d.ts +2 -0
  22. package/dist/browser/FileDownloadResponse.js +7 -0
  23. package/dist/browser/FileSASPermissions.d.ts +42 -0
  24. package/dist/browser/FileSASPermissions.d.ts.map +1 -0
  25. package/dist/browser/FileSASPermissions.js.map +1 -0
  26. package/dist/browser/FileSASSignatureValues.d.ts +95 -0
  27. package/dist/browser/FileSASSignatureValues.d.ts.map +1 -0
  28. package/dist/browser/FileSASSignatureValues.js +84 -0
  29. package/dist/browser/FileSASSignatureValues.js.map +1 -0
  30. package/dist/browser/FileSystemAttributes.d.ts +63 -0
  31. package/dist/browser/FileSystemAttributes.d.ts.map +1 -0
  32. package/dist/browser/FileSystemAttributes.js.map +1 -0
  33. package/dist/browser/Pipeline.d.ts +142 -0
  34. package/dist/browser/Pipeline.d.ts.map +1 -0
  35. package/dist/browser/Pipeline.js +261 -0
  36. package/dist/browser/Pipeline.js.map +1 -0
  37. package/dist/browser/Range.d.ts +25 -0
  38. package/dist/browser/Range.d.ts.map +1 -0
  39. package/dist/browser/Range.js.map +1 -0
  40. package/dist/browser/SASQueryParameters.d.ts +136 -0
  41. package/dist/browser/SASQueryParameters.d.ts.map +1 -0
  42. package/dist/browser/SASQueryParameters.js +177 -0
  43. package/dist/browser/SASQueryParameters.js.map +1 -0
  44. package/dist/browser/SasIPRange.d.ts +25 -0
  45. package/dist/browser/SasIPRange.d.ts.map +1 -0
  46. package/dist/browser/SasIPRange.js.map +1 -0
  47. package/dist/browser/ShareClientInternal.d.ts +12 -0
  48. package/dist/browser/ShareClientInternal.d.ts.map +1 -0
  49. package/dist/browser/ShareClientInternal.js +16 -0
  50. package/dist/browser/ShareClientInternal.js.map +1 -0
  51. package/dist/browser/ShareSASPermissions.d.ts +46 -0
  52. package/dist/browser/ShareSASPermissions.d.ts.map +1 -0
  53. package/dist/browser/ShareSASPermissions.js.map +1 -0
  54. package/dist/browser/ShareServiceClient.d.ts +427 -0
  55. package/dist/browser/ShareServiceClient.d.ts.map +1 -0
  56. package/dist/browser/ShareServiceClient.js +475 -0
  57. package/dist/browser/ShareServiceClient.js.map +1 -0
  58. package/dist/browser/StorageClient.d.ts +47 -0
  59. package/dist/browser/StorageClient.d.ts.map +1 -0
  60. package/dist/browser/StorageClient.js +30 -0
  61. package/dist/browser/StorageClient.js.map +1 -0
  62. package/dist/browser/StorageContextClient.d.ts +9 -0
  63. package/dist/browser/StorageContextClient.d.ts.map +1 -0
  64. package/dist/browser/StorageContextClient.js +18 -0
  65. package/dist/browser/StorageContextClient.js.map +1 -0
  66. package/dist/browser/StorageRetryPolicyFactory.d.ts +56 -0
  67. package/dist/browser/StorageRetryPolicyFactory.d.ts.map +1 -0
  68. package/dist/browser/StorageRetryPolicyFactory.js +26 -0
  69. package/dist/browser/StorageRetryPolicyFactory.js.map +1 -0
  70. package/dist/browser/generated/src/index.d.ts +4 -0
  71. package/dist/browser/generated/src/index.d.ts.map +1 -0
  72. package/dist/browser/generated/src/index.js +11 -0
  73. package/dist/browser/generated/src/index.js.map +1 -0
  74. package/dist/browser/generated/src/models/index.d.ts +2881 -0
  75. package/dist/browser/generated/src/models/index.d.ts.map +1 -0
  76. package/dist/browser/generated/src/models/index.js.map +1 -0
  77. package/dist/browser/generated/src/models/mappers.d.ts +128 -0
  78. package/dist/browser/generated/src/models/mappers.d.ts.map +1 -0
  79. package/dist/browser/generated/src/models/mappers.js.map +1 -0
  80. package/dist/browser/generated/src/models/parameters.d.ts +128 -0
  81. package/dist/browser/generated/src/models/parameters.d.ts.map +1 -0
  82. package/dist/browser/generated/src/models/parameters.js +1364 -0
  83. package/dist/browser/generated/src/models/parameters.js.map +1 -0
  84. package/dist/browser/generated/src/operations/directory.d.ts +65 -0
  85. package/dist/browser/generated/src/operations/directory.d.ts.map +1 -0
  86. package/dist/browser/generated/src/operations/directory.js +378 -0
  87. package/dist/browser/generated/src/operations/directory.js.map +1 -0
  88. package/dist/browser/generated/src/operations/file.d.ts +162 -0
  89. package/dist/browser/generated/src/operations/file.d.ts.map +1 -0
  90. package/dist/browser/generated/src/operations/file.js +866 -0
  91. package/dist/browser/generated/src/operations/file.js.map +1 -0
  92. package/dist/browser/generated/src/operations/index.d.ts +5 -0
  93. package/dist/browser/generated/src/operations/index.d.ts.map +1 -0
  94. package/dist/browser/generated/src/operations/index.js +12 -0
  95. package/dist/browser/generated/src/operations/index.js.map +1 -0
  96. package/dist/browser/generated/src/operations/service.d.ts +32 -0
  97. package/dist/browser/generated/src/operations/service.d.ts.map +1 -0
  98. package/dist/browser/generated/src/operations/service.js +135 -0
  99. package/dist/browser/generated/src/operations/service.js.map +1 -0
  100. package/dist/browser/generated/src/operations/share.d.ts +111 -0
  101. package/dist/browser/generated/src/operations/share.d.ts.map +1 -0
  102. package/dist/browser/generated/src/operations/share.js +671 -0
  103. package/dist/browser/generated/src/operations/share.js.map +1 -0
  104. package/dist/browser/generated/src/operationsInterfaces/directory.d.ts +57 -0
  105. package/dist/browser/generated/src/operationsInterfaces/directory.d.ts.map +1 -0
  106. package/dist/browser/generated/src/operationsInterfaces/directory.js.map +1 -0
  107. package/dist/browser/generated/src/operationsInterfaces/file.d.ts +154 -0
  108. package/dist/browser/generated/src/operationsInterfaces/file.d.ts.map +1 -0
  109. package/dist/browser/generated/src/operationsInterfaces/file.js.map +1 -0
  110. package/dist/browser/generated/src/operationsInterfaces/index.d.ts +5 -0
  111. package/dist/browser/generated/src/operationsInterfaces/index.d.ts.map +1 -0
  112. package/dist/browser/generated/src/operationsInterfaces/index.js +12 -0
  113. package/dist/browser/generated/src/operationsInterfaces/index.js.map +1 -0
  114. package/dist/browser/generated/src/operationsInterfaces/service.d.ts +24 -0
  115. package/dist/browser/generated/src/operationsInterfaces/service.d.ts.map +1 -0
  116. package/dist/browser/generated/src/operationsInterfaces/service.js.map +1 -0
  117. package/dist/browser/generated/src/operationsInterfaces/share.d.ts +103 -0
  118. package/dist/browser/generated/src/operationsInterfaces/share.d.ts.map +1 -0
  119. package/dist/browser/generated/src/operationsInterfaces/share.js.map +1 -0
  120. package/dist/browser/generated/src/storageClient.d.ts +20 -0
  121. package/dist/browser/generated/src/storageClient.d.ts.map +1 -0
  122. package/dist/browser/generated/src/storageClient.js +48 -0
  123. package/dist/browser/generated/src/storageClient.js.map +1 -0
  124. package/dist/browser/generatedModels.d.ts +492 -0
  125. package/dist/browser/generatedModels.d.ts.map +1 -0
  126. package/dist/browser/generatedModels.js.map +1 -0
  127. package/dist/browser/index-browser.d.mts.map +1 -0
  128. package/dist/browser/index-browser.mjs.map +1 -0
  129. package/dist/browser/index.d.ts +22 -0
  130. package/dist/browser/index.js +19 -0
  131. package/dist/browser/log.d.ts +5 -0
  132. package/dist/browser/log.d.ts.map +1 -0
  133. package/dist/browser/log.js.map +1 -0
  134. package/dist/browser/models.d.ts +373 -0
  135. package/dist/browser/models.d.ts.map +1 -0
  136. package/dist/browser/models.js +94 -0
  137. package/dist/browser/models.js.map +1 -0
  138. package/dist/browser/package.json +3 -0
  139. package/dist/browser/policies/StorageRetryPolicy.d.ts +75 -0
  140. package/dist/browser/policies/StorageRetryPolicy.d.ts.map +1 -0
  141. package/dist/browser/policies/StorageRetryPolicy.js +220 -0
  142. package/dist/browser/policies/StorageRetryPolicy.js.map +1 -0
  143. package/dist/browser/policies/StorageRetryPolicyV2.d.ts +24 -0
  144. package/dist/browser/policies/StorageRetryPolicyV2.d.ts.map +1 -0
  145. package/dist/browser/policies/StorageRetryPolicyV2.js +176 -0
  146. package/dist/browser/policies/StorageRetryPolicyV2.js.map +1 -0
  147. package/dist/browser/utils/Batch.d.ts +68 -0
  148. package/dist/browser/utils/Batch.d.ts.map +1 -0
  149. package/dist/browser/utils/Batch.js.map +1 -0
  150. package/dist/browser/utils/BufferScheduler.d.ts +157 -0
  151. package/dist/browser/utils/BufferScheduler.d.ts.map +1 -0
  152. package/dist/browser/utils/BufferScheduler.js.map +1 -0
  153. package/dist/browser/utils/RetriableReadableStream.d.ts +58 -0
  154. package/dist/browser/utils/RetriableReadableStream.d.ts.map +1 -0
  155. package/dist/browser/utils/RetriableReadableStream.js +119 -0
  156. package/dist/browser/utils/RetriableReadableStream.js.map +1 -0
  157. package/dist/browser/utils/constants.d.ts +55 -0
  158. package/dist/browser/utils/constants.d.ts.map +1 -0
  159. package/dist/browser/utils/constants.js +162 -0
  160. package/dist/browser/utils/constants.js.map +1 -0
  161. package/dist/browser/utils/tracing.d.ts +6 -0
  162. package/dist/browser/utils/tracing.d.ts.map +1 -0
  163. package/dist/browser/utils/tracing.js +14 -0
  164. package/dist/browser/utils/tracing.js.map +1 -0
  165. package/dist/browser/utils/utils-browser.d.mts.map +1 -0
  166. package/dist/browser/utils/utils-browser.mjs.map +1 -0
  167. package/dist/browser/utils/utils.common.d.ts +304 -0
  168. package/dist/browser/utils/utils.common.d.ts.map +1 -0
  169. package/dist/browser/utils/utils.common.js +778 -0
  170. package/dist/browser/utils/utils.common.js.map +1 -0
  171. package/dist/browser/utils/utils.d.ts +5 -0
  172. package/dist/browser/utils/utils.js +15 -0
  173. package/dist/commonjs/AccountSASPermissions.d.ts +61 -0
  174. package/dist/commonjs/AccountSASPermissions.d.ts.map +1 -0
  175. package/dist/commonjs/AccountSASPermissions.js +132 -0
  176. package/dist/commonjs/AccountSASPermissions.js.map +1 -0
  177. package/dist/commonjs/AccountSASResourceTypes.d.ts +38 -0
  178. package/dist/commonjs/AccountSASResourceTypes.d.ts.map +1 -0
  179. package/dist/commonjs/AccountSASResourceTypes.js +76 -0
  180. package/dist/commonjs/AccountSASResourceTypes.js.map +1 -0
  181. package/dist/commonjs/AccountSASServices.d.ts +40 -0
  182. package/dist/commonjs/AccountSASServices.d.ts.map +1 -0
  183. package/dist/commonjs/AccountSASServices.js +84 -0
  184. package/dist/commonjs/AccountSASServices.js.map +1 -0
  185. package/dist/commonjs/AccountSASSignatureValues.d.ts +73 -0
  186. package/dist/commonjs/AccountSASSignatureValues.d.ts.map +1 -0
  187. package/dist/commonjs/AccountSASSignatureValues.js +75 -0
  188. package/dist/commonjs/AccountSASSignatureValues.js.map +1 -0
  189. package/dist/commonjs/Clients.d.ts +3114 -0
  190. package/dist/commonjs/Clients.d.ts.map +1 -0
  191. package/dist/commonjs/Clients.js +2889 -0
  192. package/dist/commonjs/Clients.js.map +1 -0
  193. package/dist/commonjs/FileDownloadResponse.d.ts +291 -0
  194. package/dist/commonjs/FileDownloadResponse.d.ts.map +1 -0
  195. package/dist/commonjs/FileDownloadResponse.js +371 -0
  196. package/dist/commonjs/FileDownloadResponse.js.map +1 -0
  197. package/dist/commonjs/FileSASPermissions.d.ts +42 -0
  198. package/dist/commonjs/FileSASPermissions.d.ts.map +1 -0
  199. package/dist/commonjs/FileSASPermissions.js +86 -0
  200. package/dist/commonjs/FileSASPermissions.js.map +1 -0
  201. package/dist/commonjs/FileSASSignatureValues.d.ts +95 -0
  202. package/dist/commonjs/FileSASSignatureValues.d.ts.map +1 -0
  203. package/dist/commonjs/FileSASSignatureValues.js +88 -0
  204. package/dist/commonjs/FileSASSignatureValues.js.map +1 -0
  205. package/dist/commonjs/FileSystemAttributes.d.ts +63 -0
  206. package/dist/commonjs/FileSystemAttributes.d.ts.map +1 -0
  207. package/dist/commonjs/FileSystemAttributes.js +148 -0
  208. package/dist/commonjs/FileSystemAttributes.js.map +1 -0
  209. package/dist/commonjs/Pipeline.d.ts +142 -0
  210. package/dist/commonjs/Pipeline.d.ts.map +1 -0
  211. package/dist/commonjs/Pipeline.js +267 -0
  212. package/dist/commonjs/Pipeline.js.map +1 -0
  213. package/dist/commonjs/Range.d.ts +25 -0
  214. package/dist/commonjs/Range.d.ts.map +1 -0
  215. package/dist/commonjs/Range.js +25 -0
  216. package/dist/commonjs/Range.js.map +1 -0
  217. package/dist/commonjs/SASQueryParameters.d.ts +136 -0
  218. package/dist/commonjs/SASQueryParameters.d.ts.map +1 -0
  219. package/dist/commonjs/SASQueryParameters.js +181 -0
  220. package/dist/commonjs/SASQueryParameters.js.map +1 -0
  221. package/dist/commonjs/SasIPRange.d.ts +25 -0
  222. package/dist/commonjs/SasIPRange.d.ts.map +1 -0
  223. package/dist/commonjs/SasIPRange.js +17 -0
  224. package/dist/commonjs/SasIPRange.js.map +1 -0
  225. package/dist/commonjs/ShareClientInternal.d.ts +12 -0
  226. package/dist/commonjs/ShareClientInternal.d.ts.map +1 -0
  227. package/dist/commonjs/ShareClientInternal.js +20 -0
  228. package/dist/commonjs/ShareClientInternal.js.map +1 -0
  229. package/dist/commonjs/ShareSASPermissions.d.ts +46 -0
  230. package/dist/commonjs/ShareSASPermissions.d.ts.map +1 -0
  231. package/dist/commonjs/ShareSASPermissions.js +96 -0
  232. package/dist/commonjs/ShareSASPermissions.js.map +1 -0
  233. package/dist/commonjs/ShareServiceClient.d.ts +427 -0
  234. package/dist/commonjs/ShareServiceClient.d.ts.map +1 -0
  235. package/dist/commonjs/ShareServiceClient.js +479 -0
  236. package/dist/commonjs/ShareServiceClient.js.map +1 -0
  237. package/dist/commonjs/StorageClient.d.ts +47 -0
  238. package/dist/commonjs/StorageClient.d.ts.map +1 -0
  239. package/dist/commonjs/StorageClient.js +34 -0
  240. package/dist/commonjs/StorageClient.js.map +1 -0
  241. package/dist/commonjs/StorageContextClient.d.ts +9 -0
  242. package/dist/commonjs/StorageContextClient.d.ts.map +1 -0
  243. package/dist/commonjs/StorageContextClient.js +22 -0
  244. package/dist/commonjs/StorageContextClient.js.map +1 -0
  245. package/dist/commonjs/StorageRetryPolicyFactory.d.ts +56 -0
  246. package/dist/commonjs/StorageRetryPolicyFactory.d.ts.map +1 -0
  247. package/dist/commonjs/StorageRetryPolicyFactory.js +31 -0
  248. package/dist/commonjs/StorageRetryPolicyFactory.js.map +1 -0
  249. package/dist/commonjs/generated/src/index.d.ts +4 -0
  250. package/dist/commonjs/generated/src/index.d.ts.map +1 -0
  251. package/dist/commonjs/generated/src/index.js +16 -0
  252. package/dist/commonjs/generated/src/index.js.map +1 -0
  253. package/dist/commonjs/generated/src/models/index.d.ts +2881 -0
  254. package/dist/commonjs/generated/src/models/index.d.ts.map +1 -0
  255. package/dist/commonjs/generated/src/models/index.js +169 -0
  256. package/dist/commonjs/generated/src/models/index.js.map +1 -0
  257. package/dist/commonjs/generated/src/models/mappers.d.ts +128 -0
  258. package/dist/commonjs/generated/src/models/mappers.d.ts.map +1 -0
  259. package/dist/commonjs/generated/src/models/mappers.js +5992 -0
  260. package/dist/commonjs/generated/src/models/mappers.js.map +1 -0
  261. package/dist/commonjs/generated/src/models/parameters.d.ts +128 -0
  262. package/dist/commonjs/generated/src/models/parameters.d.ts.map +1 -0
  263. package/dist/commonjs/generated/src/models/parameters.js +1369 -0
  264. package/dist/commonjs/generated/src/models/parameters.js.map +1 -0
  265. package/dist/commonjs/generated/src/operations/directory.d.ts +65 -0
  266. package/dist/commonjs/generated/src/operations/directory.d.ts.map +1 -0
  267. package/dist/commonjs/generated/src/operations/directory.js +383 -0
  268. package/dist/commonjs/generated/src/operations/directory.js.map +1 -0
  269. package/dist/commonjs/generated/src/operations/file.d.ts +162 -0
  270. package/dist/commonjs/generated/src/operations/file.d.ts.map +1 -0
  271. package/dist/commonjs/generated/src/operations/file.js +871 -0
  272. package/dist/commonjs/generated/src/operations/file.js.map +1 -0
  273. package/dist/commonjs/generated/src/operations/index.d.ts +5 -0
  274. package/dist/commonjs/generated/src/operations/index.d.ts.map +1 -0
  275. package/dist/commonjs/generated/src/operations/index.js +15 -0
  276. package/dist/commonjs/generated/src/operations/index.js.map +1 -0
  277. package/dist/commonjs/generated/src/operations/service.d.ts +32 -0
  278. package/dist/commonjs/generated/src/operations/service.d.ts.map +1 -0
  279. package/dist/commonjs/generated/src/operations/service.js +140 -0
  280. package/dist/commonjs/generated/src/operations/service.js.map +1 -0
  281. package/dist/commonjs/generated/src/operations/share.d.ts +111 -0
  282. package/dist/commonjs/generated/src/operations/share.d.ts.map +1 -0
  283. package/dist/commonjs/generated/src/operations/share.js +676 -0
  284. package/dist/commonjs/generated/src/operations/share.js.map +1 -0
  285. package/dist/commonjs/generated/src/operationsInterfaces/directory.d.ts +57 -0
  286. package/dist/commonjs/generated/src/operationsInterfaces/directory.d.ts.map +1 -0
  287. package/dist/commonjs/generated/src/operationsInterfaces/directory.js +10 -0
  288. package/dist/commonjs/generated/src/operationsInterfaces/directory.js.map +1 -0
  289. package/dist/commonjs/generated/src/operationsInterfaces/file.d.ts +154 -0
  290. package/dist/commonjs/generated/src/operationsInterfaces/file.d.ts.map +1 -0
  291. package/dist/commonjs/generated/src/operationsInterfaces/file.js +10 -0
  292. package/dist/commonjs/generated/src/operationsInterfaces/file.js.map +1 -0
  293. package/dist/commonjs/generated/src/operationsInterfaces/index.d.ts +5 -0
  294. package/dist/commonjs/generated/src/operationsInterfaces/index.d.ts.map +1 -0
  295. package/dist/commonjs/generated/src/operationsInterfaces/index.js +15 -0
  296. package/dist/commonjs/generated/src/operationsInterfaces/index.js.map +1 -0
  297. package/dist/commonjs/generated/src/operationsInterfaces/service.d.ts +24 -0
  298. package/dist/commonjs/generated/src/operationsInterfaces/service.d.ts.map +1 -0
  299. package/dist/commonjs/generated/src/operationsInterfaces/service.js +10 -0
  300. package/dist/commonjs/generated/src/operationsInterfaces/service.js.map +1 -0
  301. package/dist/commonjs/generated/src/operationsInterfaces/share.d.ts +103 -0
  302. package/dist/commonjs/generated/src/operationsInterfaces/share.d.ts.map +1 -0
  303. package/dist/commonjs/generated/src/operationsInterfaces/share.js +10 -0
  304. package/dist/commonjs/generated/src/operationsInterfaces/share.js.map +1 -0
  305. package/dist/commonjs/generated/src/storageClient.d.ts +20 -0
  306. package/dist/commonjs/generated/src/storageClient.d.ts.map +1 -0
  307. package/dist/commonjs/generated/src/storageClient.js +53 -0
  308. package/dist/commonjs/generated/src/storageClient.js.map +1 -0
  309. package/dist/commonjs/generatedModels.d.ts +492 -0
  310. package/dist/commonjs/generatedModels.d.ts.map +1 -0
  311. package/dist/commonjs/generatedModels.js +11 -0
  312. package/dist/commonjs/generatedModels.js.map +1 -0
  313. package/dist/commonjs/index.d.ts +32 -0
  314. package/dist/commonjs/index.d.ts.map +1 -0
  315. package/dist/commonjs/index.js +55 -0
  316. package/dist/commonjs/index.js.map +1 -0
  317. package/dist/commonjs/log.d.ts +5 -0
  318. package/dist/commonjs/log.d.ts.map +1 -0
  319. package/dist/commonjs/log.js +11 -0
  320. package/dist/commonjs/log.js.map +1 -0
  321. package/dist/commonjs/models.d.ts +373 -0
  322. package/dist/commonjs/models.d.ts.map +1 -0
  323. package/dist/commonjs/models.js +107 -0
  324. package/dist/commonjs/models.js.map +1 -0
  325. package/dist/commonjs/package.json +3 -0
  326. package/dist/commonjs/policies/StorageRetryPolicy.d.ts +75 -0
  327. package/dist/commonjs/policies/StorageRetryPolicy.d.ts.map +1 -0
  328. package/dist/commonjs/policies/StorageRetryPolicy.js +225 -0
  329. package/dist/commonjs/policies/StorageRetryPolicy.js.map +1 -0
  330. package/dist/commonjs/policies/StorageRetryPolicyV2.d.ts +24 -0
  331. package/dist/commonjs/policies/StorageRetryPolicyV2.d.ts.map +1 -0
  332. package/dist/commonjs/policies/StorageRetryPolicyV2.js +180 -0
  333. package/dist/commonjs/policies/StorageRetryPolicyV2.js.map +1 -0
  334. package/dist/commonjs/tsdoc-metadata.json +11 -0
  335. package/dist/commonjs/utils/Batch.d.ts +68 -0
  336. package/dist/commonjs/utils/Batch.d.ts.map +1 -0
  337. package/dist/commonjs/utils/Batch.js +126 -0
  338. package/dist/commonjs/utils/Batch.js.map +1 -0
  339. package/dist/commonjs/utils/BufferScheduler.d.ts +157 -0
  340. package/dist/commonjs/utils/BufferScheduler.d.ts.map +1 -0
  341. package/dist/commonjs/utils/BufferScheduler.js +268 -0
  342. package/dist/commonjs/utils/BufferScheduler.js.map +1 -0
  343. package/dist/commonjs/utils/RetriableReadableStream.d.ts +58 -0
  344. package/dist/commonjs/utils/RetriableReadableStream.d.ts.map +1 -0
  345. package/dist/commonjs/utils/RetriableReadableStream.js +123 -0
  346. package/dist/commonjs/utils/RetriableReadableStream.js.map +1 -0
  347. package/dist/commonjs/utils/constants.d.ts +55 -0
  348. package/dist/commonjs/utils/constants.d.ts.map +1 -0
  349. package/dist/commonjs/utils/constants.js +165 -0
  350. package/dist/commonjs/utils/constants.js.map +1 -0
  351. package/dist/commonjs/utils/tracing.d.ts +6 -0
  352. package/dist/commonjs/utils/tracing.d.ts.map +1 -0
  353. package/dist/commonjs/utils/tracing.js +17 -0
  354. package/dist/commonjs/utils/tracing.js.map +1 -0
  355. package/dist/commonjs/utils/utils.common.d.ts +304 -0
  356. package/dist/commonjs/utils/utils.common.d.ts.map +1 -0
  357. package/dist/commonjs/utils/utils.common.js +816 -0
  358. package/dist/commonjs/utils/utils.common.js.map +1 -0
  359. package/dist/commonjs/utils/utils.d.ts +28 -0
  360. package/dist/commonjs/utils/utils.d.ts.map +1 -0
  361. package/dist/commonjs/utils/utils.js +85 -0
  362. package/dist/commonjs/utils/utils.js.map +1 -0
  363. package/dist/esm/AccountSASPermissions.d.ts +61 -0
  364. package/dist/esm/AccountSASPermissions.d.ts.map +1 -0
  365. package/dist/esm/AccountSASPermissions.js +128 -0
  366. package/dist/esm/AccountSASPermissions.js.map +1 -0
  367. package/dist/esm/AccountSASResourceTypes.d.ts +38 -0
  368. package/dist/esm/AccountSASResourceTypes.d.ts.map +1 -0
  369. package/dist/esm/AccountSASResourceTypes.js.map +1 -0
  370. package/dist/esm/AccountSASServices.d.ts +40 -0
  371. package/dist/esm/AccountSASServices.d.ts.map +1 -0
  372. package/dist/esm/AccountSASServices.js.map +1 -0
  373. package/dist/esm/AccountSASSignatureValues.d.ts +73 -0
  374. package/dist/esm/AccountSASSignatureValues.d.ts.map +1 -0
  375. package/dist/esm/AccountSASSignatureValues.js +71 -0
  376. package/dist/esm/AccountSASSignatureValues.js.map +1 -0
  377. package/dist/esm/Clients.d.ts +3114 -0
  378. package/dist/esm/Clients.d.ts.map +1 -0
  379. package/dist/esm/Clients.js +2882 -0
  380. package/dist/esm/Clients.js.map +1 -0
  381. package/dist/esm/FileDownloadResponse.d.ts +291 -0
  382. package/dist/esm/FileDownloadResponse.d.ts.map +1 -0
  383. package/dist/esm/FileDownloadResponse.js +367 -0
  384. package/dist/esm/FileDownloadResponse.js.map +1 -0
  385. package/dist/esm/FileSASPermissions.d.ts +42 -0
  386. package/dist/esm/FileSASPermissions.d.ts.map +1 -0
  387. package/dist/esm/FileSASPermissions.js +82 -0
  388. package/dist/esm/FileSASPermissions.js.map +1 -0
  389. package/dist/esm/FileSASSignatureValues.d.ts +95 -0
  390. package/dist/esm/FileSASSignatureValues.d.ts.map +1 -0
  391. package/dist/esm/FileSASSignatureValues.js +84 -0
  392. package/dist/esm/FileSASSignatureValues.js.map +1 -0
  393. package/dist/esm/FileSystemAttributes.d.ts +63 -0
  394. package/dist/esm/FileSystemAttributes.d.ts.map +1 -0
  395. package/dist/esm/FileSystemAttributes.js +144 -0
  396. package/dist/esm/FileSystemAttributes.js.map +1 -0
  397. package/dist/esm/Pipeline.d.ts +142 -0
  398. package/dist/esm/Pipeline.d.ts.map +1 -0
  399. package/dist/esm/Pipeline.js +261 -0
  400. package/dist/esm/Pipeline.js.map +1 -0
  401. package/dist/esm/Range.d.ts +25 -0
  402. package/dist/esm/Range.d.ts.map +1 -0
  403. package/dist/esm/Range.js +22 -0
  404. package/dist/esm/Range.js.map +1 -0
  405. package/dist/esm/SASQueryParameters.d.ts +136 -0
  406. package/dist/esm/SASQueryParameters.d.ts.map +1 -0
  407. package/dist/esm/SASQueryParameters.js +177 -0
  408. package/dist/esm/SASQueryParameters.js.map +1 -0
  409. package/dist/esm/SasIPRange.d.ts +25 -0
  410. package/dist/esm/SasIPRange.d.ts.map +1 -0
  411. package/dist/esm/SasIPRange.js +14 -0
  412. package/dist/esm/SasIPRange.js.map +1 -0
  413. package/dist/esm/ShareClientInternal.d.ts +12 -0
  414. package/dist/esm/ShareClientInternal.d.ts.map +1 -0
  415. package/dist/esm/ShareClientInternal.js +16 -0
  416. package/dist/esm/ShareClientInternal.js.map +1 -0
  417. package/dist/esm/ShareSASPermissions.d.ts +46 -0
  418. package/dist/esm/ShareSASPermissions.d.ts.map +1 -0
  419. package/dist/esm/ShareSASPermissions.js +92 -0
  420. package/dist/esm/ShareSASPermissions.js.map +1 -0
  421. package/dist/esm/ShareServiceClient.d.ts +427 -0
  422. package/dist/esm/ShareServiceClient.d.ts.map +1 -0
  423. package/dist/esm/ShareServiceClient.js +475 -0
  424. package/dist/esm/ShareServiceClient.js.map +1 -0
  425. package/dist/esm/StorageClient.d.ts +47 -0
  426. package/dist/esm/StorageClient.d.ts.map +1 -0
  427. package/dist/esm/StorageClient.js +30 -0
  428. package/dist/esm/StorageClient.js.map +1 -0
  429. package/dist/esm/StorageContextClient.d.ts +9 -0
  430. package/dist/esm/StorageContextClient.d.ts.map +1 -0
  431. package/dist/esm/StorageContextClient.js +18 -0
  432. package/dist/esm/StorageContextClient.js.map +1 -0
  433. package/dist/esm/StorageRetryPolicyFactory.d.ts +56 -0
  434. package/dist/esm/StorageRetryPolicyFactory.d.ts.map +1 -0
  435. package/dist/esm/StorageRetryPolicyFactory.js +26 -0
  436. package/dist/esm/StorageRetryPolicyFactory.js.map +1 -0
  437. package/dist/esm/generated/src/index.d.ts +4 -0
  438. package/dist/esm/generated/src/index.d.ts.map +1 -0
  439. package/dist/esm/generated/src/index.js +11 -0
  440. package/dist/esm/generated/src/index.js.map +1 -0
  441. package/dist/esm/generated/src/models/index.d.ts +2881 -0
  442. package/dist/esm/generated/src/models/index.d.ts.map +1 -0
  443. package/dist/esm/generated/src/models/index.js +166 -0
  444. package/dist/esm/generated/src/models/index.js.map +1 -0
  445. package/dist/esm/generated/src/models/mappers.d.ts +128 -0
  446. package/dist/esm/generated/src/models/mappers.d.ts.map +1 -0
  447. package/dist/esm/generated/src/models/mappers.js +5987 -0
  448. package/dist/esm/generated/src/models/mappers.js.map +1 -0
  449. package/dist/esm/generated/src/models/parameters.d.ts +128 -0
  450. package/dist/esm/generated/src/models/parameters.d.ts.map +1 -0
  451. package/dist/esm/generated/src/models/parameters.js +1364 -0
  452. package/dist/esm/generated/src/models/parameters.js.map +1 -0
  453. package/dist/esm/generated/src/operations/directory.d.ts +65 -0
  454. package/dist/esm/generated/src/operations/directory.d.ts.map +1 -0
  455. package/dist/esm/generated/src/operations/directory.js +378 -0
  456. package/dist/esm/generated/src/operations/directory.js.map +1 -0
  457. package/dist/esm/generated/src/operations/file.d.ts +162 -0
  458. package/dist/esm/generated/src/operations/file.d.ts.map +1 -0
  459. package/dist/esm/generated/src/operations/file.js +866 -0
  460. package/dist/esm/generated/src/operations/file.js.map +1 -0
  461. package/dist/esm/generated/src/operations/index.d.ts +5 -0
  462. package/dist/esm/generated/src/operations/index.d.ts.map +1 -0
  463. package/dist/esm/generated/src/operations/index.js +12 -0
  464. package/dist/esm/generated/src/operations/index.js.map +1 -0
  465. package/dist/esm/generated/src/operations/service.d.ts +32 -0
  466. package/dist/esm/generated/src/operations/service.d.ts.map +1 -0
  467. package/dist/esm/generated/src/operations/service.js +135 -0
  468. package/dist/esm/generated/src/operations/service.js.map +1 -0
  469. package/dist/esm/generated/src/operations/share.d.ts +111 -0
  470. package/dist/esm/generated/src/operations/share.d.ts.map +1 -0
  471. package/dist/esm/generated/src/operations/share.js +671 -0
  472. package/dist/esm/generated/src/operations/share.js.map +1 -0
  473. package/dist/esm/generated/src/operationsInterfaces/directory.d.ts +57 -0
  474. package/dist/esm/generated/src/operationsInterfaces/directory.d.ts.map +1 -0
  475. package/dist/esm/generated/src/operationsInterfaces/directory.js +9 -0
  476. package/dist/esm/generated/src/operationsInterfaces/directory.js.map +1 -0
  477. package/dist/esm/generated/src/operationsInterfaces/file.d.ts +154 -0
  478. package/dist/esm/generated/src/operationsInterfaces/file.d.ts.map +1 -0
  479. package/dist/esm/generated/src/operationsInterfaces/file.js +9 -0
  480. package/dist/esm/generated/src/operationsInterfaces/file.js.map +1 -0
  481. package/dist/esm/generated/src/operationsInterfaces/index.d.ts +5 -0
  482. package/dist/esm/generated/src/operationsInterfaces/index.d.ts.map +1 -0
  483. package/dist/esm/generated/src/operationsInterfaces/index.js +12 -0
  484. package/dist/esm/generated/src/operationsInterfaces/index.js.map +1 -0
  485. package/dist/esm/generated/src/operationsInterfaces/service.d.ts +24 -0
  486. package/dist/esm/generated/src/operationsInterfaces/service.d.ts.map +1 -0
  487. package/dist/esm/generated/src/operationsInterfaces/service.js.map +1 -0
  488. package/dist/esm/generated/src/operationsInterfaces/share.d.ts +103 -0
  489. package/dist/esm/generated/src/operationsInterfaces/share.d.ts.map +1 -0
  490. package/dist/esm/generated/src/operationsInterfaces/share.js +9 -0
  491. package/dist/esm/generated/src/operationsInterfaces/share.js.map +1 -0
  492. package/dist/esm/generated/src/storageClient.d.ts +20 -0
  493. package/dist/esm/generated/src/storageClient.d.ts.map +1 -0
  494. package/dist/esm/generated/src/storageClient.js +48 -0
  495. package/dist/esm/generated/src/storageClient.js.map +1 -0
  496. package/dist/esm/generatedModels.d.ts +492 -0
  497. package/dist/esm/generatedModels.d.ts.map +1 -0
  498. package/dist/esm/generatedModels.js +8 -0
  499. package/dist/esm/generatedModels.js.map +1 -0
  500. package/dist/esm/index.d.ts +32 -0
  501. package/dist/esm/index.d.ts.map +1 -0
  502. package/dist/esm/index.js +30 -0
  503. package/dist/esm/index.js.map +1 -0
  504. package/dist/esm/log.d.ts +5 -0
  505. package/dist/esm/log.d.ts.map +1 -0
  506. package/dist/esm/log.js +8 -0
  507. package/dist/esm/log.js.map +1 -0
  508. package/dist/esm/models.d.ts +373 -0
  509. package/dist/esm/models.d.ts.map +1 -0
  510. package/dist/esm/models.js +94 -0
  511. package/dist/esm/models.js.map +1 -0
  512. package/dist/esm/package.json +3 -0
  513. package/dist/esm/policies/StorageRetryPolicy.d.ts +75 -0
  514. package/dist/esm/policies/StorageRetryPolicy.d.ts.map +1 -0
  515. package/dist/esm/policies/StorageRetryPolicy.js +220 -0
  516. package/dist/esm/policies/StorageRetryPolicy.js.map +1 -0
  517. package/dist/esm/policies/StorageRetryPolicyV2.d.ts +24 -0
  518. package/dist/esm/policies/StorageRetryPolicyV2.d.ts.map +1 -0
  519. package/dist/esm/policies/StorageRetryPolicyV2.js +176 -0
  520. package/dist/esm/policies/StorageRetryPolicyV2.js.map +1 -0
  521. package/dist/esm/utils/Batch.d.ts +68 -0
  522. package/dist/esm/utils/Batch.d.ts.map +1 -0
  523. package/dist/esm/utils/Batch.js.map +1 -0
  524. package/dist/esm/utils/BufferScheduler.d.ts +157 -0
  525. package/dist/esm/utils/BufferScheduler.d.ts.map +1 -0
  526. package/dist/esm/utils/BufferScheduler.js +264 -0
  527. package/dist/esm/utils/BufferScheduler.js.map +1 -0
  528. package/dist/esm/utils/RetriableReadableStream.d.ts +58 -0
  529. package/dist/esm/utils/RetriableReadableStream.d.ts.map +1 -0
  530. package/dist/esm/utils/RetriableReadableStream.js +119 -0
  531. package/dist/esm/utils/RetriableReadableStream.js.map +1 -0
  532. package/dist/esm/utils/constants.d.ts +55 -0
  533. package/dist/esm/utils/constants.d.ts.map +1 -0
  534. package/dist/esm/utils/constants.js +162 -0
  535. package/dist/esm/utils/constants.js.map +1 -0
  536. package/dist/esm/utils/tracing.d.ts +6 -0
  537. package/dist/esm/utils/tracing.d.ts.map +1 -0
  538. package/dist/esm/utils/tracing.js +14 -0
  539. package/dist/esm/utils/tracing.js.map +1 -0
  540. package/dist/esm/utils/utils.common.d.ts +304 -0
  541. package/dist/esm/utils/utils.common.d.ts.map +1 -0
  542. package/dist/esm/utils/utils.common.js +778 -0
  543. package/dist/esm/utils/utils.common.js.map +1 -0
  544. package/dist/esm/utils/utils.d.ts +28 -0
  545. package/dist/esm/utils/utils.d.ts.map +1 -0
  546. package/dist/esm/utils/utils.js +79 -0
  547. package/dist/esm/utils/utils.js.map +1 -0
  548. package/dist/react-native/AccountSASPermissions.d.ts +61 -0
  549. package/dist/react-native/AccountSASPermissions.d.ts.map +1 -0
  550. package/dist/react-native/AccountSASPermissions.js +128 -0
  551. package/dist/react-native/AccountSASPermissions.js.map +1 -0
  552. package/dist/react-native/AccountSASResourceTypes.d.ts +38 -0
  553. package/dist/react-native/AccountSASResourceTypes.d.ts.map +1 -0
  554. package/dist/react-native/AccountSASResourceTypes.js +72 -0
  555. package/dist/react-native/AccountSASResourceTypes.js.map +1 -0
  556. package/dist/react-native/AccountSASServices.d.ts +40 -0
  557. package/dist/react-native/AccountSASServices.d.ts.map +1 -0
  558. package/dist/react-native/AccountSASServices.js +80 -0
  559. package/dist/react-native/AccountSASServices.js.map +1 -0
  560. package/dist/react-native/AccountSASSignatureValues.d.ts +73 -0
  561. package/dist/react-native/AccountSASSignatureValues.d.ts.map +1 -0
  562. package/dist/react-native/AccountSASSignatureValues.js +71 -0
  563. package/dist/react-native/AccountSASSignatureValues.js.map +1 -0
  564. package/dist/react-native/Clients.d.ts +3114 -0
  565. package/dist/react-native/Clients.d.ts.map +1 -0
  566. package/dist/react-native/Clients.js +2882 -0
  567. package/dist/react-native/Clients.js.map +1 -0
  568. package/dist/react-native/FileDownloadResponse.d.ts +291 -0
  569. package/dist/react-native/FileDownloadResponse.d.ts.map +1 -0
  570. package/dist/react-native/FileDownloadResponse.js +367 -0
  571. package/dist/react-native/FileDownloadResponse.js.map +1 -0
  572. package/dist/react-native/FileSASPermissions.d.ts +42 -0
  573. package/dist/react-native/FileSASPermissions.d.ts.map +1 -0
  574. package/dist/react-native/FileSASPermissions.js +82 -0
  575. package/dist/react-native/FileSASPermissions.js.map +1 -0
  576. package/dist/react-native/FileSASSignatureValues.d.ts +95 -0
  577. package/dist/react-native/FileSASSignatureValues.d.ts.map +1 -0
  578. package/dist/react-native/FileSASSignatureValues.js +84 -0
  579. package/dist/react-native/FileSASSignatureValues.js.map +1 -0
  580. package/dist/react-native/FileSystemAttributes.d.ts +63 -0
  581. package/dist/react-native/FileSystemAttributes.d.ts.map +1 -0
  582. package/dist/react-native/FileSystemAttributes.js +144 -0
  583. package/dist/react-native/FileSystemAttributes.js.map +1 -0
  584. package/dist/react-native/Pipeline.d.ts +142 -0
  585. package/dist/react-native/Pipeline.d.ts.map +1 -0
  586. package/dist/react-native/Pipeline.js +261 -0
  587. package/dist/react-native/Pipeline.js.map +1 -0
  588. package/dist/react-native/Range.d.ts +25 -0
  589. package/dist/react-native/Range.d.ts.map +1 -0
  590. package/dist/react-native/Range.js +22 -0
  591. package/dist/react-native/Range.js.map +1 -0
  592. package/dist/react-native/SASQueryParameters.d.ts +136 -0
  593. package/dist/react-native/SASQueryParameters.d.ts.map +1 -0
  594. package/dist/react-native/SASQueryParameters.js +177 -0
  595. package/dist/react-native/SASQueryParameters.js.map +1 -0
  596. package/dist/react-native/SasIPRange.d.ts +25 -0
  597. package/dist/react-native/SasIPRange.d.ts.map +1 -0
  598. package/dist/react-native/SasIPRange.js +14 -0
  599. package/dist/react-native/SasIPRange.js.map +1 -0
  600. package/dist/react-native/ShareClientInternal.d.ts +12 -0
  601. package/dist/react-native/ShareClientInternal.d.ts.map +1 -0
  602. package/dist/react-native/ShareClientInternal.js +16 -0
  603. package/dist/react-native/ShareClientInternal.js.map +1 -0
  604. package/dist/react-native/ShareSASPermissions.d.ts +46 -0
  605. package/dist/react-native/ShareSASPermissions.d.ts.map +1 -0
  606. package/dist/react-native/ShareSASPermissions.js +92 -0
  607. package/dist/react-native/ShareSASPermissions.js.map +1 -0
  608. package/dist/react-native/ShareServiceClient.d.ts +427 -0
  609. package/dist/react-native/ShareServiceClient.d.ts.map +1 -0
  610. package/dist/react-native/ShareServiceClient.js +475 -0
  611. package/dist/react-native/ShareServiceClient.js.map +1 -0
  612. package/dist/react-native/StorageClient.d.ts +47 -0
  613. package/dist/react-native/StorageClient.d.ts.map +1 -0
  614. package/dist/react-native/StorageClient.js +30 -0
  615. package/dist/react-native/StorageClient.js.map +1 -0
  616. package/dist/react-native/StorageContextClient.d.ts +9 -0
  617. package/dist/react-native/StorageContextClient.d.ts.map +1 -0
  618. package/dist/react-native/StorageContextClient.js +18 -0
  619. package/dist/react-native/StorageContextClient.js.map +1 -0
  620. package/dist/react-native/StorageRetryPolicyFactory.d.ts +56 -0
  621. package/dist/react-native/StorageRetryPolicyFactory.d.ts.map +1 -0
  622. package/dist/react-native/StorageRetryPolicyFactory.js +26 -0
  623. package/dist/react-native/StorageRetryPolicyFactory.js.map +1 -0
  624. package/dist/react-native/generated/src/index.d.ts +4 -0
  625. package/dist/react-native/generated/src/index.d.ts.map +1 -0
  626. package/dist/react-native/generated/src/index.js +11 -0
  627. package/dist/react-native/generated/src/index.js.map +1 -0
  628. package/dist/react-native/generated/src/models/index.d.ts +2881 -0
  629. package/dist/react-native/generated/src/models/index.d.ts.map +1 -0
  630. package/dist/react-native/generated/src/models/index.js +166 -0
  631. package/dist/react-native/generated/src/models/index.js.map +1 -0
  632. package/dist/react-native/generated/src/models/mappers.d.ts +128 -0
  633. package/dist/react-native/generated/src/models/mappers.d.ts.map +1 -0
  634. package/dist/react-native/generated/src/models/mappers.js +5987 -0
  635. package/dist/react-native/generated/src/models/mappers.js.map +1 -0
  636. package/dist/react-native/generated/src/models/parameters.d.ts +128 -0
  637. package/dist/react-native/generated/src/models/parameters.d.ts.map +1 -0
  638. package/dist/react-native/generated/src/models/parameters.js +1364 -0
  639. package/dist/react-native/generated/src/models/parameters.js.map +1 -0
  640. package/dist/react-native/generated/src/operations/directory.d.ts +65 -0
  641. package/dist/react-native/generated/src/operations/directory.d.ts.map +1 -0
  642. package/dist/react-native/generated/src/operations/directory.js +378 -0
  643. package/dist/react-native/generated/src/operations/directory.js.map +1 -0
  644. package/dist/react-native/generated/src/operations/file.d.ts +162 -0
  645. package/dist/react-native/generated/src/operations/file.d.ts.map +1 -0
  646. package/dist/react-native/generated/src/operations/file.js +866 -0
  647. package/dist/react-native/generated/src/operations/file.js.map +1 -0
  648. package/dist/react-native/generated/src/operations/index.d.ts +5 -0
  649. package/dist/react-native/generated/src/operations/index.d.ts.map +1 -0
  650. package/dist/react-native/generated/src/operations/index.js +12 -0
  651. package/dist/react-native/generated/src/operations/index.js.map +1 -0
  652. package/dist/react-native/generated/src/operations/service.d.ts +32 -0
  653. package/dist/react-native/generated/src/operations/service.d.ts.map +1 -0
  654. package/dist/react-native/generated/src/operations/service.js +135 -0
  655. package/dist/react-native/generated/src/operations/service.js.map +1 -0
  656. package/dist/react-native/generated/src/operations/share.d.ts +111 -0
  657. package/dist/react-native/generated/src/operations/share.d.ts.map +1 -0
  658. package/dist/react-native/generated/src/operations/share.js +671 -0
  659. package/dist/react-native/generated/src/operations/share.js.map +1 -0
  660. package/dist/react-native/generated/src/operationsInterfaces/directory.d.ts +57 -0
  661. package/dist/react-native/generated/src/operationsInterfaces/directory.d.ts.map +1 -0
  662. package/dist/react-native/generated/src/operationsInterfaces/directory.js +9 -0
  663. package/dist/react-native/generated/src/operationsInterfaces/directory.js.map +1 -0
  664. package/dist/react-native/generated/src/operationsInterfaces/file.d.ts +154 -0
  665. package/dist/react-native/generated/src/operationsInterfaces/file.d.ts.map +1 -0
  666. package/dist/react-native/generated/src/operationsInterfaces/file.js +9 -0
  667. package/dist/react-native/generated/src/operationsInterfaces/file.js.map +1 -0
  668. package/dist/react-native/generated/src/operationsInterfaces/index.d.ts +5 -0
  669. package/dist/react-native/generated/src/operationsInterfaces/index.d.ts.map +1 -0
  670. package/dist/react-native/generated/src/operationsInterfaces/index.js +12 -0
  671. package/dist/react-native/generated/src/operationsInterfaces/index.js.map +1 -0
  672. package/dist/react-native/generated/src/operationsInterfaces/service.d.ts +24 -0
  673. package/dist/react-native/generated/src/operationsInterfaces/service.d.ts.map +1 -0
  674. package/dist/react-native/generated/src/operationsInterfaces/service.js +9 -0
  675. package/dist/react-native/generated/src/operationsInterfaces/service.js.map +1 -0
  676. package/dist/react-native/generated/src/operationsInterfaces/share.d.ts +103 -0
  677. package/dist/react-native/generated/src/operationsInterfaces/share.d.ts.map +1 -0
  678. package/dist/react-native/generated/src/operationsInterfaces/share.js +9 -0
  679. package/dist/react-native/generated/src/operationsInterfaces/share.js.map +1 -0
  680. package/dist/react-native/generated/src/storageClient.d.ts +20 -0
  681. package/dist/react-native/generated/src/storageClient.d.ts.map +1 -0
  682. package/dist/react-native/generated/src/storageClient.js +48 -0
  683. package/dist/react-native/generated/src/storageClient.js.map +1 -0
  684. package/dist/react-native/generatedModels.d.ts +492 -0
  685. package/dist/react-native/generatedModels.d.ts.map +1 -0
  686. package/dist/react-native/generatedModels.js +8 -0
  687. package/dist/react-native/generatedModels.js.map +1 -0
  688. package/dist/react-native/index.d.ts +32 -0
  689. package/dist/react-native/index.d.ts.map +1 -0
  690. package/dist/react-native/index.js +30 -0
  691. package/dist/react-native/index.js.map +1 -0
  692. package/dist/react-native/log.d.ts +5 -0
  693. package/dist/react-native/log.d.ts.map +1 -0
  694. package/dist/react-native/log.js +8 -0
  695. package/dist/react-native/log.js.map +1 -0
  696. package/dist/react-native/models.d.ts +373 -0
  697. package/dist/react-native/models.d.ts.map +1 -0
  698. package/dist/react-native/models.js +94 -0
  699. package/dist/react-native/models.js.map +1 -0
  700. package/dist/react-native/package.json +3 -0
  701. package/dist/react-native/policies/StorageRetryPolicy.d.ts +75 -0
  702. package/dist/react-native/policies/StorageRetryPolicy.d.ts.map +1 -0
  703. package/dist/react-native/policies/StorageRetryPolicy.js +220 -0
  704. package/dist/react-native/policies/StorageRetryPolicy.js.map +1 -0
  705. package/dist/react-native/policies/StorageRetryPolicyV2.d.ts +24 -0
  706. package/dist/react-native/policies/StorageRetryPolicyV2.d.ts.map +1 -0
  707. package/dist/react-native/policies/StorageRetryPolicyV2.js +176 -0
  708. package/dist/react-native/policies/StorageRetryPolicyV2.js.map +1 -0
  709. package/dist/react-native/utils/Batch.d.ts +68 -0
  710. package/dist/react-native/utils/Batch.d.ts.map +1 -0
  711. package/dist/react-native/utils/Batch.js +122 -0
  712. package/dist/react-native/utils/Batch.js.map +1 -0
  713. package/dist/react-native/utils/BufferScheduler.d.ts +157 -0
  714. package/dist/react-native/utils/BufferScheduler.d.ts.map +1 -0
  715. package/dist/react-native/utils/BufferScheduler.js +264 -0
  716. package/dist/react-native/utils/BufferScheduler.js.map +1 -0
  717. package/dist/react-native/utils/RetriableReadableStream.d.ts +58 -0
  718. package/dist/react-native/utils/RetriableReadableStream.d.ts.map +1 -0
  719. package/dist/react-native/utils/RetriableReadableStream.js +119 -0
  720. package/dist/react-native/utils/RetriableReadableStream.js.map +1 -0
  721. package/dist/react-native/utils/constants.d.ts +55 -0
  722. package/dist/react-native/utils/constants.d.ts.map +1 -0
  723. package/dist/react-native/utils/constants.js +162 -0
  724. package/dist/react-native/utils/constants.js.map +1 -0
  725. package/dist/react-native/utils/tracing.d.ts +6 -0
  726. package/dist/react-native/utils/tracing.d.ts.map +1 -0
  727. package/dist/react-native/utils/tracing.js +14 -0
  728. package/dist/react-native/utils/tracing.js.map +1 -0
  729. package/dist/react-native/utils/utils.common.d.ts +304 -0
  730. package/dist/react-native/utils/utils.common.d.ts.map +1 -0
  731. package/dist/react-native/utils/utils.common.js +778 -0
  732. package/dist/react-native/utils/utils.common.js.map +1 -0
  733. package/dist/react-native/utils/utils.d.ts +28 -0
  734. package/dist/react-native/utils/utils.d.ts.map +1 -0
  735. package/dist/react-native/utils/utils.js +79 -0
  736. package/dist/react-native/utils/utils.js.map +1 -0
  737. package/package.json +69 -74
  738. package/dist/index.js +0 -16901
  739. package/dist/index.js.map +0 -1
  740. package/dist-esm/storage-blob/src/BatchResponse.js +0 -4
  741. package/dist-esm/storage-blob/src/BatchResponse.js.map +0 -1
  742. package/dist-esm/storage-blob/src/BatchResponseParser.js +0 -137
  743. package/dist-esm/storage-blob/src/BatchResponseParser.js.map +0 -1
  744. package/dist-esm/storage-blob/src/BatchUtils.js +0 -15
  745. package/dist-esm/storage-blob/src/BatchUtils.js.map +0 -1
  746. package/dist-esm/storage-blob/src/BlobBatch.js +0 -267
  747. package/dist-esm/storage-blob/src/BlobBatch.js.map +0 -1
  748. package/dist-esm/storage-blob/src/BlobBatchClient.js +0 -140
  749. package/dist-esm/storage-blob/src/BlobBatchClient.js.map +0 -1
  750. package/dist-esm/storage-blob/src/BlobDownloadResponse.js +0 -463
  751. package/dist-esm/storage-blob/src/BlobDownloadResponse.js.map +0 -1
  752. package/dist-esm/storage-blob/src/BlobLeaseClient.js +0 -192
  753. package/dist-esm/storage-blob/src/BlobLeaseClient.js.map +0 -1
  754. package/dist-esm/storage-blob/src/BlobQueryResponse.js +0 -367
  755. package/dist-esm/storage-blob/src/BlobQueryResponse.js.map +0 -1
  756. package/dist-esm/storage-blob/src/BlobServiceClient.js +0 -716
  757. package/dist-esm/storage-blob/src/BlobServiceClient.js.map +0 -1
  758. package/dist-esm/storage-blob/src/Clients.js +0 -2594
  759. package/dist-esm/storage-blob/src/Clients.js.map +0 -1
  760. package/dist-esm/storage-blob/src/ContainerClient.js +0 -1209
  761. package/dist-esm/storage-blob/src/ContainerClient.js.map +0 -1
  762. package/dist-esm/storage-blob/src/PageBlobRangeResponse.js +0 -24
  763. package/dist-esm/storage-blob/src/PageBlobRangeResponse.js.map +0 -1
  764. package/dist-esm/storage-blob/src/Pipeline.js +0 -261
  765. package/dist-esm/storage-blob/src/Pipeline.js.map +0 -1
  766. package/dist-esm/storage-blob/src/Range.js +0 -21
  767. package/dist-esm/storage-blob/src/Range.js.map +0 -1
  768. package/dist-esm/storage-blob/src/StorageBrowserPolicyFactory.js +0 -19
  769. package/dist-esm/storage-blob/src/StorageBrowserPolicyFactory.js.map +0 -1
  770. package/dist-esm/storage-blob/src/StorageClient.js +0 -29
  771. package/dist-esm/storage-blob/src/StorageClient.js.map +0 -1
  772. package/dist-esm/storage-blob/src/StorageContextClient.js +0 -17
  773. package/dist-esm/storage-blob/src/StorageContextClient.js.map +0 -1
  774. package/dist-esm/storage-blob/src/StorageRetryPolicyFactory.js +0 -26
  775. package/dist-esm/storage-blob/src/StorageRetryPolicyFactory.js.map +0 -1
  776. package/dist-esm/storage-blob/src/credentials/AnonymousCredential.js +0 -22
  777. package/dist-esm/storage-blob/src/credentials/AnonymousCredential.js.map +0 -1
  778. package/dist-esm/storage-blob/src/credentials/Credential.js +0 -18
  779. package/dist-esm/storage-blob/src/credentials/Credential.js.map +0 -1
  780. package/dist-esm/storage-blob/src/credentials/StorageSharedKeyCredential.browser.js +0 -5
  781. package/dist-esm/storage-blob/src/credentials/StorageSharedKeyCredential.browser.js.map +0 -1
  782. package/dist-esm/storage-blob/src/credentials/StorageSharedKeyCredential.js +0 -40
  783. package/dist-esm/storage-blob/src/credentials/StorageSharedKeyCredential.js.map +0 -1
  784. package/dist-esm/storage-blob/src/credentials/UserDelegationKeyCredential.browser.js +0 -5
  785. package/dist-esm/storage-blob/src/credentials/UserDelegationKeyCredential.browser.js.map +0 -1
  786. package/dist-esm/storage-blob/src/credentials/UserDelegationKeyCredential.js +0 -31
  787. package/dist-esm/storage-blob/src/credentials/UserDelegationKeyCredential.js.map +0 -1
  788. package/dist-esm/storage-blob/src/generated/src/index.js +0 -11
  789. package/dist-esm/storage-blob/src/generated/src/index.js.map +0 -1
  790. package/dist-esm/storage-blob/src/generated/src/models/index.js +0 -258
  791. package/dist-esm/storage-blob/src/generated/src/models/index.js.map +0 -1
  792. package/dist-esm/storage-blob/src/generated/src/models/mappers.js +0 -8225
  793. package/dist-esm/storage-blob/src/generated/src/models/mappers.js.map +0 -1
  794. package/dist-esm/storage-blob/src/generated/src/models/parameters.js +0 -1610
  795. package/dist-esm/storage-blob/src/generated/src/models/parameters.js.map +0 -1
  796. package/dist-esm/storage-blob/src/generated/src/operations/appendBlob.js +0 -221
  797. package/dist-esm/storage-blob/src/generated/src/operations/appendBlob.js.map +0 -1
  798. package/dist-esm/storage-blob/src/generated/src/operations/blob.js +0 -1020
  799. package/dist-esm/storage-blob/src/generated/src/operations/blob.js.map +0 -1
  800. package/dist-esm/storage-blob/src/generated/src/operations/blockBlob.js +0 -365
  801. package/dist-esm/storage-blob/src/generated/src/operations/blockBlob.js.map +0 -1
  802. package/dist-esm/storage-blob/src/generated/src/operations/container.js +0 -713
  803. package/dist-esm/storage-blob/src/generated/src/operations/container.js.map +0 -1
  804. package/dist-esm/storage-blob/src/generated/src/operations/index.js +0 -14
  805. package/dist-esm/storage-blob/src/generated/src/operations/index.js.map +0 -1
  806. package/dist-esm/storage-blob/src/generated/src/operations/pageBlob.js +0 -456
  807. package/dist-esm/storage-blob/src/generated/src/operations/pageBlob.js.map +0 -1
  808. package/dist-esm/storage-blob/src/generated/src/operations/service.js +0 -323
  809. package/dist-esm/storage-blob/src/generated/src/operations/service.js.map +0 -1
  810. package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/appendBlob.js +0 -9
  811. package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/appendBlob.js.map +0 -1
  812. package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/blob.js +0 -9
  813. package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/blob.js.map +0 -1
  814. package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/blockBlob.js +0 -9
  815. package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/blockBlob.js.map +0 -1
  816. package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/container.js +0 -9
  817. package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/container.js.map +0 -1
  818. package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/index.js +0 -14
  819. package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/index.js.map +0 -1
  820. package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/pageBlob.js +0 -9
  821. package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/pageBlob.js.map +0 -1
  822. package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/service.js.map +0 -1
  823. package/dist-esm/storage-blob/src/generated/src/storageClient.js +0 -49
  824. package/dist-esm/storage-blob/src/generated/src/storageClient.js.map +0 -1
  825. package/dist-esm/storage-blob/src/generatedModels.js +0 -8
  826. package/dist-esm/storage-blob/src/generatedModels.js.map +0 -1
  827. package/dist-esm/storage-blob/src/index.js +0 -33
  828. package/dist-esm/storage-blob/src/index.js.map +0 -1
  829. package/dist-esm/storage-blob/src/log.js +0 -8
  830. package/dist-esm/storage-blob/src/log.js.map +0 -1
  831. package/dist-esm/storage-blob/src/models.js +0 -115
  832. package/dist-esm/storage-blob/src/models.js.map +0 -1
  833. package/dist-esm/storage-blob/src/policies/AnonymousCredentialPolicy.js +0 -20
  834. package/dist-esm/storage-blob/src/policies/AnonymousCredentialPolicy.js.map +0 -1
  835. package/dist-esm/storage-blob/src/policies/CredentialPolicy.js +0 -29
  836. package/dist-esm/storage-blob/src/policies/CredentialPolicy.js.map +0 -1
  837. package/dist-esm/storage-blob/src/policies/RequestPolicy.js +0 -40
  838. package/dist-esm/storage-blob/src/policies/RequestPolicy.js.map +0 -1
  839. package/dist-esm/storage-blob/src/policies/StorageBrowserPolicy.js +0 -47
  840. package/dist-esm/storage-blob/src/policies/StorageBrowserPolicy.js.map +0 -1
  841. package/dist-esm/storage-blob/src/policies/StorageBrowserPolicyV2.js +0 -31
  842. package/dist-esm/storage-blob/src/policies/StorageBrowserPolicyV2.js.map +0 -1
  843. package/dist-esm/storage-blob/src/policies/StorageCorrectContentLengthPolicy.browser.js +0 -18
  844. package/dist-esm/storage-blob/src/policies/StorageCorrectContentLengthPolicy.browser.js.map +0 -1
  845. package/dist-esm/storage-blob/src/policies/StorageCorrectContentLengthPolicy.js +0 -27
  846. package/dist-esm/storage-blob/src/policies/StorageCorrectContentLengthPolicy.js.map +0 -1
  847. package/dist-esm/storage-blob/src/policies/StorageRetryPolicy.js +0 -229
  848. package/dist-esm/storage-blob/src/policies/StorageRetryPolicy.js.map +0 -1
  849. package/dist-esm/storage-blob/src/policies/StorageRetryPolicyV2.js +0 -180
  850. package/dist-esm/storage-blob/src/policies/StorageRetryPolicyV2.js.map +0 -1
  851. package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicy.js +0 -141
  852. package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicy.js.map +0 -1
  853. package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicyV2.browser.js +0 -18
  854. package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicyV2.browser.js.map +0 -1
  855. package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicyV2.js +0 -132
  856. package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicyV2.js.map +0 -1
  857. package/dist-esm/storage-blob/src/pollers/BlobStartCopyFromUrlPoller.js +0 -130
  858. package/dist-esm/storage-blob/src/pollers/BlobStartCopyFromUrlPoller.js.map +0 -1
  859. package/dist-esm/storage-blob/src/sas/AccountSASPermissions.js +0 -227
  860. package/dist-esm/storage-blob/src/sas/AccountSASPermissions.js.map +0 -1
  861. package/dist-esm/storage-blob/src/sas/AccountSASResourceTypes.js.map +0 -1
  862. package/dist-esm/storage-blob/src/sas/AccountSASServices.js.map +0 -1
  863. package/dist-esm/storage-blob/src/sas/AccountSASSignatureValues.js +0 -100
  864. package/dist-esm/storage-blob/src/sas/AccountSASSignatureValues.js.map +0 -1
  865. package/dist-esm/storage-blob/src/sas/BlobSASPermissions.js +0 -195
  866. package/dist-esm/storage-blob/src/sas/BlobSASPermissions.js.map +0 -1
  867. package/dist-esm/storage-blob/src/sas/BlobSASSignatureValues.js +0 -576
  868. package/dist-esm/storage-blob/src/sas/BlobSASSignatureValues.js.map +0 -1
  869. package/dist-esm/storage-blob/src/sas/ContainerSASPermissions.js +0 -221
  870. package/dist-esm/storage-blob/src/sas/ContainerSASPermissions.js.map +0 -1
  871. package/dist-esm/storage-blob/src/sas/SASQueryParameters.js +0 -234
  872. package/dist-esm/storage-blob/src/sas/SASQueryParameters.js.map +0 -1
  873. package/dist-esm/storage-blob/src/sas/SasIPRange.js +0 -13
  874. package/dist-esm/storage-blob/src/sas/SasIPRange.js.map +0 -1
  875. package/dist-esm/storage-blob/src/utils/Batch.js.map +0 -1
  876. package/dist-esm/storage-blob/src/utils/BlobQuickQueryStream.js +0 -111
  877. package/dist-esm/storage-blob/src/utils/BlobQuickQueryStream.js.map +0 -1
  878. package/dist-esm/storage-blob/src/utils/Mutex.js +0 -65
  879. package/dist-esm/storage-blob/src/utils/Mutex.js.map +0 -1
  880. package/dist-esm/storage-blob/src/utils/RetriableReadableStream.js +0 -119
  881. package/dist-esm/storage-blob/src/utils/RetriableReadableStream.js.map +0 -1
  882. package/dist-esm/storage-blob/src/utils/SharedKeyComparator.js +0 -73
  883. package/dist-esm/storage-blob/src/utils/SharedKeyComparator.js.map +0 -1
  884. package/dist-esm/storage-blob/src/utils/cache.js +0 -11
  885. package/dist-esm/storage-blob/src/utils/cache.js.map +0 -1
  886. package/dist-esm/storage-blob/src/utils/constants.js +0 -226
  887. package/dist-esm/storage-blob/src/utils/constants.js.map +0 -1
  888. package/dist-esm/storage-blob/src/utils/tracing.js +0 -14
  889. package/dist-esm/storage-blob/src/utils/tracing.js.map +0 -1
  890. package/dist-esm/storage-blob/src/utils/utils.common.js +0 -756
  891. package/dist-esm/storage-blob/src/utils/utils.common.js.map +0 -1
  892. package/dist-esm/storage-blob/src/utils/utils.node.js +0 -132
  893. package/dist-esm/storage-blob/src/utils/utils.node.js.map +0 -1
  894. package/dist-esm/storage-file-share/src/AccountSASPermissions.js.map +0 -1
  895. package/dist-esm/storage-file-share/src/AccountSASResourceTypes.js.map +0 -1
  896. package/dist-esm/storage-file-share/src/AccountSASServices.js.map +0 -1
  897. package/dist-esm/storage-file-share/src/AccountSASSignatureValues.js +0 -71
  898. package/dist-esm/storage-file-share/src/AccountSASSignatureValues.js.map +0 -1
  899. package/dist-esm/storage-file-share/src/Clients.js +0 -2642
  900. package/dist-esm/storage-file-share/src/Clients.js.map +0 -1
  901. package/dist-esm/storage-file-share/src/FileDownloadResponse.browser.js +0 -7
  902. package/dist-esm/storage-file-share/src/FileDownloadResponse.browser.js.map +0 -1
  903. package/dist-esm/storage-file-share/src/FileDownloadResponse.js +0 -367
  904. package/dist-esm/storage-file-share/src/FileDownloadResponse.js.map +0 -1
  905. package/dist-esm/storage-file-share/src/FileSASPermissions.js.map +0 -1
  906. package/dist-esm/storage-file-share/src/FileSASSignatureValues.js +0 -84
  907. package/dist-esm/storage-file-share/src/FileSASSignatureValues.js.map +0 -1
  908. package/dist-esm/storage-file-share/src/FileSystemAttributes.js.map +0 -1
  909. package/dist-esm/storage-file-share/src/Pipeline.js +0 -261
  910. package/dist-esm/storage-file-share/src/Pipeline.js.map +0 -1
  911. package/dist-esm/storage-file-share/src/Range.js.map +0 -1
  912. package/dist-esm/storage-file-share/src/SASQueryParameters.js +0 -177
  913. package/dist-esm/storage-file-share/src/SASQueryParameters.js.map +0 -1
  914. package/dist-esm/storage-file-share/src/SasIPRange.js.map +0 -1
  915. package/dist-esm/storage-file-share/src/ShareClientInternal.js +0 -16
  916. package/dist-esm/storage-file-share/src/ShareClientInternal.js.map +0 -1
  917. package/dist-esm/storage-file-share/src/ShareSASPermissions.js.map +0 -1
  918. package/dist-esm/storage-file-share/src/ShareServiceClient.js +0 -429
  919. package/dist-esm/storage-file-share/src/ShareServiceClient.js.map +0 -1
  920. package/dist-esm/storage-file-share/src/StorageClient.js +0 -30
  921. package/dist-esm/storage-file-share/src/StorageClient.js.map +0 -1
  922. package/dist-esm/storage-file-share/src/StorageContextClient.js +0 -18
  923. package/dist-esm/storage-file-share/src/StorageContextClient.js.map +0 -1
  924. package/dist-esm/storage-file-share/src/StorageRetryPolicyFactory.js +0 -26
  925. package/dist-esm/storage-file-share/src/StorageRetryPolicyFactory.js.map +0 -1
  926. package/dist-esm/storage-file-share/src/generated/src/index.js +0 -11
  927. package/dist-esm/storage-file-share/src/generated/src/index.js.map +0 -1
  928. package/dist-esm/storage-file-share/src/generated/src/models/index.js.map +0 -1
  929. package/dist-esm/storage-file-share/src/generated/src/models/mappers.js.map +0 -1
  930. package/dist-esm/storage-file-share/src/generated/src/models/parameters.js +0 -1364
  931. package/dist-esm/storage-file-share/src/generated/src/models/parameters.js.map +0 -1
  932. package/dist-esm/storage-file-share/src/generated/src/operations/directory.js +0 -378
  933. package/dist-esm/storage-file-share/src/generated/src/operations/directory.js.map +0 -1
  934. package/dist-esm/storage-file-share/src/generated/src/operations/file.js +0 -866
  935. package/dist-esm/storage-file-share/src/generated/src/operations/file.js.map +0 -1
  936. package/dist-esm/storage-file-share/src/generated/src/operations/index.js +0 -12
  937. package/dist-esm/storage-file-share/src/generated/src/operations/index.js.map +0 -1
  938. package/dist-esm/storage-file-share/src/generated/src/operations/service.js +0 -135
  939. package/dist-esm/storage-file-share/src/generated/src/operations/service.js.map +0 -1
  940. package/dist-esm/storage-file-share/src/generated/src/operations/share.js +0 -671
  941. package/dist-esm/storage-file-share/src/generated/src/operations/share.js.map +0 -1
  942. package/dist-esm/storage-file-share/src/generated/src/operationsInterfaces/directory.js.map +0 -1
  943. package/dist-esm/storage-file-share/src/generated/src/operationsInterfaces/file.js.map +0 -1
  944. package/dist-esm/storage-file-share/src/generated/src/operationsInterfaces/index.js +0 -12
  945. package/dist-esm/storage-file-share/src/generated/src/operationsInterfaces/index.js.map +0 -1
  946. package/dist-esm/storage-file-share/src/generated/src/operationsInterfaces/service.js.map +0 -1
  947. package/dist-esm/storage-file-share/src/generated/src/operationsInterfaces/share.js.map +0 -1
  948. package/dist-esm/storage-file-share/src/generated/src/storageClient.js +0 -48
  949. package/dist-esm/storage-file-share/src/generated/src/storageClient.js.map +0 -1
  950. package/dist-esm/storage-file-share/src/generatedModels.js.map +0 -1
  951. package/dist-esm/storage-file-share/src/index.browser.js +0 -19
  952. package/dist-esm/storage-file-share/src/index.browser.js.map +0 -1
  953. package/dist-esm/storage-file-share/src/index.js +0 -30
  954. package/dist-esm/storage-file-share/src/index.js.map +0 -1
  955. package/dist-esm/storage-file-share/src/log.js.map +0 -1
  956. package/dist-esm/storage-file-share/src/models.js +0 -94
  957. package/dist-esm/storage-file-share/src/models.js.map +0 -1
  958. package/dist-esm/storage-file-share/src/policies/StorageRetryPolicy.js +0 -220
  959. package/dist-esm/storage-file-share/src/policies/StorageRetryPolicy.js.map +0 -1
  960. package/dist-esm/storage-file-share/src/policies/StorageRetryPolicyV2.js +0 -176
  961. package/dist-esm/storage-file-share/src/policies/StorageRetryPolicyV2.js.map +0 -1
  962. package/dist-esm/storage-file-share/src/utils/Batch.js.map +0 -1
  963. package/dist-esm/storage-file-share/src/utils/BufferScheduler.js.map +0 -1
  964. package/dist-esm/storage-file-share/src/utils/RetriableReadableStream.js +0 -119
  965. package/dist-esm/storage-file-share/src/utils/RetriableReadableStream.js.map +0 -1
  966. package/dist-esm/storage-file-share/src/utils/constants.js +0 -162
  967. package/dist-esm/storage-file-share/src/utils/constants.js.map +0 -1
  968. package/dist-esm/storage-file-share/src/utils/tracing.js +0 -14
  969. package/dist-esm/storage-file-share/src/utils/tracing.js.map +0 -1
  970. package/dist-esm/storage-file-share/src/utils/utils.browser.js +0 -30
  971. package/dist-esm/storage-file-share/src/utils/utils.browser.js.map +0 -1
  972. package/dist-esm/storage-file-share/src/utils/utils.common.js +0 -777
  973. package/dist-esm/storage-file-share/src/utils/utils.common.js.map +0 -1
  974. package/dist-esm/storage-file-share/src/utils/utils.node.js +0 -79
  975. package/dist-esm/storage-file-share/src/utils/utils.node.js.map +0 -1
  976. package/types/latest/storage-file-share.d.ts +0 -8411
  977. /package/{dist-esm/storage-file-share/src → dist/browser}/AccountSASPermissions.js +0 -0
  978. /package/{dist-esm/storage-blob/src/sas → dist/browser}/AccountSASResourceTypes.js +0 -0
  979. /package/{dist-esm/storage-blob/src/sas → dist/browser}/AccountSASServices.js +0 -0
  980. /package/{dist-esm/storage-file-share/src → dist/browser}/FileSASPermissions.js +0 -0
  981. /package/{dist-esm/storage-file-share/src → dist/browser}/FileSystemAttributes.js +0 -0
  982. /package/{dist-esm/storage-file-share/src → dist/browser}/Range.js +0 -0
  983. /package/{dist-esm/storage-file-share/src → dist/browser}/SasIPRange.js +0 -0
  984. /package/{dist-esm/storage-file-share/src → dist/browser}/ShareSASPermissions.js +0 -0
  985. /package/{dist-esm/storage-file-share/src → dist/browser}/generated/src/models/index.js +0 -0
  986. /package/{dist-esm/storage-file-share/src → dist/browser}/generated/src/models/mappers.js +0 -0
  987. /package/{dist-esm/storage-file-share/src → dist/browser}/generated/src/operationsInterfaces/directory.js +0 -0
  988. /package/{dist-esm/storage-file-share/src → dist/browser}/generated/src/operationsInterfaces/file.js +0 -0
  989. /package/{dist-esm/storage-blob/src → dist/browser}/generated/src/operationsInterfaces/service.js +0 -0
  990. /package/{dist-esm/storage-file-share/src → dist/browser}/generated/src/operationsInterfaces/share.js +0 -0
  991. /package/{dist-esm/storage-file-share/src → dist/browser}/generatedModels.js +0 -0
  992. /package/{dist-esm/storage-file-share/src → dist/browser}/log.js +0 -0
  993. /package/{dist-esm/storage-blob/src → dist/browser}/utils/Batch.js +0 -0
  994. /package/{dist-esm/storage-file-share/src → dist/browser}/utils/BufferScheduler.js +0 -0
  995. /package/{dist-esm/storage-file-share/src → dist/esm}/AccountSASResourceTypes.js +0 -0
  996. /package/{dist-esm/storage-file-share/src → dist/esm}/AccountSASServices.js +0 -0
  997. /package/{dist-esm/storage-file-share/src → dist/esm}/generated/src/operationsInterfaces/service.js +0 -0
  998. /package/{dist-esm/storage-file-share/src → dist/esm}/utils/Batch.js +0 -0
@@ -1,2642 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
- import { __asyncGenerator, __asyncValues, __await } from "tslib";
4
- import { isTokenCredential } from "@azure/core-auth";
5
- import { isNode } from "@azure/core-util";
6
- import { isPipelineLike, newPipeline } from "./Pipeline";
7
- import { DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS, DEFAULT_HIGH_LEVEL_CONCURRENCY, FILE_MAX_SIZE_BYTES, FILE_RANGE_MAX_SIZE_BYTES, URLConstants, } from "./utils/constants";
8
- import { appendToURLPath, setURLParameter, truncatedISO8061Date, extractConnectionStringParts, getShareNameAndPathFromUrl, appendToURLQuery, httpAuthorizationToString, setURLPath, setURLQueries, EscapePath, ConvertInternalResponseOfListFiles, ConvertInternalResponseOfListHandles, assertResponse, removeEmptyString, asSharePermission, parseOctalFileMode, toOctalFileMode, } from "./utils/utils.common";
9
- import { Credential } from "../../storage-blob/src/credentials/Credential";
10
- import { StorageSharedKeyCredential } from "../../storage-blob/src/credentials/StorageSharedKeyCredential";
11
- import { AnonymousCredential } from "../../storage-blob/src/credentials/AnonymousCredential";
12
- import { tracingClient } from "./utils/tracing";
13
- import { StorageClient } from "./StorageClient";
14
- import { FileDownloadResponse } from "./FileDownloadResponse";
15
- import { rangeToString } from "./Range";
16
- import { fileAttributesToString, fileCreationTimeToString, fileLastWriteTimeToString, validateAndSetDefaultsForFileAndDirectoryCreateCommonOptions, validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions, toShareProtocolsString, toShareProtocols, fileChangeTimeToString, } from "./models";
17
- import { Batch } from "./utils/Batch";
18
- import { BufferScheduler } from "./utils/BufferScheduler";
19
- import { fsStat, fsCreateReadStream, readStreamToLocalFile, streamToBuffer, } from "./utils/utils.node";
20
- import { randomUUID } from "@azure/core-util";
21
- import { generateFileSASQueryParameters, generateFileSASQueryParametersInternal, } from "./FileSASSignatureValues";
22
- /**
23
- * A ShareClient represents a URL to the Azure Storage share allowing you to manipulate its directories and files.
24
- */
25
- export class ShareClient extends StorageClient {
26
- /**
27
- * The name of the share
28
- */
29
- get name() {
30
- return this._name;
31
- }
32
- constructor(urlOrConnectionString, credentialOrPipelineOrShareName,
33
- // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.
34
- options) {
35
- let pipeline;
36
- let url;
37
- if (isPipelineLike(credentialOrPipelineOrShareName)) {
38
- // (url: string, pipeline: Pipeline)
39
- url = urlOrConnectionString;
40
- pipeline = credentialOrPipelineOrShareName;
41
- }
42
- else if (credentialOrPipelineOrShareName instanceof Credential ||
43
- isTokenCredential(credentialOrPipelineOrShareName)) {
44
- // (url: string, credential?: Credential, options?: ShareClientOptions)
45
- url = urlOrConnectionString;
46
- pipeline = newPipeline(credentialOrPipelineOrShareName, options);
47
- }
48
- else if (!credentialOrPipelineOrShareName &&
49
- typeof credentialOrPipelineOrShareName !== "string") {
50
- // (url: string, credential?: Credential, options?: ShareClientOptions)
51
- // The second parameter is undefined. Use anonymous credential.
52
- url = urlOrConnectionString;
53
- pipeline = newPipeline(new AnonymousCredential(), options);
54
- }
55
- else if (credentialOrPipelineOrShareName &&
56
- typeof credentialOrPipelineOrShareName === "string") {
57
- // (connectionString: string, name: string, options?: ShareClientOptions)
58
- const extractedCreds = extractConnectionStringParts(urlOrConnectionString);
59
- const name = credentialOrPipelineOrShareName;
60
- if (extractedCreds.kind === "AccountConnString") {
61
- if (isNode) {
62
- const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);
63
- url = appendToURLPath(extractedCreds.url, name);
64
- pipeline = newPipeline(sharedKeyCredential, options);
65
- }
66
- else {
67
- throw new Error("Account connection string is only supported in Node.js environment");
68
- }
69
- }
70
- else if (extractedCreds.kind === "SASConnString") {
71
- url = appendToURLPath(extractedCreds.url, name) + "?" + extractedCreds.accountSas;
72
- pipeline = newPipeline(new AnonymousCredential(), options);
73
- }
74
- else {
75
- throw new Error("Connection string must be either an Account connection string or a SAS connection string");
76
- }
77
- }
78
- else {
79
- throw new Error("Expecting non-empty strings for name parameter");
80
- }
81
- super(url, pipeline);
82
- this._name = getShareNameAndPathFromUrl(this.url).shareName;
83
- this.shareClientConfig = options;
84
- this.context = this.storageClientContext.share;
85
- }
86
- /**
87
- * Creates a new ShareClient object identical to the source but with the specified snapshot timestamp.
88
- * Provide "" will remove the snapshot and return a URL to the base share.
89
- *
90
- * @param snapshot - The snapshot timestamp.
91
- * @returns A new ShareClient object identical to the source but with the specified snapshot timestamp
92
- */
93
- withSnapshot(snapshot) {
94
- return new ShareClient(setURLParameter(this.url, URLConstants.Parameters.SHARE_SNAPSHOT, snapshot.length === 0 ? undefined : snapshot), this.pipeline, this.shareClientConfig);
95
- }
96
- /**
97
- * Creates a new share under the specified account. If the share with
98
- * the same name already exists, the operation fails.
99
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/create-share
100
- *
101
- * @param options - Options to Share Create operation.
102
- * @returns Response data for the Share Create operation.
103
- */
104
- async create(options = {}) {
105
- return tracingClient.withSpan("ShareClient-create", options, async (updatedOptions) => {
106
- return assertResponse(await this.context.create(Object.assign(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig), { enabledProtocols: toShareProtocolsString(updatedOptions.protocols) })));
107
- });
108
- }
109
- /**
110
- * Creates a new share under the specified account. If the share with
111
- * the same name already exists, it is not changed.
112
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/create-share
113
- *
114
- * @param options -
115
- */
116
- async createIfNotExists(options = {}) {
117
- return tracingClient.withSpan("ShareClient-createIfNotExists", options, async (updatedOptions) => {
118
- var _a, _b;
119
- try {
120
- const res = await this.create(updatedOptions);
121
- return Object.assign({ succeeded: true }, res);
122
- }
123
- catch (e) {
124
- if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ShareAlreadyExists") {
125
- return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response });
126
- }
127
- throw e;
128
- }
129
- });
130
- }
131
- /**
132
- * Creates a {@link ShareDirectoryClient} object.
133
- *
134
- * @param directoryName - A directory name
135
- * @returns The ShareDirectoryClient object for the given directory name.
136
- */
137
- // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.
138
- /* eslint-disable-next-line @azure/azure-sdk/ts-naming-subclients */
139
- getDirectoryClient(directoryName) {
140
- return new ShareDirectoryClient(appendToURLPath(this.url, EscapePath(directoryName)), this.pipeline, this.shareClientConfig);
141
- }
142
- /**
143
- * Gets the directory client for the root directory of this share.
144
- * Note that the root directory always exists and cannot be deleted.
145
- *
146
- * @readonly A new ShareDirectoryClient object for the root directory.
147
- */
148
- // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.
149
- /* eslint-disable-next-line @azure/azure-sdk/ts-naming-subclients */
150
- get rootDirectoryClient() {
151
- return this.getDirectoryClient("");
152
- }
153
- /**
154
- * Creates a new subdirectory under this share.
155
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/create-directory
156
- *
157
- * @param directoryName -
158
- * @param options - Options to Directory Create operation.
159
- * @returns Directory creation response data and the corresponding directory client.
160
- */
161
- async createDirectory(directoryName, options = {}) {
162
- return tracingClient.withSpan("ShareClient-createDirectory", options, async (updatedOptions) => {
163
- const directoryClient = this.getDirectoryClient(directoryName);
164
- const directoryCreateResponse = await directoryClient.create(updatedOptions);
165
- return {
166
- directoryClient,
167
- directoryCreateResponse,
168
- };
169
- });
170
- }
171
- /**
172
- * Removes the specified empty sub directory under this share.
173
- * Note that the directory must be empty before it can be deleted.
174
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/delete-directory
175
- *
176
- * @param directoryName -
177
- * @param options - Options to Directory Delete operation.
178
- * @returns Directory deletion response data.
179
- */
180
- async deleteDirectory(directoryName, options = {}) {
181
- return tracingClient.withSpan("ShareClient-deleteDirectory", options, async (updatedOptions) => {
182
- const directoryClient = this.getDirectoryClient(directoryName);
183
- return directoryClient.delete(updatedOptions);
184
- });
185
- }
186
- /**
187
- * Creates a new file or replaces a file under the root directory of this share.
188
- * Note it only initializes the file with no content.
189
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/create-file
190
- *
191
- * @param fileName -
192
- * @param size - Specifies the maximum size in bytes for the file, up to 4 TB.
193
- * @param options - Options to File Create operation.
194
- * @returns File creation response data and the corresponding file client.
195
- */
196
- async createFile(fileName, size, options = {}) {
197
- return tracingClient.withSpan("ShareClient-createFile", options, async (updatedOptions) => {
198
- const directoryClient = this.rootDirectoryClient;
199
- const fileClient = directoryClient.getFileClient(fileName);
200
- const fileCreateResponse = await fileClient.create(size, updatedOptions);
201
- return {
202
- fileClient,
203
- fileCreateResponse,
204
- };
205
- });
206
- }
207
- /**
208
- * Removes a file under the root directory of this share from the storage account.
209
- * When a file is successfully deleted, it is immediately removed from the storage
210
- * account's index and is no longer accessible to clients. The file's data is later
211
- * removed from the service during garbage collection.
212
- *
213
- * Delete File will fail with status code 409 (Conflict) and error code `SharingViolation`
214
- * if the file is open on an SMB client.
215
- *
216
- * Delete File is not supported on a share snapshot, which is a read-only copy of
217
- * a share. An attempt to perform this operation on a share snapshot will fail with 400
218
- * (`InvalidQueryParameterValue`)
219
- *
220
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/delete-file2
221
- *
222
- * @param directoryName -
223
- * @param fileName -
224
- * @param options - Options to File Delete operation.
225
- * @returns Promise<FileDeleteResponse> File Delete response data.
226
- */
227
- async deleteFile(fileName, options = {}) {
228
- return tracingClient.withSpan("ShareClient-deleteFile", options, async (updatedOptions) => {
229
- const directoryClient = this.rootDirectoryClient;
230
- const fileClient = directoryClient.getFileClient(fileName);
231
- return fileClient.delete(updatedOptions);
232
- });
233
- }
234
- /**
235
- * Returns true if the Azrue share resource represented by this client exists; false otherwise.
236
- *
237
- * NOTE: use this function with care since an existing share might be deleted by other clients or
238
- * applications. Vice versa new shares might be added by other clients or applications after this
239
- * function completes.
240
- *
241
- * @param options - options to Exists operation.
242
- */
243
- async exists(options = {}) {
244
- return tracingClient.withSpan("ShareClient-exists", options, async (updatedOptions) => {
245
- try {
246
- await this.getProperties(updatedOptions);
247
- return true;
248
- }
249
- catch (e) {
250
- if (e.statusCode === 404) {
251
- return false;
252
- }
253
- throw e;
254
- }
255
- });
256
- }
257
- /**
258
- * Returns all user-defined metadata and system properties for the specified
259
- * share.
260
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/get-share-properties
261
- *
262
- * WARNING: The `metadata` object returned in the response will have its keys in lowercase, even if
263
- * they originally contained uppercase characters. This differs from the metadata keys returned by
264
- * the `listShares` method of {@link ShareServiceClient} using the `includeMetadata` option, which
265
- * will retain their original casing.
266
- *
267
- * @returns Response data for the Share Get Properties operation.
268
- */
269
- async getProperties(options = {}) {
270
- return tracingClient.withSpan("ShareClient-getProperties", options, async (updatedOptions) => {
271
- const res = assertResponse(await this.context.getProperties(updatedOptions));
272
- return Object.assign(Object.assign(Object.assign({}, res), this.shareClientConfig), { protocols: toShareProtocols(res.enabledProtocols) });
273
- });
274
- }
275
- /**
276
- * Marks the specified share for deletion. The share and any directories or files
277
- * contained within it are later deleted during garbage collection.
278
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/delete-share
279
- *
280
- * @param options - Options to Share Delete operation.
281
- * @returns Response data for the Share Delete operation.
282
- */
283
- async delete(options = {}) {
284
- return tracingClient.withSpan("ShareClient-delete", options, async (updatedOptions) => {
285
- return assertResponse(await this.context.delete(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
286
- });
287
- }
288
- /**
289
- * Marks the specified share for deletion if it exists. The share and any directories or files
290
- * contained within it are later deleted during garbage collection.
291
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/delete-share
292
- *
293
- * @param options -
294
- */
295
- async deleteIfExists(options = {}) {
296
- return tracingClient.withSpan("ShareClient-deleteIfExists", options, async (updatedOptions) => {
297
- var _a, _b;
298
- try {
299
- const res = await this.delete(updatedOptions);
300
- return Object.assign({ succeeded: true }, res);
301
- }
302
- catch (e) {
303
- if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ShareNotFound") {
304
- return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response });
305
- }
306
- throw e;
307
- }
308
- });
309
- }
310
- /**
311
- * Sets one or more user-defined name-value pairs for the specified share.
312
- *
313
- * If no option provided, or no metadata defined in the option parameter, the share
314
- * metadata will be removed.
315
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/set-share-metadata
316
- *
317
- * @param metadata - If no metadata provided, all existing directory metadata will be removed.
318
- * @param option - Options to Share Set Metadata operation.
319
- * @returns Response data for the Share Set Metadata operation.
320
- */
321
- async setMetadata(metadata, options = {}) {
322
- return tracingClient.withSpan("ShareClient-setMetadata", options, async (updatedOptions) => {
323
- return assertResponse(await this.context.setMetadata(Object.assign(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig), { metadata })));
324
- });
325
- }
326
- /**
327
- * Gets the permissions for the specified share. The permissions indicate
328
- * whether share data may be accessed publicly.
329
- *
330
- * WARNING: JavaScript Date will potential lost precision when parsing start and expiry string.
331
- * For example, new Date("2018-12-31T03:44:23.8827891Z").toISOString() will get "2018-12-31T03:44:23.882Z".
332
- *
333
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/get-share-acl
334
- *
335
- * @param option - Options to Share Get Access Policy operation.
336
- * @returns Response data for the Share Get Access Policy operation.
337
- */
338
- async getAccessPolicy(options = {}) {
339
- return tracingClient.withSpan("ShareClient-getAccessPolicy", options, async (updatedOptions) => {
340
- const response = assertResponse(await this.context.getAccessPolicy(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
341
- const res = {
342
- _response: response._response,
343
- date: response.date,
344
- etag: response.etag,
345
- lastModified: response.lastModified,
346
- requestId: response.requestId,
347
- signedIdentifiers: [],
348
- version: response.version,
349
- };
350
- for (const identifier of response) {
351
- let accessPolicy = undefined;
352
- if (identifier.accessPolicy) {
353
- accessPolicy = {
354
- permissions: identifier.accessPolicy.permissions,
355
- };
356
- if (identifier.accessPolicy.expiresOn) {
357
- accessPolicy.expiresOn = new Date(identifier.accessPolicy.expiresOn);
358
- }
359
- if (identifier.accessPolicy.startsOn) {
360
- accessPolicy.startsOn = new Date(identifier.accessPolicy.startsOn);
361
- }
362
- }
363
- res.signedIdentifiers.push({
364
- accessPolicy,
365
- id: identifier.id,
366
- });
367
- }
368
- return res;
369
- });
370
- }
371
- /**
372
- * Sets the permissions for the specified share. The permissions indicate
373
- * whether directories or files in a share may be accessed publicly.
374
- *
375
- * When you set permissions for a share, the existing permissions are replaced.
376
- * If no shareAcl provided, the existing share ACL will be
377
- * removed.
378
- *
379
- * When you establish a stored access policy on a share, it may take up to 30 seconds to take effect.
380
- * During this interval, a shared access signature that is associated with the stored access policy will
381
- * fail with status code 403 (Forbidden), until the access policy becomes active.
382
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/set-share-acl
383
- *
384
- * @param shareAcl - Array of signed identifiers, each having a unique Id and details of access policy.
385
- * @param option - Options to Share Set Access Policy operation.
386
- * @returns Response data for the Share Set Access Policy operation.
387
- */
388
- async setAccessPolicy(shareAcl, options = {}) {
389
- return tracingClient.withSpan("ShareClient-setAccessPolicy", options, async (updatedOptions) => {
390
- var _a, _b, _c;
391
- const acl = [];
392
- for (const identifier of shareAcl || []) {
393
- acl.push({
394
- accessPolicy: {
395
- expiresOn: ((_a = identifier.accessPolicy) === null || _a === void 0 ? void 0 : _a.expiresOn)
396
- ? truncatedISO8061Date(identifier.accessPolicy.expiresOn)
397
- : undefined,
398
- permissions: (_b = identifier.accessPolicy) === null || _b === void 0 ? void 0 : _b.permissions,
399
- startsOn: ((_c = identifier.accessPolicy) === null || _c === void 0 ? void 0 : _c.startsOn)
400
- ? truncatedISO8061Date(identifier.accessPolicy.startsOn)
401
- : undefined,
402
- },
403
- id: identifier.id,
404
- });
405
- }
406
- return assertResponse(await this.context.setAccessPolicy(Object.assign(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig), { shareAcl: acl })));
407
- });
408
- }
409
- /**
410
- * Creates a read-only snapshot of a share.
411
- *
412
- * @param options - Options to Share Create Snapshot operation.
413
- * @returns Response data for the Share Create Snapshot operation.
414
- */
415
- async createSnapshot(options = {}) {
416
- return tracingClient.withSpan("ShareClient-createSnapshot", options, async (updatedOptions) => {
417
- return assertResponse(await this.context.createSnapshot(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
418
- });
419
- }
420
- /**
421
- * Sets quota for the specified share.
422
- *
423
- * @deprecated Use {@link ShareClient.setProperties} instead.
424
- *
425
- * @param quotaInGB - Specifies the maximum size of the share in gigabytes
426
- * @param option - Options to Share Set Quota operation.
427
- * @returns Response data for the Share Get Quota operation.
428
- */
429
- async setQuota(quotaInGB, options = {}) {
430
- return tracingClient.withSpan("ShareClient-setQuota", options, async (updatedOptions) => {
431
- return assertResponse(await this.context.setProperties(Object.assign(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig), { quota: quotaInGB })));
432
- });
433
- }
434
- /**
435
- * Sets properties of the share.
436
- *
437
- * @param option - Options to Share Set Properties operation.
438
- * @returns Response data for the Share Set Properties operation.
439
- */
440
- async setProperties(options = {}) {
441
- return tracingClient.withSpan("ShareClient-setProperties", options, async (updatedOptions) => {
442
- return assertResponse(await this.context.setProperties(Object.assign(Object.assign(Object.assign({}, options), this.shareClientConfig), { quota: options.quotaInGB, tracingOptions: updatedOptions.tracingOptions })));
443
- });
444
- }
445
- /**
446
- * Retrieves statistics related to the share.
447
- *
448
- * @param option - Options to Share Get Statistics operation.
449
- * @returns Response data for the Share Get Statistics operation.
450
- */
451
- async getStatistics(options = {}) {
452
- return tracingClient.withSpan("ShareClient-getStatistics", options, async (updatedOptions) => {
453
- const response = assertResponse(await this.context.getStatistics(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
454
- const GBBytes = 1024 * 1024 * 1024;
455
- return Object.assign(Object.assign({}, response), { shareUsage: Math.ceil(response.shareUsageBytes / GBBytes) });
456
- });
457
- }
458
- /**
459
- * Creates a file permission (a security descriptor) at the share level.
460
- * The created security descriptor can be used for the files/directories in the share.
461
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/create-permission
462
- *
463
- * @param options - Options to Share Create Permission operation.
464
- * @param filePermission - File permission described in the SDDL
465
- */
466
- async createPermission(filePermission, options = {}) {
467
- return tracingClient.withSpan("ShareClient-createPermission", options, async (updatedOptions) => {
468
- return assertResponse(await this.context.createPermission(asSharePermission(filePermission), Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
469
- });
470
- }
471
- /**
472
- * Gets the Security Descriptor Definition Language (SDDL) for a given file permission key
473
- * which indicates a security descriptor.
474
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/get-permission
475
- *
476
- * @param options - Options to Share Create Permission operation.
477
- * @param filePermissionKey - File permission key which indicates the security descriptor of the permission.
478
- */
479
- async getPermission(filePermissionKey, options = {}) {
480
- return tracingClient.withSpan("ShareClient-getPermission", options, async (updatedOptions) => {
481
- return assertResponse(await this.context.getPermission(filePermissionKey, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
482
- });
483
- }
484
- /**
485
- * Get a {@link ShareLeaseClient} that manages leases on the file.
486
- *
487
- * @param proposeLeaseId - Initial proposed lease Id.
488
- * @returns A new ShareLeaseClient object for managing leases on the file.
489
- */
490
- getShareLeaseClient(proposeLeaseId) {
491
- return new ShareLeaseClient(this, proposeLeaseId);
492
- }
493
- /**
494
- * Only available for ShareClient constructed with a shared key credential.
495
- *
496
- * Generates a Service Shared Access Signature (SAS) URI based on the client properties
497
- * and parameters passed in. The SAS is signed by the shared key credential of the client.
498
- *
499
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas
500
- *
501
- * @param options - Optional parameters.
502
- * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
503
- */
504
- generateSasUrl(options) {
505
- if (!(this.credential instanceof StorageSharedKeyCredential)) {
506
- throw RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
507
- }
508
- const sas = generateFileSASQueryParameters(Object.assign({ shareName: this.name }, options), this.credential).toString();
509
- return appendToURLQuery(this.url, sas);
510
- }
511
- /**
512
- * Only available for ShareClient constructed with a shared key credential.
513
- *
514
- * Generates string to sign for a Service Shared Access Signature (SAS) URI based on the client properties
515
- * and parameters passed in. The SAS is signed by the shared key credential of the client.
516
- *
517
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas
518
- *
519
- * @param options - Optional parameters.
520
- * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
521
- */
522
- /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/
523
- generateSasStringToSign(options) {
524
- if (!(this.credential instanceof StorageSharedKeyCredential)) {
525
- throw RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
526
- }
527
- return generateFileSASQueryParametersInternal(Object.assign({ shareName: this.name }, options), this.credential).stringToSign;
528
- }
529
- }
530
- /**
531
- * A ShareDirectoryClient represents a URL to the Azure Storage directory allowing you to manipulate its files and directories.
532
- */
533
- export class ShareDirectoryClient extends StorageClient {
534
- /**
535
- * The share name corresponding to this directory client
536
- */
537
- get shareName() {
538
- return this._shareName;
539
- }
540
- /**
541
- * The full path of the directory
542
- */
543
- get path() {
544
- return this._path;
545
- }
546
- /**
547
- * The name of the directory
548
- */
549
- get name() {
550
- return this._name;
551
- }
552
- constructor(url, credentialOrPipeline,
553
- // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.
554
- /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */
555
- options = {}) {
556
- let pipeline;
557
- if (isPipelineLike(credentialOrPipeline)) {
558
- pipeline = credentialOrPipeline;
559
- }
560
- else if (credentialOrPipeline instanceof Credential ||
561
- isTokenCredential(credentialOrPipeline)) {
562
- pipeline = newPipeline(credentialOrPipeline, options);
563
- }
564
- else {
565
- // The second parameter is undefined. Use anonymous credential.
566
- pipeline = newPipeline(new AnonymousCredential(), options);
567
- }
568
- super(url, pipeline);
569
- ({
570
- baseName: this._name,
571
- shareName: this._shareName,
572
- path: this._path,
573
- } = getShareNameAndPathFromUrl(this.url));
574
- this.shareClientConfig = options;
575
- this.context = this.storageClientContext.directory;
576
- }
577
- /**
578
- * Creates a new directory under the specified share or parent directory.
579
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/create-directory
580
- *
581
- * @param options - Options to Directory Create operation.
582
- * @returns Response data for the Directory operation.
583
- */
584
- async create(options = {}) {
585
- if (!options.fileAttributes) {
586
- options = validateAndSetDefaultsForFileAndDirectoryCreateCommonOptions(options);
587
- }
588
- return tracingClient.withSpan("ShareDirectoryClient-create", options, async (updatedOptions) => {
589
- var _a, _b, _c;
590
- const rawResponse = await this.context.create(Object.assign(Object.assign(Object.assign({}, updatedOptions), { fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime), fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime), fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime), fileAttributes: updatedOptions.fileAttributes
591
- ? fileAttributesToString(updatedOptions.fileAttributes)
592
- : undefined, owner: (_a = updatedOptions.posixProperties) === null || _a === void 0 ? void 0 : _a.owner, group: (_b = updatedOptions.posixProperties) === null || _b === void 0 ? void 0 : _b.group, fileMode: toOctalFileMode((_c = updatedOptions.posixProperties) === null || _c === void 0 ? void 0 : _c.fileMode) }), this.shareClientConfig));
593
- const wrappedRes = Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
594
- fileMode: parseOctalFileMode(rawResponse.fileMode),
595
- fileType: rawResponse.nfsFileType,
596
- owner: rawResponse.owner,
597
- group: rawResponse.group,
598
- } });
599
- return assertResponse(wrappedRes);
600
- });
601
- }
602
- /**
603
- * Creates a new directory under the specified share or parent directory if it does not already exists.
604
- * If the directory already exists, it is not modified.
605
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/create-directory
606
- *
607
- * @param options -
608
- */
609
- async createIfNotExists(options = {}) {
610
- return tracingClient.withSpan("ShareDirectoryClient-createIfNotExists", options, async (updatedOptions) => {
611
- var _a, _b;
612
- try {
613
- const res = await this.create(updatedOptions);
614
- return Object.assign({ succeeded: true }, res);
615
- }
616
- catch (e) {
617
- if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ResourceAlreadyExists") {
618
- return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response });
619
- }
620
- throw e;
621
- }
622
- });
623
- }
624
- /**
625
- * Sets properties on the directory.
626
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/set-directory-properties
627
- *
628
- * @param DirectoryProperties - Directory properties. If no values are provided,
629
- * existing values will be preserved.
630
- */
631
- async setProperties(properties = {}) {
632
- properties = validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions(properties);
633
- return tracingClient.withSpan("ShareDirectoryClient-setProperties", properties, async (updatedOptions) => {
634
- var _a, _b, _c;
635
- const rawResponse = await this.context.setProperties(Object.assign(Object.assign(Object.assign({}, updatedOptions), { fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime), fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime), fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime), fileAttributes: updatedOptions.fileAttributes
636
- ? fileAttributesToString(updatedOptions.fileAttributes)
637
- : undefined, owner: (_a = updatedOptions.posixProperties) === null || _a === void 0 ? void 0 : _a.owner, group: (_b = updatedOptions.posixProperties) === null || _b === void 0 ? void 0 : _b.group, fileMode: toOctalFileMode((_c = updatedOptions.posixProperties) === null || _c === void 0 ? void 0 : _c.fileMode) }), this.shareClientConfig));
638
- return assertResponse(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
639
- fileMode: parseOctalFileMode(rawResponse.fileMode),
640
- owner: rawResponse.owner,
641
- group: rawResponse.group,
642
- } }));
643
- });
644
- }
645
- /**
646
- * Creates a ShareDirectoryClient object for a sub directory.
647
- *
648
- * @param subDirectoryName - A subdirectory name
649
- * @returns The ShareDirectoryClient object for the given subdirectory name.
650
- *
651
- * Example usage:
652
- *
653
- * ```js
654
- * const directoryClient = shareClient.getDirectoryClient("<directory name>");
655
- * await directoryClient.create();
656
- * console.log("Created directory successfully");
657
- * ```
658
- */
659
- getDirectoryClient(subDirectoryName) {
660
- return new ShareDirectoryClient(appendToURLPath(this.url, EscapePath(subDirectoryName)), this.pipeline, this.shareClientConfig);
661
- }
662
- /**
663
- * Creates a new subdirectory under this directory.
664
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/create-directory
665
- *
666
- * @param directoryName -
667
- * @param options - Options to Directory Create operation.
668
- * @returns Directory create response data and the corresponding DirectoryClient instance.
669
- */
670
- async createSubdirectory(directoryName, options = {}) {
671
- return tracingClient.withSpan("ShareDirectoryClient-createSubdirectory", options, async (updatedOptions) => {
672
- const directoryClient = this.getDirectoryClient(directoryName);
673
- const directoryCreateResponse = await directoryClient.create(updatedOptions);
674
- return {
675
- directoryClient,
676
- directoryCreateResponse,
677
- };
678
- });
679
- }
680
- /**
681
- * Removes the specified empty sub directory under this directory.
682
- * Note that the directory must be empty before it can be deleted.
683
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/delete-directory
684
- *
685
- * @param directoryName -
686
- * @param options - Options to Directory Delete operation.
687
- * @returns Directory deletion response data.
688
- */
689
- async deleteSubdirectory(directoryName, options = {}) {
690
- return tracingClient.withSpan("ShareDirectoryClient-deleteSubdirectory", options, async (updatedOptions) => {
691
- const directoryClient = this.getDirectoryClient(directoryName);
692
- return directoryClient.delete(updatedOptions);
693
- });
694
- }
695
- /**
696
- * Creates a new file or replaces a file under this directory. Note it only initializes the file with no content.
697
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/create-file
698
- *
699
- * @param fileName -
700
- * @param size - Specifies the maximum size in bytes for the file, up to 4 TB.
701
- * @param options - Options to File Create operation.
702
- * @returns File creation response data and the corresponding file client.
703
- */
704
- async createFile(fileName, size, options = {}) {
705
- return tracingClient.withSpan("ShareDirectoryClient-createFile", options, async (updatedOptions) => {
706
- const fileClient = this.getFileClient(fileName);
707
- const fileCreateResponse = await fileClient.create(size, updatedOptions);
708
- return {
709
- fileClient,
710
- fileCreateResponse,
711
- };
712
- });
713
- }
714
- /**
715
- * Removes the specified file under this directory from the storage account.
716
- * When a file is successfully deleted, it is immediately removed from the storage
717
- * account's index and is no longer accessible to clients. The file's data is later
718
- * removed from the service during garbage collection.
719
- *
720
- * Delete File will fail with status code 409 (Conflict) and error code SharingViolation
721
- * if the file is open on an SMB client.
722
- *
723
- * Delete File is not supported on a share snapshot, which is a read-only copy of
724
- * a share. An attempt to perform this operation on a share snapshot will fail with 400 (InvalidQueryParameterValue)
725
- *
726
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/delete-file2
727
- *
728
- * @param fileName - Name of the file to delete
729
- * @param options - Options to File Delete operation.
730
- * @returns File deletion response data.
731
- */
732
- async deleteFile(fileName, options = {}) {
733
- return tracingClient.withSpan("ShareDirectoryClient-deleteFile", options, async (updatedOptions) => {
734
- const fileClient = this.getFileClient(fileName);
735
- return fileClient.delete(updatedOptions);
736
- });
737
- }
738
- /**
739
- * Creates a {@link ShareFileClient} object.
740
- *
741
- * @param fileName - A file name.
742
- * @returns A new ShareFileClient object for the given file name.
743
- *
744
- * Example usage:
745
- *
746
- * ```js
747
- * const content = "Hello world!"
748
- *
749
- * const fileClient = directoryClient.getFileClient("<file name>");
750
- *
751
- * await fileClient.create(content.length);
752
- * console.log("Created file successfully!");
753
- *
754
- * await fileClient.uploadRange(content, 0, content.length);
755
- * console.log("Updated file successfully!")
756
- * ```
757
- */
758
- // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.
759
- /* eslint-disable-next-line @azure/azure-sdk/ts-naming-subclients */
760
- getFileClient(fileName) {
761
- return new ShareFileClient(appendToURLPath(this.url, EscapePath(fileName)), this.pipeline, this.shareClientConfig);
762
- }
763
- /**
764
- * Returns true if the specified directory exists; false otherwise.
765
- *
766
- * NOTE: use this function with care since an existing directory might be deleted by other clients or
767
- * applications. Vice versa new directories might be added by other clients or applications after this
768
- * function completes.
769
- *
770
- * @param options - options to Exists operation.
771
- */
772
- async exists(options = {}) {
773
- return tracingClient.withSpan("ShareDirectoryClient-exists", options, async (updatedOptions) => {
774
- try {
775
- await this.getProperties(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig));
776
- return true;
777
- }
778
- catch (e) {
779
- if (e.statusCode === 404) {
780
- return false;
781
- }
782
- throw e;
783
- }
784
- });
785
- }
786
- /**
787
- * Returns all system properties for the specified directory, and can also be used to check the
788
- * existence of a directory. The data returned does not include the files in the directory or any
789
- * subdirectories.
790
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/get-directory-properties
791
- *
792
- * @param options - Options to Directory Get Properties operation.
793
- * @returns Response data for the Directory Get Properties operation.
794
- */
795
- async getProperties(options = {}) {
796
- return tracingClient.withSpan("ShareDirectoryClient-getProperties", options, async (updatedOptions) => {
797
- const rawResponse = await this.context.getProperties(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig));
798
- return assertResponse(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
799
- fileMode: parseOctalFileMode(rawResponse.fileMode),
800
- owner: rawResponse.owner,
801
- group: rawResponse.group,
802
- fileType: rawResponse.nfsFileType,
803
- } }));
804
- });
805
- }
806
- /**
807
- * Removes the specified empty directory. Note that the directory must be empty before it can be
808
- * deleted.
809
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/delete-directory
810
- *
811
- * @param options - Options to Directory Delete operation.
812
- * @returns Response data for the Directory Delete operation.
813
- */
814
- async delete(options = {}) {
815
- return tracingClient.withSpan("ShareDirectoryClient-delete", options, async (updatedOptions) => {
816
- return assertResponse(await this.context.delete(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
817
- });
818
- }
819
- /**
820
- * Removes the specified empty directory if it exists. Note that the directory must be empty before it can be
821
- * deleted.
822
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/delete-directory
823
- *
824
- * @param options -
825
- */
826
- async deleteIfExists(options = {}) {
827
- return tracingClient.withSpan("ShareDirectoryClient-deleteIfExists", options, async (updatedOptions) => {
828
- var _a, _b, _c;
829
- try {
830
- const res = await this.delete(updatedOptions);
831
- return Object.assign({ succeeded: true }, res);
832
- }
833
- catch (e) {
834
- if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ResourceNotFound" ||
835
- ((_b = e.details) === null || _b === void 0 ? void 0 : _b.errorCode) === "ParentNotFound") {
836
- return Object.assign(Object.assign({ succeeded: false }, (_c = e.response) === null || _c === void 0 ? void 0 : _c.parsedHeaders), { _response: e.response });
837
- }
838
- throw e;
839
- }
840
- });
841
- }
842
- /**
843
- * Updates user defined metadata for the specified directory.
844
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/set-directory-metadata
845
- *
846
- * @param metadata - If no metadata provided, all existing directory metadata will be removed
847
- * @param options - Options to Directory Set Metadata operation.
848
- * @returns Response data for the Directory Set Metadata operation.
849
- */
850
- async setMetadata(metadata, options = {}) {
851
- return tracingClient.withSpan("ShareDirectoryClient-setMetadata", options, async (updatedOptions) => {
852
- return assertResponse(await this.context.setMetadata(Object.assign(Object.assign(Object.assign({}, updatedOptions), { metadata }), this.shareClientConfig)));
853
- });
854
- }
855
- /**
856
- * Returns an AsyncIterableIterator for {@link DirectoryListFilesAndDirectoriesSegmentResponse} objects
857
- *
858
- * @param marker - A string value that identifies the portion of
859
- * the list of files and directories to be returned with the next listing operation. The
860
- * operation returns the ContinuationToken value within the response body if the
861
- * listing operation did not return all files and directories remaining to be listed
862
- * with the current page. The ContinuationToken value can be used as the value for
863
- * the marker parameter in a subsequent call to request the next page of list
864
- * items. The marker value is opaque to the client.
865
- * @param options - Options to list files and directories operation.
866
- */
867
- iterateFilesAndDirectoriesSegments(marker_1) {
868
- return __asyncGenerator(this, arguments, function* iterateFilesAndDirectoriesSegments_1(marker, options = {}) {
869
- if (options.prefix === "") {
870
- options.prefix = undefined;
871
- }
872
- let listFilesAndDirectoriesResponse;
873
- do {
874
- listFilesAndDirectoriesResponse = yield __await(this.listFilesAndDirectoriesSegment(marker, options));
875
- marker = listFilesAndDirectoriesResponse.continuationToken;
876
- yield yield __await(yield __await(listFilesAndDirectoriesResponse));
877
- } while (marker);
878
- });
879
- }
880
- /**
881
- * Returns an AsyncIterableIterator for file and directory items
882
- *
883
- * @param options - Options to list files and directories operation.
884
- */
885
- listFilesAndDirectoriesItems() {
886
- return __asyncGenerator(this, arguments, function* listFilesAndDirectoriesItems_1(options = {}) {
887
- var _a, e_1, _b, _c;
888
- if (options.prefix === "") {
889
- options.prefix = undefined;
890
- }
891
- let marker;
892
- try {
893
- for (var _d = true, _e = __asyncValues(this.iterateFilesAndDirectoriesSegments(marker, options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
894
- _c = _f.value;
895
- _d = false;
896
- const listFilesAndDirectoriesResponse = _c;
897
- for (const file of listFilesAndDirectoriesResponse.segment.fileItems) {
898
- yield yield __await(Object.assign({ kind: "file" }, file));
899
- }
900
- for (const directory of listFilesAndDirectoriesResponse.segment.directoryItems) {
901
- yield yield __await(Object.assign({ kind: "directory" }, directory));
902
- }
903
- }
904
- }
905
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
906
- finally {
907
- try {
908
- if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
909
- }
910
- finally { if (e_1) throw e_1.error; }
911
- }
912
- });
913
- }
914
- /**
915
- * Returns an async iterable iterator to list all the files and directories
916
- * under the specified account.
917
- *
918
- * .byPage() returns an async iterable iterator to list the files and directories in pages.
919
- *
920
- * Example using `for await` syntax:
921
- *
922
- * ```js
923
- * let i = 1;
924
- * for await (const entity of directoryClient.listFilesAndDirectories()) {
925
- * if (entity.kind === "directory") {
926
- * console.log(`${i++} - directory\t: ${entity.name}`);
927
- * } else {
928
- * console.log(`${i++} - file\t: ${entity.name}`);
929
- * }
930
- * }
931
- * ```
932
- *
933
- * Example using `iter.next()`:
934
- *
935
- * ```js
936
- * let i = 1;
937
- * let iter = directoryClient.listFilesAndDirectories();
938
- * let entity = await iter.next();
939
- * while (!entity.done) {
940
- * if (entity.value.kind === "directory") {
941
- * console.log(`${i++} - directory\t: ${entity.value.name}`);
942
- * } else {
943
- * console.log(`${i++} - file\t: ${entity.value.name}`);
944
- * }
945
- * entity = await iter.next();
946
- * }
947
- * ```
948
- *
949
- * Example using `byPage()`:
950
- *
951
- * ```js
952
- * // passing optional maxPageSize in the page settings
953
- * let i = 1;
954
- * for await (const response of directoryClient
955
- * .listFilesAndDirectories()
956
- * .byPage({ maxPageSize: 20 })) {
957
- * for (const fileItem of response.segment.fileItems) {
958
- * console.log(`${i++} - file\t: ${fileItem.name}`);
959
- * }
960
- * for (const dirItem of response.segment.directoryItems) {
961
- * console.log(`${i++} - directory\t: ${dirItem.name}`);
962
- * }
963
- * }
964
- * ```
965
- *
966
- * Example using paging with a marker:
967
- *
968
- * ```js
969
- * let i = 1;
970
- * let iterator = directoryClient.listFilesAndDirectories().byPage({ maxPageSize: 3 });
971
- * let response = (await iterator.next()).value;
972
- *
973
- * // Prints 3 file and directory names
974
- * for (const fileItem of response.segment.fileItems) {
975
- * console.log(`${i++} - file\t: ${fileItem.name}`);
976
- * }
977
- *
978
- * for (const dirItem of response.segment.directoryItems) {
979
- * console.log(`${i++} - directory\t: ${dirItem.name}`);
980
- * }
981
- *
982
- * // Gets next marker
983
- * let dirMarker = response.continuationToken;
984
- *
985
- * // Passing next marker as continuationToken
986
- * iterator = directoryClient
987
- * .listFilesAndDirectories()
988
- * .byPage({ continuationToken: dirMarker, maxPageSize: 4 });
989
- * response = (await iterator.next()).value;
990
- *
991
- * // Prints 10 file and directory names
992
- * for (const fileItem of response.segment.fileItems) {
993
- * console.log(`${i++} - file\t: ${fileItem.name}`);
994
- * }
995
- *
996
- * for (const dirItem of response.segment.directoryItems) {
997
- * console.log(`${i++} - directory\t: ${dirItem.name}`);
998
- * }
999
- * ```
1000
- *
1001
- * @param options - Options to list files and directories operation.
1002
- * @returns An asyncIterableIterator that supports paging.
1003
- */
1004
- listFilesAndDirectories(options = {}) {
1005
- const include = [];
1006
- if (options.includeTimestamps) {
1007
- include.push("Timestamps");
1008
- }
1009
- if (options.includeEtag) {
1010
- include.push("Etag");
1011
- }
1012
- if (options.includeAttributes) {
1013
- include.push("Attributes");
1014
- }
1015
- if (options.includePermissionKey) {
1016
- include.push("PermissionKey");
1017
- }
1018
- if (options.prefix === "") {
1019
- options.prefix = undefined;
1020
- }
1021
- const updatedOptions = Object.assign(Object.assign({}, options), (include.length > 0 ? { include: include } : {}));
1022
- // AsyncIterableIterator to iterate over files and directories
1023
- const iter = this.listFilesAndDirectoriesItems(updatedOptions);
1024
- return {
1025
- /**
1026
- * The next method, part of the iteration protocol
1027
- */
1028
- async next() {
1029
- return iter.next();
1030
- },
1031
- /**
1032
- * The connection to the async iterator, part of the iteration protocol
1033
- */
1034
- [Symbol.asyncIterator]() {
1035
- return this;
1036
- },
1037
- /**
1038
- * Return an AsyncIterableIterator that works a page at a time
1039
- */
1040
- byPage: (settings = {}) => {
1041
- return this.iterateFilesAndDirectoriesSegments(removeEmptyString(settings.continuationToken), Object.assign({ maxResults: settings.maxPageSize }, updatedOptions));
1042
- },
1043
- };
1044
- }
1045
- /**
1046
- * Returns a list of files or directories under the specified share or directory. It lists the
1047
- * contents only for a single level of the directory hierarchy.
1048
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/list-directories-and-files
1049
- *
1050
- * @param marker - A string value that identifies the portion of the list to be returned with the next list operation.
1051
- * @param options - Options to Directory List Files and Directories Segment operation.
1052
- * @returns Response data for the Directory List Files and Directories operation.
1053
- */
1054
- async listFilesAndDirectoriesSegment(marker, options = {}) {
1055
- if (options.prefix === "") {
1056
- options.prefix = undefined;
1057
- }
1058
- return tracingClient.withSpan("ShareDirectoryClient-listFilesAndDirectoriesSegment", options, async (updatedOptions) => {
1059
- const rawResponse = assertResponse(await this.context.listFilesAndDirectoriesSegment(Object.assign(Object.assign(Object.assign({}, updatedOptions), { marker }), this.shareClientConfig)));
1060
- const wrappedResponse = Object.assign(Object.assign({}, ConvertInternalResponseOfListFiles(rawResponse)), { _response: Object.assign(Object.assign({}, rawResponse._response), { parsedBody: ConvertInternalResponseOfListFiles(rawResponse._response.parsedBody) }) });
1061
- return wrappedResponse;
1062
- });
1063
- }
1064
- /**
1065
- * Returns an AsyncIterableIterator for {@link DirectoryListHandlesResponse}
1066
- *
1067
- * @param marker - A string value that identifies the portion of the list to be
1068
- * returned with the next list handles operation. The operation returns a
1069
- * marker value within the response body if the list returned was not complete.
1070
- * The marker value may then be used in a subsequent call to request the next
1071
- * set of list items.
1072
- * @param options - Options to list handles operation.
1073
- */
1074
- iterateHandleSegments(marker_1) {
1075
- return __asyncGenerator(this, arguments, function* iterateHandleSegments_1(marker, options = {}) {
1076
- let listHandlesResponse;
1077
- if (!!marker || marker === undefined) {
1078
- do {
1079
- listHandlesResponse = yield __await(this.listHandlesSegment(marker, options));
1080
- marker = listHandlesResponse.continuationToken;
1081
- yield yield __await(yield __await(listHandlesResponse));
1082
- } while (marker);
1083
- }
1084
- });
1085
- }
1086
- /**
1087
- * Returns an AsyncIterableIterator for handles
1088
- *
1089
- * @param options - Options to list handles operation.
1090
- */
1091
- listHandleItems() {
1092
- return __asyncGenerator(this, arguments, function* listHandleItems_1(options = {}) {
1093
- var _a, e_2, _b, _c;
1094
- let marker;
1095
- try {
1096
- for (var _d = true, _e = __asyncValues(this.iterateHandleSegments(marker, options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
1097
- _c = _f.value;
1098
- _d = false;
1099
- const listHandlesResponse = _c;
1100
- if (listHandlesResponse.handleList) {
1101
- for (const handle of listHandlesResponse.handleList) {
1102
- yield yield __await(handle);
1103
- }
1104
- }
1105
- }
1106
- }
1107
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
1108
- finally {
1109
- try {
1110
- if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
1111
- }
1112
- finally { if (e_2) throw e_2.error; }
1113
- }
1114
- });
1115
- }
1116
- /**
1117
- * Returns an async iterable iterator to list all the handles.
1118
- * under the specified account.
1119
- *
1120
- * .byPage() returns an async iterable iterator to list the handles in pages.
1121
- *
1122
- * Example using `for await` syntax:
1123
- *
1124
- * ```js
1125
- * let i = 1;
1126
- * let iter = dirClient.listHandles();
1127
- * for await (const handle of iter) {
1128
- * console.log(`Handle ${i++}: ${handle.path}, opened time ${handle.openTime}, clientIp ${handle.clientIp}`);
1129
- * }
1130
- * ```
1131
- *
1132
- * Example using `iter.next()`:
1133
- *
1134
- * ```js
1135
- * let i = 1;
1136
- * let iter = dirClient.listHandles();
1137
- * let handleItem = await iter.next();
1138
- * while (!handleItem.done) {
1139
- * console.log(`Handle ${i++}: ${handleItem.value.path}, opened time ${handleItem.value.openTime}, clientIp ${handleItem.value.clientIp}`);
1140
- * handleItem = await iter.next();
1141
- * }
1142
- * ```
1143
- *
1144
- * Example using `byPage()`:
1145
- *
1146
- * ```js
1147
- * // passing optional maxPageSize in the page settings
1148
- * let i = 1;
1149
- * for await (const response of dirClient.listHandles({ recursive: true }).byPage({ maxPageSize: 20 })) {
1150
- * if (response.handleList) {
1151
- * for (const handle of response.handleList) {
1152
- * console.log(`Handle ${i++}: ${handle.path}, opened time ${handle.openTime}, clientIp ${handle.clientIp}`);
1153
- * }
1154
- * }
1155
- * }
1156
- * ```
1157
- *
1158
- * Example using paging with a marker:
1159
- *
1160
- * ```js
1161
- * let i = 1;
1162
- * let iterator = dirClient.listHandles().byPage({ maxPageSize: 2 });
1163
- * let response = await iterator.next();
1164
- *
1165
- * // Prints 2 handles
1166
- * if (response.value.handleList) {
1167
- * for (const handle of response.value.handleList) {
1168
- * console.log(`Handle ${i++}: ${handle.path}, opened time ${handle.openTime}, clientIp ${handle.clientIp}`);
1169
- * }
1170
- * }
1171
- *
1172
- * // Gets next marker
1173
- * let marker = response.value.continuationToken;
1174
- *
1175
- * // Passing next marker as continuationToken
1176
- * console.log(` continuation`);
1177
- * iterator = dirClient.listHandles().byPage({ continuationToken: marker, maxPageSize: 10 });
1178
- * response = await iterator.next();
1179
- *
1180
- * // Prints 2 more handles assuming you have more than four directory/files opened
1181
- * if (!response.done && response.value.handleList) {
1182
- * for (const handle of response.value.handleList) {
1183
- * console.log(`Handle ${i++}: ${handle.path}, opened time ${handle.openTime}, clientIp ${handle.clientIp}`);
1184
- * }
1185
- * }
1186
- * ```
1187
- *
1188
- * @param options - Options to list handles operation.
1189
- *
1190
- * An asyncIterableIterator that supports paging.
1191
- */
1192
- listHandles(options = {}) {
1193
- // an AsyncIterableIterator to iterate over handles
1194
- const iter = this.listHandleItems(options);
1195
- return {
1196
- /**
1197
- * The next method, part of the iteration protocol
1198
- */
1199
- async next() {
1200
- return iter.next();
1201
- },
1202
- /**
1203
- * The connection to the async iterator, part of the iteration protocol
1204
- */
1205
- [Symbol.asyncIterator]() {
1206
- return this;
1207
- },
1208
- /**
1209
- * Return an AsyncIterableIterator that works a page at a time
1210
- */
1211
- byPage: (settings = {}) => {
1212
- return this.iterateHandleSegments(removeEmptyString(settings.continuationToken), Object.assign({ maxResults: settings.maxPageSize }, options));
1213
- },
1214
- };
1215
- }
1216
- /**
1217
- * Lists handles for a directory.
1218
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/list-handles
1219
- *
1220
- * @param marker - Optional. A string value that identifies the portion of the list to be
1221
- * returned with the next list handles operation. The operation returns a
1222
- * marker value within the response body if the list returned was not complete.
1223
- * The marker value may then be used in a subsequent call to request the next
1224
- * set of list items.
1225
- * @param options -
1226
- */
1227
- async listHandlesSegment(marker, options = {}) {
1228
- return tracingClient.withSpan("ShareDirectoryClient-listHandlesSegment", options, async (updatedOptions) => {
1229
- marker = marker === "" ? undefined : marker;
1230
- const response = assertResponse(await this.context.listHandles(Object.assign(Object.assign(Object.assign({}, updatedOptions), { marker }), this.shareClientConfig)));
1231
- // TODO: Protocol layer issue that when handle list is in returned XML
1232
- // response.handleList is an empty string
1233
- if (response.handleList === "") {
1234
- response.handleList = undefined;
1235
- }
1236
- const wrappedResponse = Object.assign(Object.assign({}, ConvertInternalResponseOfListHandles(response)), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListHandles(response._response.parsedBody) }) });
1237
- return wrappedResponse;
1238
- });
1239
- }
1240
- /**
1241
- * Force close all handles for a directory.
1242
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/force-close-handles
1243
- *
1244
- * @param marker - Optional. A string value that identifies the position of handles that will
1245
- * be closed with the next force close handles operation.
1246
- * The operation returns a marker value within the response
1247
- * body if there are more handles to close. The marker value
1248
- * may then be used in a subsequent call to close the next set of handles.
1249
- * @param options -
1250
- */
1251
- async forceCloseHandlesSegment(marker, options = {}) {
1252
- return tracingClient.withSpan("ShareDirectoryClient-forceCloseHandlesSegment", options, async (updatedOptions) => {
1253
- var _a, _b;
1254
- if (marker === "") {
1255
- marker = undefined;
1256
- }
1257
- const rawResponse = assertResponse(await this.context.forceCloseHandles("*", Object.assign(Object.assign(Object.assign({}, updatedOptions), { marker }), this.shareClientConfig)));
1258
- 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 });
1259
- });
1260
- }
1261
- /**
1262
- * Force close all handles for a directory.
1263
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/force-close-handles
1264
- *
1265
- * @param options -
1266
- */
1267
- async forceCloseAllHandles(options = {}) {
1268
- return tracingClient.withSpan("ShareDirectoryClient-forceCloseAllHandles", options, async (updatedOptions) => {
1269
- let handlesClosed = 0;
1270
- let numberOfHandlesFailedToClose = 0;
1271
- let marker = "";
1272
- do {
1273
- const response = await this.forceCloseHandlesSegment(marker, updatedOptions);
1274
- marker = response.marker;
1275
- if (response.closedHandlesCount) {
1276
- handlesClosed += response.closedHandlesCount;
1277
- }
1278
- if (response.closeFailureCount) {
1279
- numberOfHandlesFailedToClose += response.closeFailureCount;
1280
- }
1281
- } while (marker);
1282
- return {
1283
- closedHandlesCount: handlesClosed,
1284
- closeFailureCount: numberOfHandlesFailedToClose,
1285
- };
1286
- });
1287
- }
1288
- /**
1289
- * Force close a specific handle for a directory.
1290
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/force-close-handles
1291
- *
1292
- * @param aborter - Create a new Aborter instance with Aborter.none or Aborter.timeout(),
1293
- * goto documents of Aborter for more examples about request cancellation
1294
- * @param handleId - Specific handle ID, cannot be asterisk "*".
1295
- * Use forceCloseHandlesSegment() to close all handles.
1296
- * @param options -
1297
- */
1298
- async forceCloseHandle(handleId, options = {}) {
1299
- return tracingClient.withSpan("ShareDirectoryClient-forceCloseHandle", options, async (updatedOptions) => {
1300
- if (handleId === "*") {
1301
- throw new RangeError(`Parameter handleID should be a specified handle ID. Use forceCloseHandlesSegment() to close all handles.`);
1302
- }
1303
- const rawResponse = await this.context.forceCloseHandles(handleId, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig));
1304
- const response = rawResponse;
1305
- response.closedHandlesCount = rawResponse.numberOfHandlesClosed || 0;
1306
- response.closeFailureCount = rawResponse.numberOfHandlesFailedToClose || 0;
1307
- return response;
1308
- });
1309
- }
1310
- /**
1311
- * Renames a directory.
1312
- * This API only supports renaming a directory in the same share.
1313
- *
1314
- * @param destinationPath - Specifies the destination path to rename to. The path will be encoded to put into a URL to specify the destination.
1315
- * @param options - Options for the renaming operation.
1316
- * @returns Response data for the file renaming operation.
1317
- *
1318
- * Example usage:
1319
- *
1320
- * ```js
1321
- *
1322
- * // Rename the directory
1323
- * await diretoryClient.rename(destinationPath);
1324
- * console.log("Renamed directory successfully!");
1325
- * ```
1326
- */
1327
- async rename(destinationPath, options = {}) {
1328
- const split = destinationPath.split("?");
1329
- let destinationUrl;
1330
- if (split.length === 2) {
1331
- const pathOnly = EscapePath(split[0]);
1332
- const renameDestination = `/${this.shareName}/${pathOnly}`;
1333
- destinationUrl = setURLPath(this.url, renameDestination);
1334
- destinationUrl = setURLQueries(destinationUrl, split[1]);
1335
- }
1336
- else if (split.length === 1) {
1337
- const pathOnly = EscapePath(destinationPath);
1338
- const renameDestination = `/${this.shareName}/${pathOnly}`;
1339
- destinationUrl = setURLPath(this.url, renameDestination);
1340
- }
1341
- else {
1342
- throw new RangeError("Destination path should not contain more than one query string");
1343
- }
1344
- const destDirectory = new ShareDirectoryClient(destinationUrl, this.pipeline, this.shareClientConfig);
1345
- return tracingClient.withSpan("ShareDirectoryClient-rename", options, async (updatedOptions) => {
1346
- const response = assertResponse(await destDirectory.context.rename(this.url, Object.assign(Object.assign(Object.assign({}, updatedOptions), { sourceLeaseAccessConditions: updatedOptions.sourceLeaseAccessConditions
1347
- ? {
1348
- sourceLeaseId: updatedOptions.sourceLeaseAccessConditions.leaseId,
1349
- }
1350
- : undefined, destinationLeaseAccessConditions: updatedOptions.destinationLeaseAccessConditions
1351
- ? {
1352
- destinationLeaseId: updatedOptions.destinationLeaseAccessConditions.leaseId,
1353
- }
1354
- : undefined }), this.shareClientConfig)));
1355
- return {
1356
- destinationDirectoryClient: destDirectory,
1357
- directoryRenameResponse: response,
1358
- };
1359
- });
1360
- }
1361
- }
1362
- /**
1363
- * A ShareFileClient represents a URL to an Azure Storage file.
1364
- */
1365
- export class ShareFileClient extends StorageClient {
1366
- /**
1367
- * The share name corresponding to this file client
1368
- */
1369
- get shareName() {
1370
- return this._shareName;
1371
- }
1372
- /**
1373
- * The full path of the file
1374
- */
1375
- get path() {
1376
- return this._path;
1377
- }
1378
- /**
1379
- * The name of the file
1380
- */
1381
- get name() {
1382
- return this._name;
1383
- }
1384
- constructor(url, credentialOrPipeline,
1385
- // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.
1386
- /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */
1387
- options) {
1388
- let pipeline;
1389
- if (isPipelineLike(credentialOrPipeline)) {
1390
- pipeline = credentialOrPipeline;
1391
- }
1392
- else if (credentialOrPipeline instanceof Credential ||
1393
- isTokenCredential(credentialOrPipeline)) {
1394
- pipeline = newPipeline(credentialOrPipeline, options);
1395
- }
1396
- else {
1397
- // The second parameter is undefined. Use anonymous credential.
1398
- pipeline = newPipeline(new AnonymousCredential(), options);
1399
- }
1400
- super(url, pipeline);
1401
- ({
1402
- baseName: this._name,
1403
- shareName: this._shareName,
1404
- path: this._path,
1405
- } = getShareNameAndPathFromUrl(this.url));
1406
- this.shareClientConfig = options;
1407
- this.context = this.storageClientContext.file;
1408
- }
1409
- /**
1410
- * Creates a new ShareFileClient object identical to the source but with the specified share snapshot timestamp.
1411
- * Provide "" will remove the snapshot and return a URL to the base ShareFileClient.
1412
- *
1413
- * @param shareSnapshot - The share snapshot timestamp.
1414
- * @returns A new ShareFileClient object identical to the source but with the specified share snapshot timestamp.
1415
- */
1416
- withShareSnapshot(shareSnapshot) {
1417
- return new ShareFileClient(setURLParameter(this.url, URLConstants.Parameters.SHARE_SNAPSHOT, shareSnapshot.length === 0 ? undefined : shareSnapshot), this.pipeline, this.shareClientConfig);
1418
- }
1419
- /**
1420
- * Creates a new file or replaces a file. Note it only initializes the file with no content.
1421
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/create-file
1422
- *
1423
- * @param size - Specifies the maximum size in bytes for the file, up to 4 TB.
1424
- * @param options - Options to File Create operation.
1425
- * @returns Response data for the File Create operation.
1426
- *
1427
- * Example usage:
1428
- *
1429
- * ```js
1430
- * const content = "Hello world!";
1431
- *
1432
- * // Create the file
1433
- * await fileClient.create(content.length);
1434
- * console.log("Created file successfully!");
1435
- *
1436
- * // Then upload data to the file
1437
- * await fileClient.uploadRange(content, 0, content.length);
1438
- * console.log("Updated file successfully!")
1439
- * ```
1440
- */
1441
- async create(size, options = {}) {
1442
- if (size < 0 || size > FILE_MAX_SIZE_BYTES) {
1443
- throw new RangeError(`File size must >= 0 and < ${FILE_MAX_SIZE_BYTES}.`);
1444
- }
1445
- options = validateAndSetDefaultsForFileAndDirectoryCreateCommonOptions(options);
1446
- options.fileHttpHeaders = options.fileHttpHeaders || {};
1447
- return tracingClient.withSpan("ShareFileClient-create", options, async (updatedOptions) => {
1448
- var _a, _b, _c, _d;
1449
- const rawResponse = await this.context.create(size, Object.assign(Object.assign(Object.assign({}, updatedOptions), { fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime), fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime), fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime), fileAttributes: updatedOptions.fileAttributes
1450
- ? fileAttributesToString(updatedOptions.fileAttributes)
1451
- : undefined, owner: (_a = updatedOptions.posixProperties) === null || _a === void 0 ? void 0 : _a.owner, group: (_b = updatedOptions.posixProperties) === null || _b === void 0 ? void 0 : _b.group, fileMode: toOctalFileMode((_c = updatedOptions.posixProperties) === null || _c === void 0 ? void 0 : _c.fileMode), nfsFileType: (_d = updatedOptions.posixProperties) === null || _d === void 0 ? void 0 : _d.fileType }), this.shareClientConfig));
1452
- const wrappedRes = Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
1453
- fileMode: parseOctalFileMode(rawResponse.fileMode),
1454
- fileType: rawResponse.nfsFileType,
1455
- owner: rawResponse.owner,
1456
- group: rawResponse.group,
1457
- } });
1458
- return assertResponse(wrappedRes);
1459
- });
1460
- }
1461
- /**
1462
- * Reads or downloads a file from the system, including its metadata and properties.
1463
- *
1464
- * * In Node.js, data returns in a Readable stream `readableStreamBody`
1465
- * * In browsers, data returns in a promise `contentAsBlob`
1466
- *
1467
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/get-file
1468
- *
1469
- * @param offset - From which position of the file to download, greater than or equal to 0
1470
- * @param count - How much data to be downloaded, greater than 0. Will download to the end when undefined
1471
- * @param options - Options to File Download operation.
1472
- * @returns Response data for the File Download operation.
1473
- *
1474
- * Example usage (Node.js):
1475
- *
1476
- * ```js
1477
- * // Download a file to a string
1478
- * const downloadFileResponse = await fileClient.download();
1479
- * console.log(
1480
- * "Downloaded file content:",
1481
- * (await streamToBuffer(downloadFileResponse.readableStreamBody)).toString()}
1482
- * );
1483
- *
1484
- * // A helper method used to read a Node.js readable stream into string
1485
- * async function streamToBuffer(readableStream) {
1486
- * return new Promise((resolve, reject) => {
1487
- * const chunks = [];
1488
- * readableStream.on("data", (data) => {
1489
- * chunks.push(typeof data === "string" ? Buffer.from(data) : data);
1490
- * });
1491
- * readableStream.on("end", () => {
1492
- * resolve(Buffer.concat(chunks));
1493
- * });
1494
- * readableStream.on("error", reject);
1495
- * });
1496
- * }
1497
- * ```
1498
- *
1499
- * Example usage (browsers):
1500
- *
1501
- * ```js
1502
- * // Download a file to a string
1503
- * const downloadFileResponse = await fileClient.download(0);
1504
- * console.log(
1505
- * "Downloaded file content:",
1506
- * await blobToString(await downloadFileResponse.blobBody)}
1507
- * );
1508
- *
1509
- * // A helper method used to convert a browser Blob into string.
1510
- * export async function blobToString(blob: Blob): Promise<string> {
1511
- * const fileReader = new FileReader();
1512
- * return new Promise<string>((resolve, reject) => {
1513
- * fileReader.onloadend = (ev: any) => {
1514
- * resolve(ev.target!.result);
1515
- * };
1516
- * fileReader.onerror = reject;
1517
- * fileReader.readAsText(blob);
1518
- * });
1519
- * }
1520
- * ```
1521
- */
1522
- async download(offset = 0, count, options = {}) {
1523
- return tracingClient.withSpan("ShareFileClient-download", options, async (updatedOptions) => {
1524
- if (updatedOptions.rangeGetContentMD5 && offset === 0 && count === undefined) {
1525
- throw new RangeError(`rangeGetContentMD5 only works with partial data downloading`);
1526
- }
1527
- const downloadFullFile = offset === 0 && !count;
1528
- const rawResponse = await this.context.download(Object.assign(Object.assign(Object.assign({}, updatedOptions), { requestOptions: {
1529
- onDownloadProgress: isNode ? undefined : updatedOptions.onProgress, // for Node.js, progress is reported by RetriableReadableStream
1530
- }, range: downloadFullFile ? undefined : rangeToString({ offset, count }) }), this.shareClientConfig));
1531
- const res = assertResponse(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
1532
- fileMode: parseOctalFileMode(rawResponse.fileMode),
1533
- owner: rawResponse.owner,
1534
- group: rawResponse.group,
1535
- linkCount: rawResponse.linkCount,
1536
- } }));
1537
- // Return browser response immediately
1538
- if (!isNode) {
1539
- return res;
1540
- }
1541
- // We support retrying when download stream unexpected ends in Node.js runtime
1542
- // Following code shouldn't be bundled into browser build, however some
1543
- // bundlers may try to bundle following code and "FileReadResponse.ts".
1544
- // In this case, "FileDownloadResponse.browser.ts" will be used as a shim of "FileDownloadResponse.ts"
1545
- // The config is in package.json "browser" field
1546
- if (updatedOptions.maxRetryRequests === undefined || updatedOptions.maxRetryRequests < 0) {
1547
- // TODO: Default value or make it a required parameter?
1548
- updatedOptions.maxRetryRequests = DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS;
1549
- }
1550
- if (res.contentLength === undefined) {
1551
- throw new RangeError(`File download response doesn't contain valid content length header`);
1552
- }
1553
- return new FileDownloadResponse(res, async (start) => {
1554
- const updatedDownloadOptions = {
1555
- range: rangeToString({
1556
- count: offset + res.contentLength - start,
1557
- offset: start,
1558
- }),
1559
- };
1560
- // Debug purpose only
1561
- // console.log(
1562
- // `Read from internal stream, range: ${
1563
- // chunkDownloadOptions.range
1564
- // }, options: ${JSON.stringify(chunkDownloadOptions)}`
1565
- // );
1566
- const downloadRes = await this.context.download(Object.assign(Object.assign(Object.assign({}, updatedOptions), updatedDownloadOptions), this.shareClientConfig));
1567
- if (!(downloadRes.etag === res.etag)) {
1568
- throw new Error("File has been modified concurrently");
1569
- }
1570
- return downloadRes.readableStreamBody;
1571
- }, offset, res.contentLength, {
1572
- maxRetryRequests: updatedOptions.maxRetryRequests,
1573
- onProgress: updatedOptions.onProgress,
1574
- });
1575
- });
1576
- }
1577
- /**
1578
- * Returns true if the specified file exists; false otherwise.
1579
- *
1580
- * NOTE: use this function with care since an existing file might be deleted by other clients or
1581
- * applications. Vice versa new files might be added by other clients or applications after this
1582
- * function completes.
1583
- *
1584
- * @param options - options to Exists operation.
1585
- */
1586
- async exists(options = {}) {
1587
- return tracingClient.withSpan("ShareFileClient-exists", options, async (updatedOptions) => {
1588
- try {
1589
- await this.getProperties(updatedOptions);
1590
- return true;
1591
- }
1592
- catch (e) {
1593
- if (e.statusCode === 404) {
1594
- return false;
1595
- }
1596
- throw e;
1597
- }
1598
- });
1599
- }
1600
- /**
1601
- * Returns all user-defined metadata, standard HTTP properties, and system properties
1602
- * for the file. It does not return the content of the file.
1603
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/get-file-properties
1604
- *
1605
- * @param options - Options to File Get Properties operation.
1606
- * @returns Response data for the File Get Properties operation.
1607
- */
1608
- async getProperties(options = {}) {
1609
- return tracingClient.withSpan("ShareFileClient-getProperties", options, async (updatedOptions) => {
1610
- const rawResponse = await this.context.getProperties(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig));
1611
- return assertResponse(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
1612
- fileMode: parseOctalFileMode(rawResponse.fileMode),
1613
- fileType: rawResponse.nfsFileType,
1614
- owner: rawResponse.owner,
1615
- group: rawResponse.group,
1616
- linkCount: rawResponse.linkCount,
1617
- } }));
1618
- });
1619
- }
1620
- /**
1621
- * Sets properties on the file.
1622
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/set-file-properties
1623
- *
1624
- * @param properties - File properties. For file HTTP headers(e.g. Content-Type),
1625
- * if no values are provided, existing HTTP headers will be removed.
1626
- * For other file properties(e.g. fileAttributes), if no values are provided,
1627
- * existing values will be preserved.
1628
- */
1629
- async setProperties(properties = {}) {
1630
- properties = validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions(properties);
1631
- properties.fileHttpHeaders = properties.fileHttpHeaders || {};
1632
- return tracingClient.withSpan("ShareFileClient-setProperties", properties, async (updatedOptions) => {
1633
- var _a, _b, _c;
1634
- const rawResponse = await this.context.setHttpHeaders(Object.assign(Object.assign(Object.assign({}, updatedOptions), { fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime), fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime), fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime), fileAttributes: updatedOptions.fileAttributes
1635
- ? fileAttributesToString(updatedOptions.fileAttributes)
1636
- : undefined, owner: (_a = updatedOptions.posixProperties) === null || _a === void 0 ? void 0 : _a.owner, group: (_b = updatedOptions.posixProperties) === null || _b === void 0 ? void 0 : _b.group, fileMode: toOctalFileMode((_c = updatedOptions.posixProperties) === null || _c === void 0 ? void 0 : _c.fileMode) }), this.shareClientConfig));
1637
- return assertResponse(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
1638
- fileMode: parseOctalFileMode(rawResponse.fileMode),
1639
- owner: rawResponse.owner,
1640
- group: rawResponse.group,
1641
- linkCount: rawResponse.linkCount,
1642
- } }));
1643
- });
1644
- }
1645
- /**
1646
- * Removes the file from the storage account.
1647
- * When a file is successfully deleted, it is immediately removed from the storage
1648
- * account's index and is no longer accessible to clients. The file's data is later
1649
- * removed from the service during garbage collection.
1650
- *
1651
- * Delete File will fail with status code 409 (Conflict) and error code SharingViolation
1652
- * if the file is open on an SMB client.
1653
- *
1654
- * Delete File is not supported on a share snapshot, which is a read-only copy of
1655
- * a share. An attempt to perform this operation on a share snapshot will fail with 400 (InvalidQueryParameterValue)
1656
- *
1657
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/delete-file2
1658
- *
1659
- * @param options - Options to File Delete operation.
1660
- * @returns Response data for the File Delete operation.
1661
- */
1662
- async delete(options = {}) {
1663
- return tracingClient.withSpan("ShareFileClient-delete", options, async (updatedOptions) => {
1664
- return assertResponse(await this.context.delete(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
1665
- });
1666
- }
1667
- /**
1668
- * Removes the file from the storage account if it exists.
1669
- * When a file is successfully deleted, it is immediately removed from the storage
1670
- * account's index and is no longer accessible to clients. The file's data is later
1671
- * removed from the service during garbage collection.
1672
- *
1673
- * Delete File will fail with status code 409 (Conflict) and error code SharingViolation
1674
- * if the file is open on an SMB client.
1675
- *
1676
- * Delete File is not supported on a share snapshot, which is a read-only copy of
1677
- * a share. An attempt to perform this operation on a share snapshot will fail with 400 (InvalidQueryParameterValue)
1678
- *
1679
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/delete-file2
1680
- *
1681
- * @param options -
1682
- */
1683
- async deleteIfExists(options = {}) {
1684
- return tracingClient.withSpan("ShareFileClient-deleteIfExists", options, async (updatedOptions) => {
1685
- var _a, _b, _c;
1686
- try {
1687
- const res = await this.delete(updatedOptions);
1688
- return Object.assign({ succeeded: true }, res);
1689
- }
1690
- catch (e) {
1691
- if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ResourceNotFound" ||
1692
- ((_b = e.details) === null || _b === void 0 ? void 0 : _b.errorCode) === "ParentNotFound") {
1693
- return Object.assign(Object.assign({ succeeded: false }, (_c = e.response) === null || _c === void 0 ? void 0 : _c.parsedHeaders), { _response: e.response });
1694
- }
1695
- throw e;
1696
- }
1697
- });
1698
- }
1699
- /**
1700
- * Sets HTTP headers on the file.
1701
- *
1702
- * If no option provided, or no value provided for the file HTTP headers in the options,
1703
- * these file HTTP headers without a value will be cleared.
1704
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/set-file-properties
1705
- *
1706
- * @param FileHttpHeaders - File HTTP headers like Content-Type.
1707
- * Provide undefined will remove existing HTTP headers.
1708
- * @param options - Options to File Set HTTP Headers operation.
1709
- * @returns Response data for the File Set HTTP Headers operation.
1710
- */
1711
- async setHttpHeaders(fileHttpHeaders = {}, options = {}) {
1712
- // FileAttributes, filePermission, createTime, lastWriteTime will all be preserved
1713
- options = validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions(options);
1714
- return tracingClient.withSpan("ShareFileClient-setHTTPHeaders", options, async (updatedOptions) => {
1715
- var _a, _b, _c;
1716
- const rawResponse = await this.context.setHttpHeaders(Object.assign(Object.assign(Object.assign({}, updatedOptions), { fileHttpHeaders, fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime), fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime), fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime), fileAttributes: updatedOptions.fileAttributes
1717
- ? fileAttributesToString(updatedOptions.fileAttributes)
1718
- : undefined, owner: (_a = updatedOptions.posixProperties) === null || _a === void 0 ? void 0 : _a.owner, group: (_b = updatedOptions.posixProperties) === null || _b === void 0 ? void 0 : _b.group, fileMode: toOctalFileMode((_c = updatedOptions.posixProperties) === null || _c === void 0 ? void 0 : _c.fileMode) }), this.shareClientConfig));
1719
- return assertResponse(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
1720
- fileMode: parseOctalFileMode(rawResponse.fileMode),
1721
- owner: rawResponse.owner,
1722
- group: rawResponse.group,
1723
- linkCount: rawResponse.linkCount,
1724
- } }));
1725
- });
1726
- }
1727
- /**
1728
- * Resize file.
1729
- *
1730
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/set-file-properties
1731
- *
1732
- * @param length - Resizes a file to the specified size in bytes.
1733
- * If the specified byte value is less than the current size of the file,
1734
- * then all ranges above the specified byte value are cleared.
1735
- * @param options - Options to File Resize operation.
1736
- * @returns Response data for the File Set HTTP Headers operation.
1737
- */
1738
- async resize(length, options = {}) {
1739
- if (length < 0) {
1740
- throw new RangeError(`Size cannot less than 0 when resizing file.`);
1741
- }
1742
- // FileAttributes, filePermission, createTime, lastWriteTime will all be preserved.
1743
- options = validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions(options);
1744
- return tracingClient.withSpan("ShareFileClient-resize", options, async (updatedOptions) => {
1745
- var _a, _b, _c;
1746
- const rawResponse = await this.context.setHttpHeaders(Object.assign(Object.assign(Object.assign({}, updatedOptions), { fileContentLength: length, fileChangeOn: fileChangeTimeToString(options.changeTime), fileCreatedOn: fileCreationTimeToString(options.creationTime), fileLastWriteOn: fileLastWriteTimeToString(options.lastWriteTime), fileAttributes: fileAttributesToString(updatedOptions.fileAttributes), owner: (_a = updatedOptions.posixProperties) === null || _a === void 0 ? void 0 : _a.owner, group: (_b = updatedOptions.posixProperties) === null || _b === void 0 ? void 0 : _b.group, fileMode: toOctalFileMode((_c = options.posixProperties) === null || _c === void 0 ? void 0 : _c.fileMode) }), this.shareClientConfig));
1747
- return assertResponse(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
1748
- fileMode: parseOctalFileMode(rawResponse.fileMode),
1749
- owner: rawResponse.owner,
1750
- group: rawResponse.group,
1751
- linkCount: rawResponse.linkCount,
1752
- } }));
1753
- });
1754
- }
1755
- /**
1756
- * Updates user-defined metadata for the specified file.
1757
- *
1758
- * If no metadata defined in the option parameter, the file
1759
- * metadata will be removed.
1760
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/set-file-metadata
1761
- *
1762
- * @param metadata - If no metadata provided, all existing directory metadata will be removed
1763
- * @param options - Options to File Set Metadata operation.
1764
- * @returns Response data for the File Set Metadata operation.
1765
- */
1766
- async setMetadata(metadata = {}, options = {}) {
1767
- return tracingClient.withSpan("ShareFileClient-setMetadata", options, async (updatedOptions) => {
1768
- return assertResponse(await this.context.setMetadata(Object.assign(Object.assign(Object.assign({}, updatedOptions), { metadata }), this.shareClientConfig)));
1769
- });
1770
- }
1771
- /**
1772
- * Upload a range of bytes to a file. This operation can only be called on an existing file.
1773
- * It won't change the size, properties or metadata of the file.
1774
- * Both the start and count of the range must be specified. The range can be up to 4 MB in size.
1775
- *
1776
- * @param body - Blob, string, ArrayBuffer, ArrayBufferView or a function
1777
- * which returns a new Readable stream whose offset is from data source beginning.
1778
- * @param offset - Offset position of the destination Azure File to upload.
1779
- * @param contentLength - Length of body in bytes. Use Buffer.byteLength() to calculate body length for a
1780
- * string including non non-Base64/Hex-encoded characters.
1781
- * @param options - Options to File Upload Range operation.
1782
- * @returns Response data for the File Upload Range operation.
1783
- *
1784
- * Example usage:
1785
- *
1786
- * ```js
1787
- * const content = "Hello world!";
1788
- *
1789
- * // Create the file
1790
- * await fileClient.create(content.length);
1791
- * console.log("Created file successfully!");
1792
- *
1793
- * // Then upload data to the file
1794
- * await fileClient.uploadRange(content, 0, content.length);
1795
- * console.log("Updated file successfully!")
1796
- * ```
1797
- */
1798
- async uploadRange(body, offset, contentLength, options = {}) {
1799
- return tracingClient.withSpan("ShareFileClient-uploadRange", options, async (updatedOptions) => {
1800
- if (offset < 0) {
1801
- throw new RangeError(`offset must be >= 0`);
1802
- }
1803
- if (contentLength <= 0 || contentLength > FILE_RANGE_MAX_SIZE_BYTES) {
1804
- throw new RangeError(`contentLength must be > 0 and <= ${FILE_RANGE_MAX_SIZE_BYTES} bytes`);
1805
- }
1806
- if (contentLength > FILE_RANGE_MAX_SIZE_BYTES) {
1807
- throw new RangeError(`offset must be < ${FILE_RANGE_MAX_SIZE_BYTES} bytes`);
1808
- }
1809
- return assertResponse(await this.context.uploadRange(rangeToString({ count: contentLength, offset }), "update", contentLength, Object.assign(Object.assign(Object.assign({}, updatedOptions), { requestOptions: {
1810
- onUploadProgress: updatedOptions.onProgress,
1811
- }, body }), this.shareClientConfig)));
1812
- });
1813
- }
1814
- /**
1815
- * Upload a range of bytes to a file where the contents are read from a another file's URL.
1816
- * The range can be up to 4 MB in size.
1817
- *
1818
- * @param sourceURL - Specify a URL to the copy source, Shared Access Signature(SAS) maybe needed for authentication.
1819
- * @param sourceOffset - The source offset to copy from. Pass 0 to copy from the beginning of source file.
1820
- * @param destOffset - Offset of destination file.
1821
- * @param count - Number of bytes to be uploaded from source file.
1822
- * @param options - Options to configure File - Upload Range from URL operation.
1823
- */
1824
- async uploadRangeFromURL(sourceURL, sourceOffset, destOffset, count, options = {}) {
1825
- return tracingClient.withSpan("ShareFileClient-uploadRangeFromURL", options, async (updatedOptions) => {
1826
- if (sourceOffset < 0 || destOffset < 0) {
1827
- throw new RangeError(`sourceOffset and destOffset must be >= 0`);
1828
- }
1829
- if (count <= 0 || count > FILE_RANGE_MAX_SIZE_BYTES) {
1830
- throw new RangeError(`count must be > 0 and <= ${FILE_RANGE_MAX_SIZE_BYTES} bytes`);
1831
- }
1832
- return assertResponse(await this.context.uploadRangeFromURL(rangeToString({ offset: destOffset, count }), sourceURL, 0, Object.assign(Object.assign(Object.assign({}, updatedOptions), { sourceRange: rangeToString({ offset: sourceOffset, count }), sourceModifiedAccessConditions: updatedOptions.sourceConditions, copySourceAuthorization: httpAuthorizationToString(updatedOptions.sourceAuthorization) }), this.shareClientConfig)));
1833
- });
1834
- }
1835
- /**
1836
- * Clears the specified range and
1837
- * releases the space used in storage for that range.
1838
- *
1839
- * @param offset -
1840
- * @param contentLength -
1841
- * @param options - Options to File Clear Range operation.
1842
- */
1843
- async clearRange(offset, contentLength, options = {}) {
1844
- return tracingClient.withSpan("ShareFileClient-clearRange", options, async (updatedOptions) => {
1845
- if (offset < 0 || contentLength <= 0) {
1846
- throw new RangeError(`offset must >= 0 and contentLength must be > 0`);
1847
- }
1848
- return assertResponse(await this.context.uploadRange(rangeToString({ count: contentLength, offset }), "clear", 0, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
1849
- });
1850
- }
1851
- /**
1852
- * Returns the list of valid ranges for a file.
1853
- *
1854
- * @param options - Options to File Get range List operation.
1855
- */
1856
- async getRangeList(options = {}) {
1857
- return tracingClient.withSpan("ShareFileClient-getRangeList", options, async (updatedOptions) => {
1858
- const originalResponse = assertResponse(await this.context.getRangeList(Object.assign(Object.assign(Object.assign({}, updatedOptions), { range: updatedOptions.range ? rangeToString(updatedOptions.range) : undefined }), this.shareClientConfig)));
1859
- // Only returns ranges, ignoring clearRanges.
1860
- const parsedBody = originalResponse._response.parsedBody.ranges
1861
- ? originalResponse._response.parsedBody.ranges
1862
- : [];
1863
- return Object.assign(Object.assign({}, originalResponse), { _response: Object.assign(Object.assign({}, originalResponse._response), { parsedBody }), rangeList: originalResponse.ranges ? originalResponse.ranges : [] });
1864
- });
1865
- }
1866
- /**
1867
- * Returns the list of ranges that differ between a previous share snapshot and this file.
1868
- *
1869
- * @param prevShareSnapshot - The previous snapshot parameter is an opaque DateTime value that specifies the previous share snapshot to compare with.
1870
- * @param options -
1871
- */
1872
- async getRangeListDiff(prevShareSnapshot, options = {}) {
1873
- return tracingClient.withSpan("ShareFileClient-getRangeListDiff", options, async (updatedOptions) => {
1874
- return assertResponse(await this.context.getRangeList(Object.assign(Object.assign(Object.assign({}, updatedOptions), { prevsharesnapshot: prevShareSnapshot, supportRename: options.includeRenames, range: updatedOptions.range ? rangeToString(updatedOptions.range) : undefined }), this.shareClientConfig)));
1875
- });
1876
- }
1877
- /**
1878
- * Copies a blob or file to a destination file within the storage account.
1879
- *
1880
- * @param copySource - Specifies the URL of the source file or blob, up to 2 KB in length.
1881
- * To copy a file to another file within the same storage account, you may use Shared Key to
1882
- * authenticate the source file. If you are copying a file from another storage account, or if you
1883
- * are copying a blob from the same storage account or another storage account, then you must
1884
- * authenticate the source file or blob using a shared access signature. If the source is a public
1885
- * blob, no authentication is required to perform the copy operation. A file in a share snapshot
1886
- * can also be specified as a copy source.
1887
- * @param options - Options to File Start Copy operation.
1888
- */
1889
- async startCopyFromURL(copySource, options = {}) {
1890
- return tracingClient.withSpan("ShareFileClient-startCopyFromURL", options, async (updatedOptions) => {
1891
- var _a, _b, _c;
1892
- return assertResponse(await this.context.startCopy(copySource, Object.assign(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig), { owner: (_a = updatedOptions.posixProperties) === null || _a === void 0 ? void 0 : _a.owner, group: (_b = updatedOptions.posixProperties) === null || _b === void 0 ? void 0 : _b.group, fileMode: toOctalFileMode((_c = updatedOptions.posixProperties) === null || _c === void 0 ? void 0 : _c.fileMode), fileModeCopyMode: updatedOptions.fileModeCopyMode, fileOwnerCopyMode: updatedOptions.fileOwnerCopyMode })));
1893
- });
1894
- }
1895
- /**
1896
- * Aborts a pending Copy File operation, and leaves a destination file with zero length and full
1897
- * metadata.
1898
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/abort-copy-file
1899
- *
1900
- * @param copyId - Id of the Copy File operation to abort.
1901
- * @param options - Options to File Abort Copy From URL operation.
1902
- */
1903
- async abortCopyFromURL(copyId, options = {}) {
1904
- return tracingClient.withSpan("ShareFileClient-abortCopyFromURL", options, async (updatedOptions) => {
1905
- return assertResponse(await this.context.abortCopy(copyId, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
1906
- });
1907
- }
1908
- // High Level functions
1909
- /**
1910
- * Creates a new Azure File or replaces an existing Azure File, and then uploads a Buffer(Node)/Blob/ArrayBuffer/ArrayBufferView to it.
1911
- *
1912
- * @param data - Buffer(Node), Blob, ArrayBuffer or ArrayBufferView
1913
- * @param options -
1914
- */
1915
- async uploadData(data, options = {}) {
1916
- return tracingClient.withSpan("ShareFileClient-uploadData", options, async (updatedOptions) => {
1917
- if (isNode) {
1918
- let buffer;
1919
- if (data instanceof Buffer) {
1920
- buffer = data;
1921
- }
1922
- else if (data instanceof ArrayBuffer) {
1923
- buffer = Buffer.from(data);
1924
- }
1925
- else {
1926
- data = data;
1927
- buffer = Buffer.from(data.buffer, data.byteOffset, data.byteLength);
1928
- }
1929
- return this.uploadSeekableInternal((offset, size) => buffer.slice(offset, offset + size), buffer.byteLength, updatedOptions);
1930
- }
1931
- else {
1932
- const browserBlob = new Blob([data]);
1933
- return this.uploadSeekableInternal((offset, size) => browserBlob.slice(offset, offset + size), browserBlob.size, updatedOptions);
1934
- }
1935
- });
1936
- }
1937
- /**
1938
- * ONLY AVAILABLE IN BROWSERS.
1939
- *
1940
- * Uploads a browser Blob object to an Azure file. Requires a blobFactory as the data source,
1941
- * which need to return a Blob object with the offset and size provided.
1942
- *
1943
- * @param blobFactory -
1944
- * @param size -
1945
- * @param options -
1946
- */
1947
- async uploadSeekableBlob(blobFactory, size, options = {}) {
1948
- return tracingClient.withSpan("ShareFileClient-UploadSeekableBlob", options, async (updatedOptions) => {
1949
- return this.uploadSeekableInternal(blobFactory, size, updatedOptions);
1950
- });
1951
- }
1952
- /**
1953
- * ONLY AVAILABLE IN NODE.JS RUNTIME.
1954
- *
1955
- * Creates a new Azure File or replaces an existing Azure File, and then uploads a local file to it.
1956
- *
1957
- * @param filePath - Full path of local file
1958
- * @param fileClient - ShareFileClient
1959
- * @param options -
1960
- */
1961
- async uploadFile(filePath, options = {}) {
1962
- return tracingClient.withSpan("ShareFileClient-uploadFile", options, async (updatedOptions) => {
1963
- const size = (await fsStat(filePath)).size;
1964
- return this.uploadSeekableInternal((offset, count) => {
1965
- return () => fsCreateReadStream(filePath, {
1966
- autoClose: true,
1967
- end: count ? offset + count - 1 : Infinity,
1968
- start: offset,
1969
- });
1970
- }, size, updatedOptions);
1971
- });
1972
- }
1973
- /**
1974
- * ONLY AVAILABLE IN NODE.JS RUNTIME.
1975
- *
1976
- * Accepts a Node.js Readable stream factory, and uploads in blocks to an Azure File.
1977
- * The Readable stream factory must returns a Node.js Readable stream starting from the offset defined. The offset
1978
- * is the offset in the Azure file to be uploaded.
1979
- *
1980
- * @param streamFactory - Returns a Node.js Readable stream starting
1981
- * from the offset defined
1982
- * @param size - Size of the Azure file
1983
- * @param fileClient - ShareFileClient
1984
- * @param options -
1985
- */
1986
- async uploadResetableStream(streamFactory, size, options = {}) {
1987
- return tracingClient.withSpan("ShareFileClient-uploadResetableStream", options, async (updatedOptions) => {
1988
- return this.uploadSeekableInternal((offset, count) => {
1989
- return () => streamFactory(offset, count);
1990
- }, size, updatedOptions);
1991
- });
1992
- }
1993
- /**
1994
- *
1995
- * @param bodyFactory -
1996
- * @param size - Size of the Azure file
1997
- * @param fileClient - ShareFileClient
1998
- * @param options -
1999
- */
2000
- async uploadSeekableInternal(bodyFactory, size, options = {}) {
2001
- return tracingClient.withSpan("ShareFileClient-uploadSeekableInternal", options, async (updatedOptions) => {
2002
- if (!options.rangeSize) {
2003
- options.rangeSize = FILE_RANGE_MAX_SIZE_BYTES;
2004
- }
2005
- if (options.rangeSize < 0 || options.rangeSize > FILE_RANGE_MAX_SIZE_BYTES) {
2006
- throw new RangeError(`options.rangeSize must be > 0 and <= ${FILE_RANGE_MAX_SIZE_BYTES}`);
2007
- }
2008
- if (!options.fileHttpHeaders) {
2009
- options.fileHttpHeaders = {};
2010
- }
2011
- if (!options.concurrency) {
2012
- options.concurrency = DEFAULT_HIGH_LEVEL_CONCURRENCY;
2013
- }
2014
- if (options.concurrency < 0) {
2015
- throw new RangeError(`options.concurrency cannot less than 0.`);
2016
- }
2017
- // Create the file
2018
- await this.create(size, {
2019
- abortSignal: options.abortSignal,
2020
- fileHttpHeaders: options.fileHttpHeaders,
2021
- metadata: options.metadata,
2022
- leaseAccessConditions: options.leaseAccessConditions,
2023
- tracingOptions: updatedOptions.tracingOptions,
2024
- });
2025
- const numBlocks = Math.floor((size - 1) / options.rangeSize) + 1;
2026
- let transferProgress = 0;
2027
- const batch = new Batch(options.concurrency);
2028
- for (let i = 0; i < numBlocks; i++) {
2029
- batch.addOperation(async () => {
2030
- const start = options.rangeSize * i;
2031
- const end = i === numBlocks - 1 ? size : start + options.rangeSize;
2032
- const contentLength = end - start;
2033
- await this.uploadRange(bodyFactory(start, contentLength), start, contentLength, {
2034
- abortSignal: options.abortSignal,
2035
- leaseAccessConditions: options.leaseAccessConditions,
2036
- tracingOptions: updatedOptions.tracingOptions,
2037
- });
2038
- // Update progress after block is successfully uploaded to server, in case of block trying
2039
- transferProgress += contentLength;
2040
- if (options.onProgress) {
2041
- options.onProgress({ loadedBytes: transferProgress });
2042
- }
2043
- });
2044
- }
2045
- return batch.do();
2046
- });
2047
- }
2048
- async downloadToBuffer(bufferOrOffset, offsetOrCount, countOrOptions, optOptions = {}) {
2049
- let buffer = undefined;
2050
- let offset;
2051
- let count;
2052
- let options = optOptions;
2053
- if (bufferOrOffset instanceof Buffer) {
2054
- buffer = bufferOrOffset;
2055
- offset = offsetOrCount || 0;
2056
- count = typeof countOrOptions === "number" ? countOrOptions : 0;
2057
- }
2058
- else {
2059
- offset = typeof bufferOrOffset === "number" ? bufferOrOffset : 0;
2060
- count = typeof offsetOrCount === "number" ? offsetOrCount : 0;
2061
- options = countOrOptions || {};
2062
- }
2063
- return tracingClient.withSpan("ShareFileClient-downloadToBuffer", options, async (updatedOptions) => {
2064
- if (!options.rangeSize) {
2065
- options.rangeSize = FILE_RANGE_MAX_SIZE_BYTES;
2066
- }
2067
- if (options.rangeSize < 0) {
2068
- throw new RangeError("rangeSize option must be > 0");
2069
- }
2070
- if (offset < 0) {
2071
- throw new RangeError("offset option must be >= 0");
2072
- }
2073
- if (count && count <= 0) {
2074
- throw new RangeError("count option must be > 0");
2075
- }
2076
- if (!options.concurrency) {
2077
- options.concurrency = DEFAULT_HIGH_LEVEL_CONCURRENCY;
2078
- }
2079
- if (options.concurrency < 0) {
2080
- throw new RangeError(`options.concurrency cannot less than 0.`);
2081
- }
2082
- // Customer doesn't specify length, get it
2083
- if (!count) {
2084
- const response = await this.getProperties({
2085
- abortSignal: options.abortSignal,
2086
- leaseAccessConditions: options.leaseAccessConditions,
2087
- tracingOptions: updatedOptions.tracingOptions,
2088
- });
2089
- count = response.contentLength - offset;
2090
- if (count < 0) {
2091
- throw new RangeError(`offset ${offset} shouldn't be larger than file size ${response.contentLength}`);
2092
- }
2093
- }
2094
- if (!buffer) {
2095
- try {
2096
- buffer = Buffer.alloc(count);
2097
- }
2098
- catch (error) {
2099
- throw new Error(`Unable to allocate a buffer of size: ${count} bytes. Please try passing your own Buffer to ` +
2100
- 'the "downloadToBuffer method or try using other methods like "download" or "downloadToFile".' +
2101
- `\t ${error.message}`);
2102
- }
2103
- }
2104
- if (buffer.length < count) {
2105
- throw new RangeError(`The buffer's size should be equal to or larger than the request count of bytes: ${count}`);
2106
- }
2107
- let transferProgress = 0;
2108
- const batch = new Batch(options.concurrency);
2109
- for (let off = offset; off < offset + count; off = off + options.rangeSize) {
2110
- batch.addOperation(async () => {
2111
- // Exclusive chunk end position
2112
- let chunkEnd = offset + count;
2113
- if (off + options.rangeSize < chunkEnd) {
2114
- chunkEnd = off + options.rangeSize;
2115
- }
2116
- const response = await this.download(off, chunkEnd - off, {
2117
- abortSignal: options.abortSignal,
2118
- maxRetryRequests: options.maxRetryRequestsPerRange,
2119
- leaseAccessConditions: options.leaseAccessConditions,
2120
- tracingOptions: updatedOptions.tracingOptions,
2121
- });
2122
- const stream = response.readableStreamBody;
2123
- await streamToBuffer(stream, buffer, off - offset, chunkEnd - offset);
2124
- // Update progress after block is downloaded, in case of block trying
2125
- // Could provide finer grained progress updating inside HTTP requests,
2126
- // only if convenience layer download try is enabled
2127
- transferProgress += chunkEnd - off;
2128
- if (options.onProgress) {
2129
- options.onProgress({ loadedBytes: transferProgress });
2130
- }
2131
- });
2132
- }
2133
- await batch.do();
2134
- return buffer;
2135
- });
2136
- }
2137
- /**
2138
- * ONLY AVAILABLE IN NODE.JS RUNTIME.
2139
- *
2140
- * Creates a new Azure File or replaces an existing Azure File, and then uploads a Node.js Readable stream into it.
2141
- * This method will try to create an Azure File, then starts uploading chunk by chunk.
2142
- * Size of chunk is defined by `bufferSize` parameter.
2143
- * Please make sure potential size of stream doesn't exceed file size.
2144
- *
2145
- * PERFORMANCE IMPROVEMENT TIPS:
2146
- * * Input stream highWaterMark is better to set a same value with bufferSize
2147
- * parameter, which will avoid Buffer.concat() operations.
2148
- *
2149
- * @param stream - Node.js Readable stream. Must be less or equal than file size.
2150
- * @param size - Size of file to be created. Maximum size allowed is 4 TB.
2151
- * If this value is larger than stream size, there will be empty bytes in file tail.
2152
- * @param bufferSize - Size of every buffer allocated in bytes, also the chunk/range size during
2153
- * the uploaded file. Size must be greater than 0 and lesser than or equal to 4 * 1024 * 1024 (4MB)
2154
- * @param maxBuffers - Max buffers will allocate during uploading, positive correlation
2155
- * with max uploading concurrency
2156
- * @param options -
2157
- */
2158
- async uploadStream(stream, size, bufferSize, maxBuffers, options = {}) {
2159
- return tracingClient.withSpan("ShareFileClient-uploadStream", options, async (updatedOptions) => {
2160
- if (!options.fileHttpHeaders) {
2161
- options.fileHttpHeaders = {};
2162
- }
2163
- if (bufferSize <= 0 || bufferSize > FILE_RANGE_MAX_SIZE_BYTES) {
2164
- throw new RangeError(`bufferSize must be > 0 and <= ${FILE_RANGE_MAX_SIZE_BYTES}`);
2165
- }
2166
- if (maxBuffers < 0) {
2167
- throw new RangeError(`maxBuffers must be > 0.`);
2168
- }
2169
- // Create the file
2170
- await this.create(size, {
2171
- abortSignal: options.abortSignal,
2172
- fileHttpHeaders: options.fileHttpHeaders,
2173
- metadata: options.metadata,
2174
- leaseAccessConditions: options.leaseAccessConditions,
2175
- tracingOptions: updatedOptions.tracingOptions,
2176
- });
2177
- let transferProgress = 0;
2178
- const scheduler = new BufferScheduler(stream, bufferSize, maxBuffers, async (buffer, offset) => {
2179
- if (transferProgress + buffer.length > size) {
2180
- throw new RangeError(`Stream size is larger than file size ${size} bytes, uploading failed. ` +
2181
- `Please make sure stream length is less or equal than file size.`);
2182
- }
2183
- await this.uploadRange(buffer, offset, buffer.length, {
2184
- abortSignal: options.abortSignal,
2185
- leaseAccessConditions: options.leaseAccessConditions,
2186
- tracingOptions: updatedOptions.tracingOptions,
2187
- });
2188
- // Update progress after block is successfully uploaded to server, in case of block trying
2189
- transferProgress += buffer.length;
2190
- if (options.onProgress) {
2191
- options.onProgress({ loadedBytes: transferProgress });
2192
- }
2193
- },
2194
- // Concurrency should set a smaller value than maxBuffers, which is helpful to
2195
- // reduce the possibility when a outgoing handler waits for stream data, in
2196
- // this situation, outgoing handlers are blocked.
2197
- // Outgoing queue shouldn't be empty.
2198
- Math.ceil((maxBuffers / 4) * 3));
2199
- return scheduler.do();
2200
- });
2201
- }
2202
- /**
2203
- * ONLY AVAILABLE IN NODE.JS RUNTIME.
2204
- *
2205
- * Downloads an Azure Blob to a local file.
2206
- * Fails if the the given file path already exits.
2207
- * Offset and count are optional, pass 0 and undefined respectively to download the entire blob.
2208
- *
2209
- * @param filePath -
2210
- * @param offset - From which position of the block blob to download.
2211
- * @param count - How much data to be downloaded. Will download to the end when passing undefined.
2212
- * @param options - Options to Blob download options.
2213
- * @returns The response data for blob download operation,
2214
- * but with readableStreamBody set to undefined since its
2215
- * content is already read and written into a local file
2216
- * at the specified path.
2217
- */
2218
- async downloadToFile(filePath, offset = 0, count, options = {}) {
2219
- return tracingClient.withSpan("ShareFileClient-downloadToFile", options, async (updatedOptions) => {
2220
- const response = await this.download(offset, count, updatedOptions);
2221
- if (response.readableStreamBody) {
2222
- await readStreamToLocalFile(response.readableStreamBody, filePath);
2223
- }
2224
- // The stream is no longer accessible so setting it to undefined.
2225
- response.fileDownloadStream = undefined;
2226
- return response;
2227
- });
2228
- }
2229
- /**
2230
- * Lists handles for a file.
2231
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/list-handles
2232
- *
2233
- * @param marker - Optional. A string value that identifies the portion of the list to be
2234
- * returned with the next list handles operation. The operation returns a
2235
- * marker value within the response body if the list returned was not complete.
2236
- * The marker value may then be used in a subsequent call to request the next
2237
- * set of list items.
2238
- * @param options -
2239
- */
2240
- async listHandlesSegment(marker, options = {}) {
2241
- return tracingClient.withSpan("ShareFileClient-listHandlesSegment", options, async (updatedOptions) => {
2242
- marker = marker === "" ? undefined : marker;
2243
- const response = assertResponse(await this.context.listHandles(Object.assign(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig), { marker })));
2244
- // TODO: Protocol layer issue that when handle list is in returned XML
2245
- // response.handleList is an empty string
2246
- if (response.handleList === "") {
2247
- response.handleList = undefined;
2248
- }
2249
- const wrappedResponse = Object.assign(Object.assign({}, ConvertInternalResponseOfListHandles(response)), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListHandles(response._response.parsedBody) }) });
2250
- return wrappedResponse;
2251
- });
2252
- }
2253
- /**
2254
- * Returns an AsyncIterableIterator for FileListHandlesResponse
2255
- *
2256
- * @param marker - A string value that identifies the portion of the list to be
2257
- * returned with the next list handles operation. The operation returns a
2258
- * marker value within the response body if the list returned was not complete.
2259
- * The marker value may then be used in a subsequent call to request the next
2260
- * set of list items.
2261
- * @param options - Options to list handles operation.
2262
- */
2263
- iterateHandleSegments(marker_1) {
2264
- return __asyncGenerator(this, arguments, function* iterateHandleSegments_2(marker, options = {}) {
2265
- let listHandlesResponse;
2266
- if (!!marker || marker === undefined) {
2267
- do {
2268
- listHandlesResponse = yield __await(this.listHandlesSegment(marker, options));
2269
- marker = listHandlesResponse.continuationToken;
2270
- yield yield __await(listHandlesResponse);
2271
- } while (marker);
2272
- }
2273
- });
2274
- }
2275
- /**
2276
- * Returns an AsyncIterableIterator for handles
2277
- *
2278
- * @param options - Options to list handles operation.
2279
- */
2280
- listHandleItems() {
2281
- return __asyncGenerator(this, arguments, function* listHandleItems_2(options = {}) {
2282
- var _a, e_3, _b, _c;
2283
- let marker;
2284
- try {
2285
- for (var _d = true, _e = __asyncValues(this.iterateHandleSegments(marker, options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
2286
- _c = _f.value;
2287
- _d = false;
2288
- const listHandlesResponse = _c;
2289
- if (listHandlesResponse.handleList) {
2290
- for (const handle of listHandlesResponse.handleList) {
2291
- yield yield __await(handle);
2292
- }
2293
- }
2294
- }
2295
- }
2296
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
2297
- finally {
2298
- try {
2299
- if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
2300
- }
2301
- finally { if (e_3) throw e_3.error; }
2302
- }
2303
- });
2304
- }
2305
- /**
2306
- * Returns an async iterable iterator to list all the handles.
2307
- * under the specified account.
2308
- *
2309
- * .byPage() returns an async iterable iterator to list the handles in pages.
2310
- *
2311
- * @param options - Options to list handles operation.
2312
- *
2313
- * An asyncIterableIterator that supports paging.
2314
- */
2315
- listHandles(options = {}) {
2316
- // an AsyncIterableIterator to iterate over handles
2317
- const iter = this.listHandleItems(options);
2318
- return {
2319
- /**
2320
- * The next method, part of the iteration protocol
2321
- */
2322
- async next() {
2323
- return iter.next();
2324
- },
2325
- /**
2326
- * The connection to the async iterator, part of the iteration protocol
2327
- */
2328
- [Symbol.asyncIterator]() {
2329
- return this;
2330
- },
2331
- /**
2332
- * Return an AsyncIterableIterator that works a page at a time
2333
- */
2334
- byPage: (settings = {}) => {
2335
- return this.iterateHandleSegments(removeEmptyString(settings.continuationToken), Object.assign({ maxPageSize: settings.maxPageSize }, options));
2336
- },
2337
- };
2338
- }
2339
- /**
2340
- * Force close all handles for a file.
2341
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/force-close-handles
2342
- *
2343
- * @param marker - Optional. A string value that identifies the position of handles that will
2344
- * be closed with the next force close handles operation.
2345
- * The operation returns a marker value within the response
2346
- * body if there are more handles to close. The marker value
2347
- * may then be used in a subsequent call to close the next set of handles.
2348
- * @param options - Options to force close handles operation.
2349
- */
2350
- async forceCloseHandlesSegment(marker, options = {}) {
2351
- return tracingClient.withSpan("ShareFileClient-forceCloseHandlesSegment", options, async (updatedOptions) => {
2352
- marker = marker === "" ? undefined : marker;
2353
- const rawResponse = await this.context.forceCloseHandles("*", Object.assign(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig), { marker }));
2354
- const response = rawResponse;
2355
- response.closedHandlesCount = rawResponse.numberOfHandlesClosed || 0;
2356
- response.closeFailureCount = rawResponse.numberOfHandlesFailedToClose || 0;
2357
- return response;
2358
- });
2359
- }
2360
- /**
2361
- * Force close all handles for a file.
2362
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/force-close-handles
2363
- *
2364
- * @param options - Options to force close handles operation.
2365
- */
2366
- async forceCloseAllHandles(options = {}) {
2367
- return tracingClient.withSpan("ShareFileClient-forceCloseAllHandles", options, async (updatedOptions) => {
2368
- let handlesClosed = 0;
2369
- let numberOfHandlesFailedToClose = 0;
2370
- let marker = "";
2371
- do {
2372
- const response = await this.forceCloseHandlesSegment(marker, { tracingOptions: updatedOptions.tracingOptions });
2373
- marker = response.marker;
2374
- if (response.closedHandlesCount) {
2375
- handlesClosed += response.closedHandlesCount;
2376
- }
2377
- if (response.closeFailureCount) {
2378
- numberOfHandlesFailedToClose += response.closeFailureCount;
2379
- }
2380
- } while (marker);
2381
- return {
2382
- closedHandlesCount: handlesClosed,
2383
- closeFailureCount: numberOfHandlesFailedToClose,
2384
- };
2385
- });
2386
- }
2387
- /**
2388
- * Force close a specific handle for a file.
2389
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/force-close-handles
2390
- *
2391
- * @param handleId - Specific handle ID, cannot be asterisk "*".
2392
- * Use forceCloseAllHandles() to close all handles.
2393
- * @param FileForceCloseHandlesOptions - Options to force close handles operation.
2394
- */
2395
- async forceCloseHandle(handleId, options = {}) {
2396
- return tracingClient.withSpan("ShareFileClient-forceCloseHandle", options, async (updatedOptions) => {
2397
- if (handleId === "*") {
2398
- throw new RangeError(`Parameter handleID should be a specified handle ID. Use forceCloseHandlesSegment() to close all handles.`);
2399
- }
2400
- const rawResponse = await this.context.forceCloseHandles(handleId, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig));
2401
- const response = rawResponse;
2402
- response.closedHandlesCount = rawResponse.numberOfHandlesClosed || 0;
2403
- response.closeFailureCount = rawResponse.numberOfHandlesFailedToClose || 0;
2404
- return response;
2405
- });
2406
- }
2407
- /**
2408
- * NFS only. Creates a hard link to the file file specified by path.
2409
- * @param targetFile - Path of the file to create the hard link to, not including the share.
2410
- * For example: "targetDirectory/targetSubDirectory/.../targetFile"
2411
- * @param options - Options to create hard link operation.
2412
- */
2413
- async createHardLink(targetFile, options = {}) {
2414
- return tracingClient.withSpan("ShareFileClient-createHardLink", options, async (updatedOptions) => {
2415
- const rawResponse = await this.context.createHardLink(targetFile, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig));
2416
- return assertResponse(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
2417
- fileMode: parseOctalFileMode(rawResponse.fileMode),
2418
- fileType: rawResponse.nfsFileType,
2419
- owner: rawResponse.owner,
2420
- group: rawResponse.group,
2421
- linkCount: rawResponse.linkCount,
2422
- } }));
2423
- });
2424
- }
2425
- /**
2426
- * Get a {@link ShareLeaseClient} that manages leases on the file.
2427
- *
2428
- * @param proposeLeaseId - Initial proposed lease Id.
2429
- * @returns A new ShareLeaseClient object for managing leases on the file.
2430
- */
2431
- getShareLeaseClient(proposeLeaseId) {
2432
- return new ShareLeaseClient(this, proposeLeaseId);
2433
- }
2434
- /**
2435
- * Only available for clients constructed with a shared key credential.
2436
- *
2437
- * Generates a Service Shared Access Signature (SAS) URI based on the client properties
2438
- * and parameters passed in. The SAS is signed by the shared key credential of the client.
2439
- *
2440
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas
2441
- *
2442
- * @param options - Optional parameters.
2443
- * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
2444
- */
2445
- generateSasUrl(options) {
2446
- if (!(this.credential instanceof StorageSharedKeyCredential)) {
2447
- throw RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
2448
- }
2449
- const sas = generateFileSASQueryParameters(Object.assign({ shareName: this.shareName, filePath: this.path }, options), this.credential).toString();
2450
- return appendToURLQuery(this.url, sas);
2451
- }
2452
- /**
2453
- * Only available for clients constructed with a shared key credential.
2454
- *
2455
- * Generates string to sign for a Service Shared Access Signature (SAS) URI based on the client properties
2456
- * and parameters passed in. The SAS is signed by the shared key credential of the client.
2457
- *
2458
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas
2459
- *
2460
- * @param options - Optional parameters.
2461
- * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
2462
- */
2463
- /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/
2464
- generateSasStringToSign(options) {
2465
- if (!(this.credential instanceof StorageSharedKeyCredential)) {
2466
- throw RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
2467
- }
2468
- return generateFileSASQueryParametersInternal(Object.assign({ shareName: this.shareName, filePath: this.path }, options), this.credential).stringToSign;
2469
- }
2470
- /**
2471
- * Renames a file.
2472
- * This API only supports renaming a file in the same share.
2473
- *
2474
- * @param destinationPath - Specifies the destination path to rename to. The path will be encoded to put into a URL to specify the destination.
2475
- * @param options - Options for the renaming operation.
2476
- * @returns Response data for the file renaming operation.
2477
- *
2478
- * Example usage:
2479
- *
2480
- * ```js
2481
- *
2482
- * // Rename the file
2483
- * await fileClient.rename(destinationPath);
2484
- * console.log("Renamed file successfully!");
2485
- * ```
2486
- */
2487
- async rename(destinationPath, options = {}) {
2488
- const split = destinationPath.split("?");
2489
- let destinationUrl;
2490
- if (split.length === 2) {
2491
- const pathOnly = EscapePath(split[0]);
2492
- const renameDestination = `/${this.shareName}/${pathOnly}`;
2493
- destinationUrl = setURLPath(this.url, renameDestination);
2494
- destinationUrl = setURLQueries(destinationUrl, split[1]);
2495
- }
2496
- else if (split.length === 1) {
2497
- const pathOnly = EscapePath(destinationPath);
2498
- const renameDestination = `/${this.shareName}/${pathOnly}`;
2499
- destinationUrl = setURLPath(this.url, renameDestination);
2500
- }
2501
- else {
2502
- throw new RangeError("Destination path should not contain more than one query string");
2503
- }
2504
- const destFile = new ShareFileClient(destinationUrl, this.pipeline, this.shareClientConfig);
2505
- return tracingClient.withSpan("ShareFileClient-rename", options, async (updatedOptions) => {
2506
- const response = assertResponse(await destFile.context.rename(this.url, Object.assign(Object.assign(Object.assign({}, updatedOptions), { sourceLeaseAccessConditions: updatedOptions.sourceLeaseAccessConditions
2507
- ? {
2508
- sourceLeaseId: updatedOptions.sourceLeaseAccessConditions.leaseId,
2509
- }
2510
- : undefined, destinationLeaseAccessConditions: updatedOptions.destinationLeaseAccessConditions
2511
- ? {
2512
- destinationLeaseId: updatedOptions.destinationLeaseAccessConditions.leaseId,
2513
- }
2514
- : undefined, fileHttpHeaders: options.contentType
2515
- ? {
2516
- fileContentType: options.contentType,
2517
- }
2518
- : undefined }), this.shareClientConfig)));
2519
- return {
2520
- destinationFileClient: destFile,
2521
- fileRenameResponse: response,
2522
- };
2523
- });
2524
- }
2525
- }
2526
- /**
2527
- * A client that manages leases for a {@link ShareFileClient} or {@link ShareClient}.
2528
- * @see https://learn.microsoft.com/rest/api/storageservices/lease-file
2529
- * and
2530
- * @see https://learn.microsoft.com/rest/api/storageservices/lease-share
2531
- */
2532
- export class ShareLeaseClient {
2533
- /**
2534
- * Gets the lease Id.
2535
- *
2536
- * @readonly
2537
- */
2538
- get leaseId() {
2539
- return this._leaseId;
2540
- }
2541
- /**
2542
- * Gets the url.
2543
- *
2544
- * @readonly
2545
- */
2546
- get url() {
2547
- return this._url;
2548
- }
2549
- /**
2550
- * Creates an instance of ShareLeaseClient.
2551
- * @param client - The client to make the lease operation requests.
2552
- * @param leaseId - Initial proposed lease id.
2553
- */
2554
- constructor(client, leaseId) {
2555
- const clientContext = client["storageClientContext"];
2556
- if (client instanceof ShareClient) {
2557
- this.fileOrShare = clientContext.share;
2558
- this.shareClientConfig = client["shareClientConfig"];
2559
- }
2560
- else {
2561
- this.fileOrShare = clientContext.file;
2562
- this.shareClientConfig = client["shareClientConfig"];
2563
- }
2564
- this._url = client.url;
2565
- if (!leaseId) {
2566
- leaseId = randomUUID();
2567
- }
2568
- this._leaseId = leaseId;
2569
- }
2570
- /**
2571
- * Establishes and manages a lock on a file, share or share snapshot for write and delete operations.
2572
- *
2573
- * @param duration - Specifies the duration of lease in seconds. For file, the only allowed value is -1 for a lease that never expires. For share, must be -1 or between 15 to 60.
2574
- * @param options - Options for the lease management operation.
2575
- * @returns Response data for acquire lease operation.
2576
- */
2577
- async acquireLease(duration = -1, options = {}) {
2578
- return tracingClient.withSpan("ShareLeaseClient-acquireLease", options, async (updatedOptions) => {
2579
- return assertResponse(await this.fileOrShare.acquireLease(Object.assign(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig), { duration, proposedLeaseId: this._leaseId })));
2580
- });
2581
- }
2582
- /**
2583
- * To change the ID of an existing lease.
2584
- *
2585
- * @param proposedLeaseId - the proposed new lease Id.
2586
- * @param options - Options for the lease management operation.
2587
- * @returns Response data for change lease operation.
2588
- */
2589
- async changeLease(proposedLeaseId, options = {}) {
2590
- return tracingClient.withSpan("ShareLeaseClient-changeLease", options, async (updatedOptions) => {
2591
- const response = assertResponse(await this.fileOrShare.changeLease(this._leaseId, Object.assign(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig), { proposedLeaseId })));
2592
- this._leaseId = proposedLeaseId;
2593
- return response;
2594
- });
2595
- }
2596
- /**
2597
- * To free the lease if it is no longer needed so that another client may
2598
- * immediately acquire a lease.
2599
- *
2600
- * @param options - Options for the lease management operation.
2601
- * @returns Response data for release lease operation.
2602
- */
2603
- async releaseLease(options = {}) {
2604
- return tracingClient.withSpan("ShareLeaseClient-releaseLease", options, async (updatedOptions) => {
2605
- return assertResponse(await this.fileOrShare.releaseLease(this._leaseId, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
2606
- });
2607
- }
2608
- /**
2609
- * To force end the lease.
2610
- *
2611
- * @param options - Options for the lease management operation.
2612
- * @returns Response data for break lease operation.
2613
- */
2614
- async breakLease(options = {}) {
2615
- return tracingClient.withSpan("ShareLeaseClient-breakLease", options, async (updatedOptions) => {
2616
- return assertResponse(await this.fileOrShare.breakLease(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
2617
- });
2618
- }
2619
- /**
2620
- * To renew the lease. Only available for lease on share or share snapshot.
2621
- * Note that the lease may be renewed even if it has expired as long as the share has not been leased again since the expiration of that lease.
2622
- * When you renew a lease, the lease duration clock resets.
2623
- *
2624
- * @param options - Options for the lease management operation.
2625
- * @returns Response data for renew lease operation.
2626
- */
2627
- async renewLease(options = {}) {
2628
- return tracingClient.withSpan("ShareLeaseClient-renewLease", options, async (updatedOptions) => {
2629
- if (isFile(this.fileOrShare)) {
2630
- throw new RangeError("The renewLease operation is not available for lease on file.");
2631
- }
2632
- return assertResponse(await this.fileOrShare.renewLease(this._leaseId, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
2633
- });
2634
- }
2635
- }
2636
- /**
2637
- * @internal
2638
- */
2639
- function isFile(fileOrShare) {
2640
- return "renewLease" in fileOrShare;
2641
- }
2642
- //# sourceMappingURL=Clients.js.map