@azure/storage-file-share 12.33.0-beta.1 → 12.34.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 (411) hide show
  1. package/README.md +39 -0
  2. package/dist/browser/Clients.d.ts +130 -6
  3. package/dist/browser/Clients.d.ts.map +1 -1
  4. package/dist/browser/Clients.js +182 -16
  5. package/dist/browser/Clients.js.map +1 -1
  6. package/dist/browser/Pipeline.js +1 -1
  7. package/dist/browser/Pipeline.js.map +1 -1
  8. package/dist/browser/ShareServiceClient.d.ts.map +1 -1
  9. package/dist/browser/ShareServiceClient.js +1 -2
  10. package/dist/browser/ShareServiceClient.js.map +1 -1
  11. package/dist/browser/generated/api/directory/index.d.ts +1 -1
  12. package/dist/browser/generated/api/directory/index.d.ts.map +1 -1
  13. package/dist/browser/generated/api/directory/index.js +1 -1
  14. package/dist/browser/generated/api/directory/index.js.map +1 -1
  15. package/dist/browser/generated/api/directory/operations.d.ts +8 -10
  16. package/dist/browser/generated/api/directory/operations.d.ts.map +1 -1
  17. package/dist/browser/generated/api/directory/operations.js +27 -23
  18. package/dist/browser/generated/api/directory/operations.js.map +1 -1
  19. package/dist/browser/generated/api/file/index.d.ts +2 -2
  20. package/dist/browser/generated/api/file/index.d.ts.map +1 -1
  21. package/dist/browser/generated/api/file/index.js +1 -1
  22. package/dist/browser/generated/api/file/index.js.map +1 -1
  23. package/dist/browser/generated/api/file/operations.d.ts +137 -12
  24. package/dist/browser/generated/api/file/operations.d.ts.map +1 -1
  25. package/dist/browser/generated/api/file/operations.js +237 -39
  26. package/dist/browser/generated/api/file/operations.js.map +1 -1
  27. package/dist/browser/generated/api/file/options.d.ts +15 -0
  28. package/dist/browser/generated/api/file/options.d.ts.map +1 -1
  29. package/dist/browser/generated/api/file/options.js.map +1 -1
  30. package/dist/browser/generated/api/fileContext.d.ts.map +1 -1
  31. package/dist/browser/generated/api/fileContext.js +4 -3
  32. package/dist/browser/generated/api/fileContext.js.map +1 -1
  33. package/dist/browser/generated/api/service/operations.js +4 -4
  34. package/dist/browser/generated/api/service/operations.js.map +1 -1
  35. package/dist/browser/generated/api/share/index.d.ts +1 -1
  36. package/dist/browser/generated/api/share/index.d.ts.map +1 -1
  37. package/dist/browser/generated/api/share/index.js +1 -1
  38. package/dist/browser/generated/api/share/index.js.map +1 -1
  39. package/dist/browser/generated/api/share/operations.d.ts +17 -10
  40. package/dist/browser/generated/api/share/operations.d.ts.map +1 -1
  41. package/dist/browser/generated/api/share/operations.js +60 -31
  42. package/dist/browser/generated/api/share/operations.js.map +1 -1
  43. package/dist/browser/generated/api/share/options.d.ts +8 -0
  44. package/dist/browser/generated/api/share/options.d.ts.map +1 -1
  45. package/dist/browser/generated/api/share/options.js.map +1 -1
  46. package/dist/browser/generated/classic/directory/index.d.ts +3 -6
  47. package/dist/browser/generated/classic/directory/index.d.ts.map +1 -1
  48. package/dist/browser/generated/classic/directory/index.js +2 -2
  49. package/dist/browser/generated/classic/directory/index.js.map +1 -1
  50. package/dist/browser/generated/classic/file/index.d.ts +85 -8
  51. package/dist/browser/generated/classic/file/index.d.ts.map +1 -1
  52. package/dist/browser/generated/classic/file/index.js +3 -2
  53. package/dist/browser/generated/classic/file/index.js.map +1 -1
  54. package/dist/browser/generated/classic/share/index.d.ts +9 -6
  55. package/dist/browser/generated/classic/share/index.d.ts.map +1 -1
  56. package/dist/browser/generated/classic/share/index.js +2 -2
  57. package/dist/browser/generated/classic/share/index.js.map +1 -1
  58. package/dist/browser/generated/fileClient.d.ts.map +1 -1
  59. package/dist/browser/generated/fileClient.js +1 -8
  60. package/dist/browser/generated/fileClient.js.map +1 -1
  61. package/dist/browser/generated/index.d.ts +2 -2
  62. package/dist/browser/generated/index.d.ts.map +1 -1
  63. package/dist/browser/generated/index.js.map +1 -1
  64. package/dist/browser/generated/models/index.d.ts +1 -1
  65. package/dist/browser/generated/models/index.d.ts.map +1 -1
  66. package/dist/browser/generated/models/index.js.map +1 -1
  67. package/dist/browser/generated/models/models.d.ts +133 -8
  68. package/dist/browser/generated/models/models.d.ts.map +1 -1
  69. package/dist/browser/generated/models/models.js +644 -0
  70. package/dist/browser/generated/models/models.js.map +1 -1
  71. package/dist/browser/generated/static-helpers/storageCompatResponse.d.ts +1 -1
  72. package/dist/browser/generated/static-helpers/storageCompatResponse.d.ts.map +1 -1
  73. package/dist/browser/generated/static-helpers/storageCompatResponse.js +2 -2
  74. package/dist/browser/generated/static-helpers/storageCompatResponse.js.map +1 -1
  75. package/dist/browser/generated/static-helpers/urlTemplate.d.ts.map +1 -1
  76. package/dist/browser/generated/static-helpers/urlTemplate.js +4 -2
  77. package/dist/browser/generated/static-helpers/urlTemplate.js.map +1 -1
  78. package/dist/browser/generated-classic-models.d.ts +10 -0
  79. package/dist/browser/generated-classic-models.d.ts.map +1 -1
  80. package/dist/browser/generated-classic-models.js.map +1 -1
  81. package/dist/browser/generatedModels.d.ts +10 -0
  82. package/dist/browser/generatedModels.d.ts.map +1 -1
  83. package/dist/browser/generatedModels.js.map +1 -1
  84. package/dist/browser/package.json +6 -1
  85. package/dist/browser/utils/constants.d.ts +1 -0
  86. package/dist/browser/utils/constants.d.ts.map +1 -1
  87. package/dist/browser/utils/constants.js +3 -2
  88. package/dist/browser/utils/constants.js.map +1 -1
  89. package/dist/browser/utils/utils.common.d.ts +23 -0
  90. package/dist/browser/utils/utils.common.d.ts.map +1 -1
  91. package/dist/browser/utils/utils.common.js +86 -11
  92. package/dist/browser/utils/utils.common.js.map +1 -1
  93. package/dist/commonjs/Clients.d.ts +130 -6
  94. package/dist/commonjs/Clients.d.ts.map +1 -1
  95. package/dist/commonjs/Clients.js +206 -15
  96. package/dist/commonjs/Clients.js.map +2 -2
  97. package/dist/commonjs/Pipeline.js +1 -1
  98. package/dist/commonjs/Pipeline.js.map +2 -2
  99. package/dist/commonjs/ShareServiceClient.d.ts.map +1 -1
  100. package/dist/commonjs/ShareServiceClient.js +1 -2
  101. package/dist/commonjs/ShareServiceClient.js.map +2 -2
  102. package/dist/commonjs/generated/api/directory/index.d.ts +1 -1
  103. package/dist/commonjs/generated/api/directory/index.d.ts.map +1 -1
  104. package/dist/commonjs/generated/api/directory/index.js +2 -2
  105. package/dist/commonjs/generated/api/directory/index.js.map +1 -1
  106. package/dist/commonjs/generated/api/directory/operations.d.ts +8 -10
  107. package/dist/commonjs/generated/api/directory/operations.d.ts.map +1 -1
  108. package/dist/commonjs/generated/api/directory/operations.js +35 -28
  109. package/dist/commonjs/generated/api/directory/operations.js.map +2 -2
  110. package/dist/commonjs/generated/api/file/index.d.ts +2 -2
  111. package/dist/commonjs/generated/api/file/index.d.ts.map +1 -1
  112. package/dist/commonjs/generated/api/file/index.js +4 -2
  113. package/dist/commonjs/generated/api/file/index.js.map +2 -2
  114. package/dist/commonjs/generated/api/file/operations.d.ts +137 -12
  115. package/dist/commonjs/generated/api/file/operations.d.ts.map +1 -1
  116. package/dist/commonjs/generated/api/file/operations.js +162 -43
  117. package/dist/commonjs/generated/api/file/operations.js.map +2 -2
  118. package/dist/commonjs/generated/api/file/options.d.ts +15 -0
  119. package/dist/commonjs/generated/api/file/options.d.ts.map +1 -1
  120. package/dist/commonjs/generated/api/file/options.js.map +1 -1
  121. package/dist/commonjs/generated/api/fileContext.d.ts.map +1 -1
  122. package/dist/commonjs/generated/api/fileContext.js +13 -2
  123. package/dist/commonjs/generated/api/fileContext.js.map +3 -3
  124. package/dist/commonjs/generated/api/service/operations.js +4 -4
  125. package/dist/commonjs/generated/api/service/operations.js.map +1 -1
  126. package/dist/commonjs/generated/api/share/index.d.ts +1 -1
  127. package/dist/commonjs/generated/api/share/index.d.ts.map +1 -1
  128. package/dist/commonjs/generated/api/share/index.js +2 -2
  129. package/dist/commonjs/generated/api/share/index.js.map +1 -1
  130. package/dist/commonjs/generated/api/share/operations.d.ts +17 -10
  131. package/dist/commonjs/generated/api/share/operations.d.ts.map +1 -1
  132. package/dist/commonjs/generated/api/share/operations.js +50 -36
  133. package/dist/commonjs/generated/api/share/operations.js.map +2 -2
  134. package/dist/commonjs/generated/api/share/options.d.ts +8 -0
  135. package/dist/commonjs/generated/api/share/options.d.ts.map +1 -1
  136. package/dist/commonjs/generated/api/share/options.js.map +1 -1
  137. package/dist/commonjs/generated/classic/directory/index.d.ts +3 -6
  138. package/dist/commonjs/generated/classic/directory/index.d.ts.map +1 -1
  139. package/dist/commonjs/generated/classic/directory/index.js +1 -1
  140. package/dist/commonjs/generated/classic/directory/index.js.map +2 -2
  141. package/dist/commonjs/generated/classic/file/index.d.ts +85 -8
  142. package/dist/commonjs/generated/classic/file/index.d.ts.map +1 -1
  143. package/dist/commonjs/generated/classic/file/index.js +2 -1
  144. package/dist/commonjs/generated/classic/file/index.js.map +2 -2
  145. package/dist/commonjs/generated/classic/share/index.d.ts +9 -6
  146. package/dist/commonjs/generated/classic/share/index.d.ts.map +1 -1
  147. package/dist/commonjs/generated/classic/share/index.js +1 -1
  148. package/dist/commonjs/generated/classic/share/index.js.map +2 -2
  149. package/dist/commonjs/generated/fileClient.d.ts.map +1 -1
  150. package/dist/commonjs/generated/fileClient.js +1 -6
  151. package/dist/commonjs/generated/fileClient.js.map +2 -2
  152. package/dist/commonjs/generated/index.d.ts +2 -2
  153. package/dist/commonjs/generated/index.d.ts.map +1 -1
  154. package/dist/commonjs/generated/index.js.map +2 -2
  155. package/dist/commonjs/generated/models/index.d.ts +1 -1
  156. package/dist/commonjs/generated/models/index.d.ts.map +1 -1
  157. package/dist/commonjs/generated/models/index.js.map +2 -2
  158. package/dist/commonjs/generated/models/models.d.ts +133 -8
  159. package/dist/commonjs/generated/models/models.d.ts.map +1 -1
  160. package/dist/commonjs/generated/models/models.js +683 -5
  161. package/dist/commonjs/generated/models/models.js.map +2 -2
  162. package/dist/commonjs/generated/static-helpers/storageCompatResponse.d.ts +1 -1
  163. package/dist/commonjs/generated/static-helpers/storageCompatResponse.d.ts.map +1 -1
  164. package/dist/commonjs/generated/static-helpers/storageCompatResponse.js +1 -1
  165. package/dist/commonjs/generated/static-helpers/storageCompatResponse.js.map +2 -2
  166. package/dist/commonjs/generated/static-helpers/urlTemplate.d.ts.map +1 -1
  167. package/dist/commonjs/generated/static-helpers/urlTemplate.js +2 -2
  168. package/dist/commonjs/generated/static-helpers/urlTemplate.js.map +2 -2
  169. package/dist/commonjs/generated-classic-models.d.ts +10 -0
  170. package/dist/commonjs/generated-classic-models.d.ts.map +1 -1
  171. package/dist/commonjs/generated-classic-models.js.map +2 -2
  172. package/dist/commonjs/generatedModels.d.ts +10 -0
  173. package/dist/commonjs/generatedModels.d.ts.map +1 -1
  174. package/dist/commonjs/generatedModels.js.map +2 -2
  175. package/dist/commonjs/package.json +6 -1
  176. package/dist/commonjs/tsdoc-metadata.json +1 -1
  177. package/dist/commonjs/utils/constants.d.ts +1 -0
  178. package/dist/commonjs/utils/constants.d.ts.map +1 -1
  179. package/dist/commonjs/utils/constants.js +3 -2
  180. package/dist/commonjs/utils/constants.js.map +2 -2
  181. package/dist/commonjs/utils/utils.common.d.ts +23 -0
  182. package/dist/commonjs/utils/utils.common.d.ts.map +1 -1
  183. package/dist/commonjs/utils/utils.common.js +61 -11
  184. package/dist/commonjs/utils/utils.common.js.map +2 -2
  185. package/dist/esm/Clients.d.ts +130 -6
  186. package/dist/esm/Clients.d.ts.map +1 -1
  187. package/dist/esm/Clients.js +182 -16
  188. package/dist/esm/Clients.js.map +1 -1
  189. package/dist/esm/Pipeline.js +1 -1
  190. package/dist/esm/Pipeline.js.map +1 -1
  191. package/dist/esm/ShareServiceClient.d.ts.map +1 -1
  192. package/dist/esm/ShareServiceClient.js +1 -2
  193. package/dist/esm/ShareServiceClient.js.map +1 -1
  194. package/dist/esm/generated/api/directory/index.d.ts +1 -1
  195. package/dist/esm/generated/api/directory/index.d.ts.map +1 -1
  196. package/dist/esm/generated/api/directory/index.js +1 -1
  197. package/dist/esm/generated/api/directory/index.js.map +1 -1
  198. package/dist/esm/generated/api/directory/operations.d.ts +8 -10
  199. package/dist/esm/generated/api/directory/operations.d.ts.map +1 -1
  200. package/dist/esm/generated/api/directory/operations.js +27 -23
  201. package/dist/esm/generated/api/directory/operations.js.map +1 -1
  202. package/dist/esm/generated/api/file/index.d.ts +2 -2
  203. package/dist/esm/generated/api/file/index.d.ts.map +1 -1
  204. package/dist/esm/generated/api/file/index.js +1 -1
  205. package/dist/esm/generated/api/file/index.js.map +1 -1
  206. package/dist/esm/generated/api/file/operations.d.ts +137 -12
  207. package/dist/esm/generated/api/file/operations.d.ts.map +1 -1
  208. package/dist/esm/generated/api/file/operations.js +237 -39
  209. package/dist/esm/generated/api/file/operations.js.map +1 -1
  210. package/dist/esm/generated/api/file/options.d.ts +15 -0
  211. package/dist/esm/generated/api/file/options.d.ts.map +1 -1
  212. package/dist/esm/generated/api/file/options.js.map +1 -1
  213. package/dist/esm/generated/api/fileContext.d.ts.map +1 -1
  214. package/dist/esm/generated/api/fileContext.js +4 -3
  215. package/dist/esm/generated/api/fileContext.js.map +1 -1
  216. package/dist/esm/generated/api/service/operations.js +4 -4
  217. package/dist/esm/generated/api/service/operations.js.map +1 -1
  218. package/dist/esm/generated/api/share/index.d.ts +1 -1
  219. package/dist/esm/generated/api/share/index.d.ts.map +1 -1
  220. package/dist/esm/generated/api/share/index.js +1 -1
  221. package/dist/esm/generated/api/share/index.js.map +1 -1
  222. package/dist/esm/generated/api/share/operations.d.ts +17 -10
  223. package/dist/esm/generated/api/share/operations.d.ts.map +1 -1
  224. package/dist/esm/generated/api/share/operations.js +60 -31
  225. package/dist/esm/generated/api/share/operations.js.map +1 -1
  226. package/dist/esm/generated/api/share/options.d.ts +8 -0
  227. package/dist/esm/generated/api/share/options.d.ts.map +1 -1
  228. package/dist/esm/generated/api/share/options.js.map +1 -1
  229. package/dist/esm/generated/classic/directory/index.d.ts +3 -6
  230. package/dist/esm/generated/classic/directory/index.d.ts.map +1 -1
  231. package/dist/esm/generated/classic/directory/index.js +2 -2
  232. package/dist/esm/generated/classic/directory/index.js.map +1 -1
  233. package/dist/esm/generated/classic/file/index.d.ts +85 -8
  234. package/dist/esm/generated/classic/file/index.d.ts.map +1 -1
  235. package/dist/esm/generated/classic/file/index.js +3 -2
  236. package/dist/esm/generated/classic/file/index.js.map +1 -1
  237. package/dist/esm/generated/classic/share/index.d.ts +9 -6
  238. package/dist/esm/generated/classic/share/index.d.ts.map +1 -1
  239. package/dist/esm/generated/classic/share/index.js +2 -2
  240. package/dist/esm/generated/classic/share/index.js.map +1 -1
  241. package/dist/esm/generated/fileClient.d.ts.map +1 -1
  242. package/dist/esm/generated/fileClient.js +1 -8
  243. package/dist/esm/generated/fileClient.js.map +1 -1
  244. package/dist/esm/generated/index.d.ts +2 -2
  245. package/dist/esm/generated/index.d.ts.map +1 -1
  246. package/dist/esm/generated/index.js.map +1 -1
  247. package/dist/esm/generated/models/index.d.ts +1 -1
  248. package/dist/esm/generated/models/index.d.ts.map +1 -1
  249. package/dist/esm/generated/models/index.js.map +1 -1
  250. package/dist/esm/generated/models/models.d.ts +133 -8
  251. package/dist/esm/generated/models/models.d.ts.map +1 -1
  252. package/dist/esm/generated/models/models.js +644 -0
  253. package/dist/esm/generated/models/models.js.map +1 -1
  254. package/dist/esm/generated/static-helpers/storageCompatResponse.d.ts +1 -1
  255. package/dist/esm/generated/static-helpers/storageCompatResponse.d.ts.map +1 -1
  256. package/dist/esm/generated/static-helpers/storageCompatResponse.js +2 -2
  257. package/dist/esm/generated/static-helpers/storageCompatResponse.js.map +1 -1
  258. package/dist/esm/generated/static-helpers/urlTemplate.d.ts.map +1 -1
  259. package/dist/esm/generated/static-helpers/urlTemplate.js +4 -2
  260. package/dist/esm/generated/static-helpers/urlTemplate.js.map +1 -1
  261. package/dist/esm/generated-classic-models.d.ts +10 -0
  262. package/dist/esm/generated-classic-models.d.ts.map +1 -1
  263. package/dist/esm/generated-classic-models.js.map +1 -1
  264. package/dist/esm/generatedModels.d.ts +10 -0
  265. package/dist/esm/generatedModels.d.ts.map +1 -1
  266. package/dist/esm/generatedModels.js.map +1 -1
  267. package/dist/esm/package.json +6 -1
  268. package/dist/esm/utils/constants.d.ts +1 -0
  269. package/dist/esm/utils/constants.d.ts.map +1 -1
  270. package/dist/esm/utils/constants.js +3 -2
  271. package/dist/esm/utils/constants.js.map +1 -1
  272. package/dist/esm/utils/utils.common.d.ts +23 -0
  273. package/dist/esm/utils/utils.common.d.ts.map +1 -1
  274. package/dist/esm/utils/utils.common.js +86 -11
  275. package/dist/esm/utils/utils.common.js.map +1 -1
  276. package/dist/react-native/Clients.d.ts +130 -6
  277. package/dist/react-native/Clients.d.ts.map +1 -1
  278. package/dist/react-native/Clients.js +182 -16
  279. package/dist/react-native/Clients.js.map +1 -1
  280. package/dist/react-native/Pipeline.js +1 -1
  281. package/dist/react-native/Pipeline.js.map +1 -1
  282. package/dist/react-native/ShareServiceClient.d.ts.map +1 -1
  283. package/dist/react-native/ShareServiceClient.js +1 -2
  284. package/dist/react-native/ShareServiceClient.js.map +1 -1
  285. package/dist/react-native/generated/api/directory/index.d.ts +1 -1
  286. package/dist/react-native/generated/api/directory/index.d.ts.map +1 -1
  287. package/dist/react-native/generated/api/directory/index.js +1 -1
  288. package/dist/react-native/generated/api/directory/index.js.map +1 -1
  289. package/dist/react-native/generated/api/directory/operations.d.ts +8 -10
  290. package/dist/react-native/generated/api/directory/operations.d.ts.map +1 -1
  291. package/dist/react-native/generated/api/directory/operations.js +27 -23
  292. package/dist/react-native/generated/api/directory/operations.js.map +1 -1
  293. package/dist/react-native/generated/api/file/index.d.ts +2 -2
  294. package/dist/react-native/generated/api/file/index.d.ts.map +1 -1
  295. package/dist/react-native/generated/api/file/index.js +1 -1
  296. package/dist/react-native/generated/api/file/index.js.map +1 -1
  297. package/dist/react-native/generated/api/file/operations.d.ts +137 -12
  298. package/dist/react-native/generated/api/file/operations.d.ts.map +1 -1
  299. package/dist/react-native/generated/api/file/operations.js +237 -39
  300. package/dist/react-native/generated/api/file/operations.js.map +1 -1
  301. package/dist/react-native/generated/api/file/options.d.ts +15 -0
  302. package/dist/react-native/generated/api/file/options.d.ts.map +1 -1
  303. package/dist/react-native/generated/api/file/options.js.map +1 -1
  304. package/dist/react-native/generated/api/fileContext.d.ts.map +1 -1
  305. package/dist/react-native/generated/api/fileContext.js +4 -3
  306. package/dist/react-native/generated/api/fileContext.js.map +1 -1
  307. package/dist/react-native/generated/api/service/operations.js +4 -4
  308. package/dist/react-native/generated/api/service/operations.js.map +1 -1
  309. package/dist/react-native/generated/api/share/index.d.ts +1 -1
  310. package/dist/react-native/generated/api/share/index.d.ts.map +1 -1
  311. package/dist/react-native/generated/api/share/index.js +1 -1
  312. package/dist/react-native/generated/api/share/index.js.map +1 -1
  313. package/dist/react-native/generated/api/share/operations.d.ts +17 -10
  314. package/dist/react-native/generated/api/share/operations.d.ts.map +1 -1
  315. package/dist/react-native/generated/api/share/operations.js +60 -31
  316. package/dist/react-native/generated/api/share/operations.js.map +1 -1
  317. package/dist/react-native/generated/api/share/options.d.ts +8 -0
  318. package/dist/react-native/generated/api/share/options.d.ts.map +1 -1
  319. package/dist/react-native/generated/api/share/options.js.map +1 -1
  320. package/dist/react-native/generated/classic/directory/index.d.ts +3 -6
  321. package/dist/react-native/generated/classic/directory/index.d.ts.map +1 -1
  322. package/dist/react-native/generated/classic/directory/index.js +2 -2
  323. package/dist/react-native/generated/classic/directory/index.js.map +1 -1
  324. package/dist/react-native/generated/classic/file/index.d.ts +85 -8
  325. package/dist/react-native/generated/classic/file/index.d.ts.map +1 -1
  326. package/dist/react-native/generated/classic/file/index.js +3 -2
  327. package/dist/react-native/generated/classic/file/index.js.map +1 -1
  328. package/dist/react-native/generated/classic/share/index.d.ts +9 -6
  329. package/dist/react-native/generated/classic/share/index.d.ts.map +1 -1
  330. package/dist/react-native/generated/classic/share/index.js +2 -2
  331. package/dist/react-native/generated/classic/share/index.js.map +1 -1
  332. package/dist/react-native/generated/fileClient.d.ts.map +1 -1
  333. package/dist/react-native/generated/fileClient.js +1 -8
  334. package/dist/react-native/generated/fileClient.js.map +1 -1
  335. package/dist/react-native/generated/index.d.ts +2 -2
  336. package/dist/react-native/generated/index.d.ts.map +1 -1
  337. package/dist/react-native/generated/index.js.map +1 -1
  338. package/dist/react-native/generated/models/index.d.ts +1 -1
  339. package/dist/react-native/generated/models/index.d.ts.map +1 -1
  340. package/dist/react-native/generated/models/index.js.map +1 -1
  341. package/dist/react-native/generated/models/models.d.ts +133 -8
  342. package/dist/react-native/generated/models/models.d.ts.map +1 -1
  343. package/dist/react-native/generated/models/models.js +644 -0
  344. package/dist/react-native/generated/models/models.js.map +1 -1
  345. package/dist/react-native/generated/static-helpers/storageCompatResponse.d.ts +1 -1
  346. package/dist/react-native/generated/static-helpers/storageCompatResponse.d.ts.map +1 -1
  347. package/dist/react-native/generated/static-helpers/storageCompatResponse.js +2 -2
  348. package/dist/react-native/generated/static-helpers/storageCompatResponse.js.map +1 -1
  349. package/dist/react-native/generated/static-helpers/urlTemplate.d.ts.map +1 -1
  350. package/dist/react-native/generated/static-helpers/urlTemplate.js +4 -2
  351. package/dist/react-native/generated/static-helpers/urlTemplate.js.map +1 -1
  352. package/dist/react-native/generated-classic-models.d.ts +10 -0
  353. package/dist/react-native/generated-classic-models.d.ts.map +1 -1
  354. package/dist/react-native/generated-classic-models.js.map +1 -1
  355. package/dist/react-native/generatedModels.d.ts +10 -0
  356. package/dist/react-native/generatedModels.d.ts.map +1 -1
  357. package/dist/react-native/generatedModels.js.map +1 -1
  358. package/dist/react-native/package.json +6 -1
  359. package/dist/react-native/utils/constants.d.ts +1 -0
  360. package/dist/react-native/utils/constants.d.ts.map +1 -1
  361. package/dist/react-native/utils/constants.js +3 -2
  362. package/dist/react-native/utils/constants.js.map +1 -1
  363. package/dist/react-native/utils/utils.common.d.ts +23 -0
  364. package/dist/react-native/utils/utils.common.d.ts.map +1 -1
  365. package/dist/react-native/utils/utils.common.js +86 -11
  366. package/dist/react-native/utils/utils.common.js.map +1 -1
  367. package/package.json +13 -17
  368. package/dist/browser/generated/static-helpers/platform-types-browser.d.mts +0 -6
  369. package/dist/browser/generated/static-helpers/platform-types-browser.d.mts.map +0 -1
  370. package/dist/browser/generated/static-helpers/platform-types-browser.mjs +0 -2
  371. package/dist/browser/generated/static-helpers/platform-types-browser.mjs.map +0 -1
  372. package/dist/browser/generated/static-helpers/platform-types.d.ts +0 -6
  373. package/dist/browser/generated/static-helpers/platform-types.d.ts.map +0 -1
  374. package/dist/browser/generated/static-helpers/platform-types.js +0 -2
  375. package/dist/browser/generated/static-helpers/platform-types.js.map +0 -1
  376. package/dist/browser/generated/static-helpers/serialization/get-binary-stream-response.d.ts +0 -13
  377. package/dist/browser/generated/static-helpers/serialization/get-binary-stream-response.d.ts.map +0 -1
  378. package/dist/browser/generated/static-helpers/serialization/get-binary-stream-response.js +0 -15
  379. package/dist/browser/generated/static-helpers/serialization/get-binary-stream-response.js.map +0 -1
  380. package/dist/commonjs/generated/static-helpers/platform-types.d.ts +0 -8
  381. package/dist/commonjs/generated/static-helpers/platform-types.d.ts.map +0 -1
  382. package/dist/commonjs/generated/static-helpers/platform-types.js +0 -16
  383. package/dist/commonjs/generated/static-helpers/platform-types.js.map +0 -7
  384. package/dist/commonjs/generated/static-helpers/serialization/get-binary-stream-response.d.ts +0 -13
  385. package/dist/commonjs/generated/static-helpers/serialization/get-binary-stream-response.d.ts.map +0 -1
  386. package/dist/commonjs/generated/static-helpers/serialization/get-binary-stream-response.js +0 -35
  387. package/dist/commonjs/generated/static-helpers/serialization/get-binary-stream-response.js.map +0 -7
  388. package/dist/esm/generated/static-helpers/platform-types.d.ts +0 -8
  389. package/dist/esm/generated/static-helpers/platform-types.d.ts.map +0 -1
  390. package/dist/esm/generated/static-helpers/platform-types.js +0 -4
  391. package/dist/esm/generated/static-helpers/platform-types.js.map +0 -1
  392. package/dist/esm/generated/static-helpers/serialization/get-binary-stream-response.d.ts +0 -13
  393. package/dist/esm/generated/static-helpers/serialization/get-binary-stream-response.d.ts.map +0 -1
  394. package/dist/esm/generated/static-helpers/serialization/get-binary-stream-response.js +0 -17
  395. package/dist/esm/generated/static-helpers/serialization/get-binary-stream-response.js.map +0 -1
  396. package/dist/react-native/generated/static-helpers/platform-types-browser.d.mts +0 -6
  397. package/dist/react-native/generated/static-helpers/platform-types-browser.d.mts.map +0 -1
  398. package/dist/react-native/generated/static-helpers/platform-types-browser.mjs +0 -2
  399. package/dist/react-native/generated/static-helpers/platform-types-browser.mjs.map +0 -1
  400. package/dist/react-native/generated/static-helpers/platform-types.d.ts +0 -6
  401. package/dist/react-native/generated/static-helpers/platform-types.d.ts.map +0 -1
  402. package/dist/react-native/generated/static-helpers/platform-types.js +0 -2
  403. package/dist/react-native/generated/static-helpers/platform-types.js.map +0 -1
  404. package/dist/react-native/generated/static-helpers/serialization/get-binary-stream-response-browser.d.mts +0 -13
  405. package/dist/react-native/generated/static-helpers/serialization/get-binary-stream-response-browser.d.mts.map +0 -1
  406. package/dist/react-native/generated/static-helpers/serialization/get-binary-stream-response-browser.mjs +0 -15
  407. package/dist/react-native/generated/static-helpers/serialization/get-binary-stream-response-browser.mjs.map +0 -1
  408. package/dist/react-native/generated/static-helpers/serialization/get-binary-stream-response.d.ts +0 -2
  409. package/dist/react-native/generated/static-helpers/serialization/get-binary-stream-response.d.ts.map +0 -1
  410. package/dist/react-native/generated/static-helpers/serialization/get-binary-stream-response.js +0 -2
  411. package/dist/react-native/generated/static-helpers/serialization/get-binary-stream-response.js.map +0 -1
@@ -4,7 +4,7 @@ import { isTokenCredential } from "@azure/core-auth";
4
4
  import { isNodeLike } from "@azure/core-util";
5
5
  import { isPipelineLike, newPipeline } from "./Pipeline.js";
6
6
  import { DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS, DEFAULT_HIGH_LEVEL_CONCURRENCY, FILE_MAX_SIZE_BYTES, FILE_RANGE_MAX_SIZE_BYTES, URLConstants, } from "./utils/constants.js";
7
- import { appendToURLPath, setURLParameter, truncatedISO8061Date, extractConnectionStringParts, getShareNameAndPathFromUrl, appendToURLQuery, httpAuthorizationToString, setURLPath, setURLQueries, EscapePath, ConvertInternalResponseOfListFiles, ConvertInternalResponseOfListHandles, assertResponse, adjustResponse, removeEmptyString, extractShareFileRangeItems, asSharePermission, parseOctalFileMode, toOctalFileMode, setUploadChecksumParameters, } from "./utils/utils.common.js";
7
+ import { appendToURLPath, setURLParameter, truncatedISO8061Date, extractConnectionStringParts, getShareNameAndPathFromUrl, appendToURLQuery, httpAuthorizationToString, setURLPath, setURLQueries, EscapePath, ConvertInternalResponseOfListFiles, ConvertInternalResponseOfListHandles, assertResponse, adjustResponse, removeEmptyString, extractShareFileRangeItems, asSharePermission, parseOctalFileMode, toOctalFileMode, setUploadChecksumParameters, assertNotFileIdAddressed, getFileIdFromURL, setFileIdOnShareURL, StringEncodedToString, } from "./utils/utils.common.js";
8
8
  import { Credential } from "@azure/storage-common";
9
9
  import { StorageSharedKeyCredential } from "@azure/storage-common";
10
10
  import { AnonymousCredential } from "@azure/storage-common";
@@ -170,6 +170,31 @@ export class ShareClient extends StorageClient {
170
170
  get rootDirectoryClient() {
171
171
  return this.getDirectoryClient("");
172
172
  }
173
+ /**
174
+ * Creates a {@link ShareFileClient} that addresses a file in an SMB file share by its file ID instead of its path.
175
+ * Only {@link ShareFileClient.getProperties}, {@link ShareFileClient.getFileLinks} and
176
+ * {@link ShareFileClient.withShareSnapshot} are supported on it; its other methods throw an error
177
+ * without sending a request.
178
+ *
179
+ * @param fileId - The file ID of the file, such as the `fileId` returned by {@link ShareFileClient.getProperties}.
180
+ * A `RangeError` is thrown when it's empty or only whitespace.
181
+ * @returns A ShareFileClient that addresses the file by its file ID.
182
+ */
183
+ getShareFileClient(fileId) {
184
+ return new ShareFileClient(setFileIdOnShareURL(this.url, fileId), this.pipeline, this.shareClientConfig);
185
+ }
186
+ /**
187
+ * Creates a {@link ShareDirectoryClient} that addresses a directory in an SMB file share by its file ID instead of
188
+ * its path. Only {@link ShareDirectoryClient.getProperties} is supported on it; its other methods throw an error
189
+ * without sending a request.
190
+ *
191
+ * @param fileId - The file ID of the directory, such as the `fileId` returned by {@link ShareDirectoryClient.getProperties}.
192
+ * A `RangeError` is thrown when it's empty or only whitespace.
193
+ * @returns A ShareDirectoryClient that addresses the directory by its file ID.
194
+ */
195
+ getShareDirectoryClient(fileId) {
196
+ return new ShareDirectoryClient(setFileIdOnShareURL(this.url, fileId), this.pipeline, this.shareClientConfig);
197
+ }
173
198
  /**
174
199
  * Creates a new subdirectory under this share.
175
200
  * @see https://learn.microsoft.com/rest/api/storageservices/create-directory
@@ -321,7 +346,7 @@ export class ShareClient extends StorageClient {
321
346
  */
322
347
  async delete(options = {}) {
323
348
  return tracingClient.withSpan("ShareClient-delete", options, async (updatedOptions) => {
324
- return assertResponse(adjustResponse(await this.context.delete({
349
+ return assertResponse(adjustResponse(await this.context.deleteShare({
325
350
  ...updatedOptions,
326
351
  ...updatedOptions.leaseAccessConditions,
327
352
  ...this.shareClientConfig,
@@ -671,6 +696,7 @@ export class ShareDirectoryClient extends StorageClient {
671
696
  _shareName;
672
697
  _path;
673
698
  _name;
699
+ _fileId;
674
700
  shareClientConfig;
675
701
  /**
676
702
  * The share name corresponding to this directory client
@@ -679,17 +705,24 @@ export class ShareDirectoryClient extends StorageClient {
679
705
  return this._shareName;
680
706
  }
681
707
  /**
682
- * The full path of the directory
708
+ * The full path of the directory. Empty when the client addresses the directory by its file ID.
683
709
  */
684
710
  get path() {
685
711
  return this._path;
686
712
  }
687
713
  /**
688
- * The name of the directory
714
+ * The name of the directory. Empty when the client addresses the directory by its file ID.
689
715
  */
690
716
  get name() {
691
717
  return this._name;
692
718
  }
719
+ /**
720
+ * The file ID the client addresses the directory by, such as for a client created with
721
+ * {@link ShareClient.getShareDirectoryClient}. Undefined when the client addresses the directory by its path.
722
+ */
723
+ get fileId() {
724
+ return this._fileId;
725
+ }
693
726
  constructor(url, credentialOrPipeline,
694
727
  // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.
695
728
  /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */
@@ -712,6 +745,11 @@ export class ShareDirectoryClient extends StorageClient {
712
745
  shareName: this._shareName,
713
746
  path: this._path,
714
747
  } = getShareNameAndPathFromUrl(this.url));
748
+ this._fileId = getFileIdFromURL(this.url);
749
+ if (this._fileId) {
750
+ this._name = "";
751
+ this._path = "";
752
+ }
715
753
  this.shareClientConfig = options;
716
754
  this.context = this.storageClientContext.directory;
717
755
  }
@@ -723,6 +761,7 @@ export class ShareDirectoryClient extends StorageClient {
723
761
  * @returns Response data for the Directory operation.
724
762
  */
725
763
  async create(options = {}) {
764
+ assertNotFileIdAddressed(this._fileId, "create");
726
765
  if (!options.fileAttributes) {
727
766
  options = validateAndSetDefaultsForFileAndDirectoryCreateCommonOptions(options);
728
767
  }
@@ -764,6 +803,7 @@ export class ShareDirectoryClient extends StorageClient {
764
803
  * @param options -
765
804
  */
766
805
  async createIfNotExists(options = {}) {
806
+ assertNotFileIdAddressed(this._fileId, "createIfNotExists");
767
807
  return tracingClient.withSpan("ShareDirectoryClient-createIfNotExists", options, async (updatedOptions) => {
768
808
  try {
769
809
  const res = await this.create(updatedOptions);
@@ -793,6 +833,7 @@ export class ShareDirectoryClient extends StorageClient {
793
833
  * existing values will be preserved.
794
834
  */
795
835
  async setProperties(properties = {}) {
836
+ assertNotFileIdAddressed(this._fileId, "setProperties");
796
837
  properties = validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions(properties);
797
838
  return tracingClient.withSpan("ShareDirectoryClient-setProperties", properties, async (updatedOptions) => {
798
839
  const response = adjustResponse(await this.context.setProperties({
@@ -848,6 +889,7 @@ export class ShareDirectoryClient extends StorageClient {
848
889
  * ```
849
890
  */
850
891
  getDirectoryClient(subDirectoryName) {
892
+ assertNotFileIdAddressed(this._fileId, "getDirectoryClient");
851
893
  return new ShareDirectoryClient(appendToURLPath(this.url, EscapePath(subDirectoryName)), this.pipeline, this.shareClientConfig);
852
894
  }
853
895
  /**
@@ -859,6 +901,7 @@ export class ShareDirectoryClient extends StorageClient {
859
901
  * @returns Directory create response data and the corresponding DirectoryClient instance.
860
902
  */
861
903
  async createSubdirectory(directoryName, options = {}) {
904
+ assertNotFileIdAddressed(this._fileId, "createSubdirectory");
862
905
  return tracingClient.withSpan("ShareDirectoryClient-createSubdirectory", options, async (updatedOptions) => {
863
906
  const directoryClient = this.getDirectoryClient(directoryName);
864
907
  const directoryCreateResponse = await directoryClient.create(updatedOptions);
@@ -878,6 +921,7 @@ export class ShareDirectoryClient extends StorageClient {
878
921
  * @returns Directory deletion response data.
879
922
  */
880
923
  async deleteSubdirectory(directoryName, options = {}) {
924
+ assertNotFileIdAddressed(this._fileId, "deleteSubdirectory");
881
925
  return tracingClient.withSpan("ShareDirectoryClient-deleteSubdirectory", options, async (updatedOptions) => {
882
926
  const directoryClient = this.getDirectoryClient(directoryName);
883
927
  return directoryClient.delete(updatedOptions);
@@ -893,6 +937,7 @@ export class ShareDirectoryClient extends StorageClient {
893
937
  * @returns File creation response data and the corresponding file client.
894
938
  */
895
939
  async createFile(fileName, size, options = {}) {
940
+ assertNotFileIdAddressed(this._fileId, "createFile");
896
941
  return tracingClient.withSpan("ShareDirectoryClient-createFile", options, async (updatedOptions) => {
897
942
  const fileClient = this.getFileClient(fileName);
898
943
  const fileCreateResponse = await fileClient.create(size, updatedOptions);
@@ -921,6 +966,7 @@ export class ShareDirectoryClient extends StorageClient {
921
966
  * @returns File deletion response data.
922
967
  */
923
968
  async deleteFile(fileName, options = {}) {
969
+ assertNotFileIdAddressed(this._fileId, "deleteFile");
924
970
  return tracingClient.withSpan("ShareDirectoryClient-deleteFile", options, async (updatedOptions) => {
925
971
  const fileClient = this.getFileClient(fileName);
926
972
  return fileClient.delete(updatedOptions);
@@ -964,6 +1010,7 @@ export class ShareDirectoryClient extends StorageClient {
964
1010
  // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.
965
1011
  /* eslint-disable-next-line @azure/azure-sdk/ts-naming-subclients */
966
1012
  getFileClient(fileName) {
1013
+ assertNotFileIdAddressed(this._fileId, "getFileClient");
967
1014
  return new ShareFileClient(appendToURLPath(this.url, EscapePath(fileName)), this.pipeline, this.shareClientConfig);
968
1015
  }
969
1016
  /**
@@ -976,6 +1023,7 @@ export class ShareDirectoryClient extends StorageClient {
976
1023
  * @param options - options to Exists operation.
977
1024
  */
978
1025
  async exists(options = {}) {
1026
+ assertNotFileIdAddressed(this._fileId, "exists");
979
1027
  return tracingClient.withSpan("ShareDirectoryClient-exists", options, async (updatedOptions) => {
980
1028
  try {
981
1029
  await this.getProperties({ ...updatedOptions, ...this.shareClientConfig });
@@ -1027,8 +1075,9 @@ export class ShareDirectoryClient extends StorageClient {
1027
1075
  * @returns Response data for the Directory Delete operation.
1028
1076
  */
1029
1077
  async delete(options = {}) {
1078
+ assertNotFileIdAddressed(this._fileId, "delete");
1030
1079
  return tracingClient.withSpan("ShareDirectoryClient-delete", options, async (updatedOptions) => {
1031
- return assertResponse(adjustResponse(await this.context.delete({ ...updatedOptions, ...this.shareClientConfig })));
1080
+ return assertResponse(adjustResponse(await this.context.deleteDirectory({ ...updatedOptions, ...this.shareClientConfig })));
1032
1081
  });
1033
1082
  }
1034
1083
  /**
@@ -1039,6 +1088,7 @@ export class ShareDirectoryClient extends StorageClient {
1039
1088
  * @param options -
1040
1089
  */
1041
1090
  async deleteIfExists(options = {}) {
1091
+ assertNotFileIdAddressed(this._fileId, "deleteIfExists");
1042
1092
  return tracingClient.withSpan("ShareDirectoryClient-deleteIfExists", options, async (updatedOptions) => {
1043
1093
  try {
1044
1094
  const res = await this.delete(updatedOptions);
@@ -1070,6 +1120,7 @@ export class ShareDirectoryClient extends StorageClient {
1070
1120
  * @returns Response data for the Directory Set Metadata operation.
1071
1121
  */
1072
1122
  async setMetadata(metadata, options = {}) {
1123
+ assertNotFileIdAddressed(this._fileId, "setMetadata");
1073
1124
  return tracingClient.withSpan("ShareDirectoryClient-setMetadata", options, async (updatedOptions) => {
1074
1125
  const metadataHeaders = metadataToRawHeaders(metadata);
1075
1126
  return assertResponse(adjustResponse(await this.context.setMetadata({
@@ -1111,8 +1162,7 @@ export class ShareDirectoryClient extends StorageClient {
1111
1162
  if (options.prefix === "") {
1112
1163
  options.prefix = undefined;
1113
1164
  }
1114
- let marker;
1115
- for await (const listFilesAndDirectoriesResponse of this.iterateFilesAndDirectoriesSegments(marker, options)) {
1165
+ for await (const listFilesAndDirectoriesResponse of this.iterateFilesAndDirectoriesSegments(undefined, options)) {
1116
1166
  for (const file of listFilesAndDirectoriesResponse.segment.fileItems) {
1117
1167
  yield { kind: "file", ...file };
1118
1168
  }
@@ -1271,6 +1321,7 @@ export class ShareDirectoryClient extends StorageClient {
1271
1321
  * @returns An asyncIterableIterator that supports paging.
1272
1322
  */
1273
1323
  listFilesAndDirectories(options = {}) {
1324
+ assertNotFileIdAddressed(this._fileId, "listFilesAndDirectories");
1274
1325
  const include = [];
1275
1326
  if (options.includeTimestamps) {
1276
1327
  include.push("Timestamps");
@@ -1372,8 +1423,7 @@ export class ShareDirectoryClient extends StorageClient {
1372
1423
  * @param options - Options to list handles operation.
1373
1424
  */
1374
1425
  async *listHandleItems(options = {}) {
1375
- let marker;
1376
- for await (const listHandlesResponse of this.iterateHandleSegments(marker, options)) {
1426
+ for await (const listHandlesResponse of this.iterateHandleSegments(undefined, options)) {
1377
1427
  if (listHandlesResponse.handleList) {
1378
1428
  for (const handle of listHandlesResponse.handleList) {
1379
1429
  yield handle;
@@ -1505,6 +1555,7 @@ export class ShareDirectoryClient extends StorageClient {
1505
1555
  * An asyncIterableIterator that supports paging.
1506
1556
  */
1507
1557
  listHandles(options = {}) {
1558
+ assertNotFileIdAddressed(this._fileId, "listHandles");
1508
1559
  // an AsyncIterableIterator to iterate over handles
1509
1560
  const iter = this.listHandleItems(options);
1510
1561
  return {
@@ -1600,6 +1651,7 @@ export class ShareDirectoryClient extends StorageClient {
1600
1651
  * @param options -
1601
1652
  */
1602
1653
  async forceCloseAllHandles(options = {}) {
1654
+ assertNotFileIdAddressed(this._fileId, "forceCloseAllHandles");
1603
1655
  return tracingClient.withSpan("ShareDirectoryClient-forceCloseAllHandles", options, async (updatedOptions) => {
1604
1656
  let handlesClosed = 0;
1605
1657
  let numberOfHandlesFailedToClose = 0;
@@ -1631,6 +1683,7 @@ export class ShareDirectoryClient extends StorageClient {
1631
1683
  * @param options -
1632
1684
  */
1633
1685
  async forceCloseHandle(handleId, options = {}) {
1686
+ assertNotFileIdAddressed(this._fileId, "forceCloseHandle");
1634
1687
  return tracingClient.withSpan("ShareDirectoryClient-forceCloseHandle", options, async (updatedOptions) => {
1635
1688
  if (handleId === "*") {
1636
1689
  throw new RangeError(`Parameter handleID should be a specified handle ID. Use forceCloseHandlesSegment() to close all handles.`);
@@ -1676,6 +1729,7 @@ export class ShareDirectoryClient extends StorageClient {
1676
1729
  * ```
1677
1730
  */
1678
1731
  async rename(destinationPath, options = {}) {
1732
+ assertNotFileIdAddressed(this._fileId, "rename");
1679
1733
  const split = destinationPath.split("?");
1680
1734
  let destinationUrl;
1681
1735
  if (split.length === 2) {
@@ -1722,6 +1776,7 @@ export class ShareFileClient extends StorageClient {
1722
1776
  _shareName;
1723
1777
  _path;
1724
1778
  _name;
1779
+ _fileId;
1725
1780
  shareClientConfig;
1726
1781
  /**
1727
1782
  * The share name corresponding to this file client
@@ -1730,17 +1785,24 @@ export class ShareFileClient extends StorageClient {
1730
1785
  return this._shareName;
1731
1786
  }
1732
1787
  /**
1733
- * The full path of the file
1788
+ * The full path of the file. Empty when the client addresses the file by its file ID.
1734
1789
  */
1735
1790
  get path() {
1736
1791
  return this._path;
1737
1792
  }
1738
1793
  /**
1739
- * The name of the file
1794
+ * The name of the file. Empty when the client addresses the file by its file ID.
1740
1795
  */
1741
1796
  get name() {
1742
1797
  return this._name;
1743
1798
  }
1799
+ /**
1800
+ * The file ID the client addresses the file by, such as for a client created with
1801
+ * {@link ShareClient.getShareFileClient}. Undefined when the client addresses the file by its path.
1802
+ */
1803
+ get fileId() {
1804
+ return this._fileId;
1805
+ }
1744
1806
  constructor(url, credentialOrPipeline,
1745
1807
  // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.
1746
1808
  /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */
@@ -1763,6 +1825,11 @@ export class ShareFileClient extends StorageClient {
1763
1825
  shareName: this._shareName,
1764
1826
  path: this._path,
1765
1827
  } = getShareNameAndPathFromUrl(this.url));
1828
+ this._fileId = getFileIdFromURL(this.url);
1829
+ if (this._fileId) {
1830
+ this._name = "";
1831
+ this._path = "";
1832
+ }
1766
1833
  this.shareClientConfig = options;
1767
1834
  this.context = this.storageClientContext.file;
1768
1835
  }
@@ -1814,6 +1881,7 @@ export class ShareFileClient extends StorageClient {
1814
1881
  * ```
1815
1882
  */
1816
1883
  async create(size, options = {}) {
1884
+ assertNotFileIdAddressed(this._fileId, "create");
1817
1885
  if (size < 0 || size > FILE_MAX_SIZE_BYTES) {
1818
1886
  throw new RangeError(`File size must >= 0 and < ${FILE_MAX_SIZE_BYTES}.`);
1819
1887
  }
@@ -1936,6 +2004,7 @@ export class ShareFileClient extends StorageClient {
1936
2004
  * ```
1937
2005
  */
1938
2006
  async download(offset = 0, count, options = {}) {
2007
+ assertNotFileIdAddressed(this._fileId, "download");
1939
2008
  return tracingClient.withSpan("ShareFileClient-download", options, async (updatedOptions) => {
1940
2009
  let contentChecksumAlgorithm = options.contentChecksumAlgorithm ??
1941
2010
  this.shareClientConfig?.downloadContentChecksumAlgorithm;
@@ -2043,6 +2112,7 @@ export class ShareFileClient extends StorageClient {
2043
2112
  * @param options - options to Exists operation.
2044
2113
  */
2045
2114
  async exists(options = {}) {
2115
+ assertNotFileIdAddressed(this._fileId, "exists");
2046
2116
  return tracingClient.withSpan("ShareFileClient-exists", options, async (updatedOptions) => {
2047
2117
  try {
2048
2118
  await this.getProperties(updatedOptions);
@@ -2091,6 +2161,67 @@ export class ShareFileClient extends StorageClient {
2091
2161
  return assertResponse(wrappedRes);
2092
2162
  });
2093
2163
  }
2164
+ /**
2165
+ * Returns the hard links of the file, along with all user-defined metadata, standard HTTP properties,
2166
+ * and system properties for the file. It does not return the content of the file.
2167
+ *
2168
+ * Only supported when the client addresses the file by its file ID, such as a client created with
2169
+ * {@link ShareClient.getShareFileClient}; otherwise it throws an error before sending a request. Addressing by
2170
+ * file ID is supported only on SMB file shares, where a file has a single link: its own name in the directory
2171
+ * that contains it.
2172
+ *
2173
+ * @param options - Options to File Get File Links operation.
2174
+ * @returns Response data for the File Get File Links operation.
2175
+ */
2176
+ async getFileLinks(options = {}) {
2177
+ if (!this._fileId) {
2178
+ throw new Error("getFileLinks is only supported when the client addresses the resource by file ID.");
2179
+ }
2180
+ return tracingClient.withSpan("ShareFileClient-getFileLinks", options, async (updatedOptions) => {
2181
+ const response = adjustResponse(await this.context.getHardLinks({
2182
+ ...updatedOptions,
2183
+ ...updatedOptions.leaseAccessConditions,
2184
+ ...this.shareClientConfig,
2185
+ }));
2186
+ // The file's content properties come in x-ms-content-* headers; Content-Type describes the XML body.
2187
+ const { fileContentType, fileContentLength, fileContentMD5, fileContentEncoding, fileContentLanguage, fileCacheControl, fileContentDisposition, serverEncrypted, hardLinks, _response: rawResponse, ...properties } = response;
2188
+ const headers = {
2189
+ ...properties,
2190
+ contentType: fileContentType,
2191
+ contentLength: fileContentLength,
2192
+ contentMD5: fileContentMD5,
2193
+ contentEncoding: fileContentEncoding,
2194
+ contentLanguage: fileContentLanguage,
2195
+ cacheControl: fileCacheControl,
2196
+ contentDisposition: fileContentDisposition,
2197
+ isServerEncrypted: serverEncrypted,
2198
+ metadata: rawHeadersToMetadata(rawResponse.headers.rawHeaders()),
2199
+ posixProperties: {
2200
+ fileMode: parseOctalFileMode(response.fileMode),
2201
+ fileType: response.nfsFileType,
2202
+ owner: response.owner,
2203
+ group: response.group,
2204
+ linkCount: response.linkCount,
2205
+ },
2206
+ leaseDuration: response.leaseDuration
2207
+ ? response.leaseDuration
2208
+ : undefined,
2209
+ leaseState: response.leaseState ? response.leaseState : undefined,
2210
+ leaseStatus: response.leaseStatus ? response.leaseStatus : undefined,
2211
+ };
2212
+ // An empty <HardLinks/> body deserializes without the list.
2213
+ const links = (hardLinks ?? []).map((link) => ({
2214
+ name: StringEncodedToString(link.fileName),
2215
+ parentId: link.parentId,
2216
+ }));
2217
+ const wrappedRes = {
2218
+ ...headers,
2219
+ links,
2220
+ _response: { ...rawResponse, parsedHeaders: headers, parsedBody: links },
2221
+ };
2222
+ return assertResponse(wrappedRes);
2223
+ });
2224
+ }
2094
2225
  /**
2095
2226
  * Sets properties on the file.
2096
2227
  * @see https://learn.microsoft.com/rest/api/storageservices/set-file-properties
@@ -2101,6 +2232,7 @@ export class ShareFileClient extends StorageClient {
2101
2232
  * existing values will be preserved.
2102
2233
  */
2103
2234
  async setProperties(properties = {}) {
2235
+ assertNotFileIdAddressed(this._fileId, "setProperties");
2104
2236
  properties = validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions(properties);
2105
2237
  properties.fileHttpHeaders = properties.fileHttpHeaders || {};
2106
2238
  return tracingClient.withSpan("ShareFileClient-setProperties", properties, async (updatedOptions) => {
@@ -2150,8 +2282,9 @@ export class ShareFileClient extends StorageClient {
2150
2282
  * @returns Response data for the File Delete operation.
2151
2283
  */
2152
2284
  async delete(options = {}) {
2285
+ assertNotFileIdAddressed(this._fileId, "delete");
2153
2286
  return tracingClient.withSpan("ShareFileClient-delete", options, async (updatedOptions) => {
2154
- return assertResponse(adjustResponse(await this.context.delete({
2287
+ return assertResponse(adjustResponse(await this.context.deleteFile({
2155
2288
  ...updatedOptions,
2156
2289
  ...updatedOptions.leaseAccessConditions,
2157
2290
  ...this.shareClientConfig,
@@ -2175,6 +2308,7 @@ export class ShareFileClient extends StorageClient {
2175
2308
  * @param options -
2176
2309
  */
2177
2310
  async deleteIfExists(options = {}) {
2311
+ assertNotFileIdAddressed(this._fileId, "deleteIfExists");
2178
2312
  return tracingClient.withSpan("ShareFileClient-deleteIfExists", options, async (updatedOptions) => {
2179
2313
  try {
2180
2314
  const res = await this.delete(updatedOptions);
@@ -2210,6 +2344,7 @@ export class ShareFileClient extends StorageClient {
2210
2344
  * @returns Response data for the File Set HTTP Headers operation.
2211
2345
  */
2212
2346
  async setHttpHeaders(fileHttpHeaders = {}, options = {}) {
2347
+ assertNotFileIdAddressed(this._fileId, "setHttpHeaders");
2213
2348
  // FileAttributes, filePermission, createTime, lastWriteTime will all be preserved
2214
2349
  options = validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions(options);
2215
2350
  return tracingClient.withSpan("ShareFileClient-setHTTPHeaders", options, async (updatedOptions) => {
@@ -2253,6 +2388,7 @@ export class ShareFileClient extends StorageClient {
2253
2388
  * @returns Response data for the File Set HTTP Headers operation.
2254
2389
  */
2255
2390
  async resize(length, options = {}) {
2391
+ assertNotFileIdAddressed(this._fileId, "resize");
2256
2392
  if (length < 0) {
2257
2393
  throw new RangeError(`Size cannot less than 0 when resizing file.`);
2258
2394
  }
@@ -2297,6 +2433,7 @@ export class ShareFileClient extends StorageClient {
2297
2433
  * @returns Response data for the File Set Metadata operation.
2298
2434
  */
2299
2435
  async setMetadata(metadata = {}, options = {}) {
2436
+ assertNotFileIdAddressed(this._fileId, "setMetadata");
2300
2437
  return tracingClient.withSpan("ShareFileClient-setMetadata", options, async (updatedOptions) => {
2301
2438
  const metadataHeaders = metadataToRawHeaders(metadata);
2302
2439
  return assertResponse(adjustResponse(await this.context.setMetadata({
@@ -2350,6 +2487,7 @@ export class ShareFileClient extends StorageClient {
2350
2487
  * ```
2351
2488
  */
2352
2489
  async uploadRange(body, offset, contentLength, options = {}) {
2490
+ assertNotFileIdAddressed(this._fileId, "uploadRange");
2353
2491
  return tracingClient.withSpan("ShareFileClient-uploadRange", options, async (updatedOptions) => {
2354
2492
  if (offset < 0) {
2355
2493
  throw new RangeError(`offset must be >= 0`);
@@ -2385,6 +2523,7 @@ export class ShareFileClient extends StorageClient {
2385
2523
  * @param options - Options to configure File - Upload Range from URL operation.
2386
2524
  */
2387
2525
  async uploadRangeFromURL(sourceURL, sourceOffset, destOffset, count, options = {}) {
2526
+ assertNotFileIdAddressed(this._fileId, "uploadRangeFromURL");
2388
2527
  return tracingClient.withSpan("ShareFileClient-uploadRangeFromURL", options, async (updatedOptions) => {
2389
2528
  if (sourceOffset < 0 || destOffset < 0) {
2390
2529
  throw new RangeError(`sourceOffset and destOffset must be >= 0`);
@@ -2418,6 +2557,7 @@ export class ShareFileClient extends StorageClient {
2418
2557
  * @param options - Options to File Clear Range operation.
2419
2558
  */
2420
2559
  async clearRange(offset, contentLength, options = {}) {
2560
+ assertNotFileIdAddressed(this._fileId, "clearRange");
2421
2561
  return tracingClient.withSpan("ShareFileClient-clearRange", options, async (updatedOptions) => {
2422
2562
  if (offset < 0 || contentLength <= 0) {
2423
2563
  throw new RangeError(`offset must >= 0 and contentLength must be > 0`);
@@ -2438,6 +2578,7 @@ export class ShareFileClient extends StorageClient {
2438
2578
  * @param options - Options to File Get range List operation.
2439
2579
  */
2440
2580
  async getRangeList(options = {}) {
2581
+ assertNotFileIdAddressed(this._fileId, "getRangeList");
2441
2582
  return tracingClient.withSpan("ShareFileClient-getRangeList", options, async (updatedOptions) => {
2442
2583
  const originalResponse = assertResponse(adjustResponse(await this.context.getRangeList({
2443
2584
  ...updatedOptions,
@@ -2466,6 +2607,7 @@ export class ShareFileClient extends StorageClient {
2466
2607
  * @param options -
2467
2608
  */
2468
2609
  async getRangeListDiff(prevShareSnapshot, options = {}) {
2610
+ assertNotFileIdAddressed(this._fileId, "getRangeListDiff");
2469
2611
  return tracingClient.withSpan("ShareFileClient-getRangeListDiff", options, async (updatedOptions) => {
2470
2612
  return assertResponse(adjustResponse(await this.context.getRangeList({
2471
2613
  ...updatedOptions,
@@ -2488,6 +2630,7 @@ export class ShareFileClient extends StorageClient {
2488
2630
  * @returns An asyncIterableIterator that supports paging.
2489
2631
  */
2490
2632
  listRanges(options = {}) {
2633
+ assertNotFileIdAddressed(this._fileId, "listRanges");
2491
2634
  const iter = this.listRangeItems(options);
2492
2635
  return {
2493
2636
  /**
@@ -2526,6 +2669,7 @@ export class ShareFileClient extends StorageClient {
2526
2669
  * @returns An asyncIterableIterator that supports paging.
2527
2670
  */
2528
2671
  listRangesDiff(prevShareSnapshot, options = {}) {
2672
+ assertNotFileIdAddressed(this._fileId, "listRangesDiff");
2529
2673
  const iter = this.listRangeItems({ ...options, prevShareSnapshot });
2530
2674
  return {
2531
2675
  /**
@@ -2614,6 +2758,7 @@ export class ShareFileClient extends StorageClient {
2614
2758
  * @param options - Options to File Start Copy operation.
2615
2759
  */
2616
2760
  async startCopyFromURL(copySource, options = {}) {
2761
+ assertNotFileIdAddressed(this._fileId, "startCopyFromURL");
2617
2762
  return tracingClient.withSpan("ShareFileClient-startCopyFromURL", options, async (updatedOptions) => {
2618
2763
  return assertResponse(adjustResponse(await this.context.startCopy(copySource, {
2619
2764
  ...updatedOptions,
@@ -2638,6 +2783,7 @@ export class ShareFileClient extends StorageClient {
2638
2783
  * @param options - Options to File Abort Copy From URL operation.
2639
2784
  */
2640
2785
  async abortCopyFromURL(copyId, options = {}) {
2786
+ assertNotFileIdAddressed(this._fileId, "abortCopyFromURL");
2641
2787
  return tracingClient.withSpan("ShareFileClient-abortCopyFromURL", options, async (updatedOptions) => {
2642
2788
  return assertResponse(adjustResponse(await this.context.abortCopy(copyId, {
2643
2789
  ...updatedOptions,
@@ -2654,6 +2800,7 @@ export class ShareFileClient extends StorageClient {
2654
2800
  * @param options -
2655
2801
  */
2656
2802
  async uploadData(data, options = {}) {
2803
+ assertNotFileIdAddressed(this._fileId, "uploadData");
2657
2804
  return tracingClient.withSpan("ShareFileClient-uploadData", options, async (updatedOptions) => {
2658
2805
  if (isNodeLike) {
2659
2806
  let buffer;
@@ -2686,6 +2833,7 @@ export class ShareFileClient extends StorageClient {
2686
2833
  * @param options -
2687
2834
  */
2688
2835
  async uploadSeekableBlob(blobFactory, size, options = {}) {
2836
+ assertNotFileIdAddressed(this._fileId, "uploadSeekableBlob");
2689
2837
  return tracingClient.withSpan("ShareFileClient-UploadSeekableBlob", options, async (updatedOptions) => {
2690
2838
  return this.uploadSeekableInternal(blobFactory, size, updatedOptions);
2691
2839
  });
@@ -2700,6 +2848,7 @@ export class ShareFileClient extends StorageClient {
2700
2848
  * @param options -
2701
2849
  */
2702
2850
  async uploadFile(filePath, options = {}) {
2851
+ assertNotFileIdAddressed(this._fileId, "uploadFile");
2703
2852
  return tracingClient.withSpan("ShareFileClient-uploadFile", options, async (updatedOptions) => {
2704
2853
  const size = (await fsStat(filePath)).size;
2705
2854
  return this.uploadSeekableInternal((offset, count) => {
@@ -2725,6 +2874,7 @@ export class ShareFileClient extends StorageClient {
2725
2874
  * @param options -
2726
2875
  */
2727
2876
  async uploadResetableStream(streamFactory, size, options = {}) {
2877
+ assertNotFileIdAddressed(this._fileId, "uploadResetableStream");
2728
2878
  return tracingClient.withSpan("ShareFileClient-uploadResetableStream", options, async (updatedOptions) => {
2729
2879
  return this.uploadSeekableInternal((offset, count) => {
2730
2880
  return () => streamFactory(offset, count);
@@ -2788,6 +2938,7 @@ export class ShareFileClient extends StorageClient {
2788
2938
  });
2789
2939
  }
2790
2940
  async downloadToBuffer(bufferOrOffset, offsetOrCount, countOrOptions, optOptions = {}) {
2941
+ assertNotFileIdAddressed(this._fileId, "downloadToBuffer");
2791
2942
  let buffer = undefined;
2792
2943
  let offset;
2793
2944
  let count;
@@ -2840,7 +2991,7 @@ export class ShareFileClient extends StorageClient {
2840
2991
  catch (error) {
2841
2992
  throw new Error(`Unable to allocate a buffer of size: ${count} bytes. Please try passing your own Buffer to ` +
2842
2993
  'the "downloadToBuffer method or try using other methods like "download" or "downloadToFile".' +
2843
- `\t ${error.message}`);
2994
+ `\t ${error.message}`, { cause: error });
2844
2995
  }
2845
2996
  }
2846
2997
  if (buffer.length < count) {
@@ -2899,6 +3050,7 @@ export class ShareFileClient extends StorageClient {
2899
3050
  * @param options -
2900
3051
  */
2901
3052
  async uploadStream(stream, size, bufferSize, maxBuffers, options = {}) {
3053
+ assertNotFileIdAddressed(this._fileId, "uploadStream");
2902
3054
  return tracingClient.withSpan("ShareFileClient-uploadStream", options, async (updatedOptions) => {
2903
3055
  if (!options.fileHttpHeaders) {
2904
3056
  options.fileHttpHeaders = {};
@@ -2960,6 +3112,7 @@ export class ShareFileClient extends StorageClient {
2960
3112
  * at the specified path.
2961
3113
  */
2962
3114
  async downloadToFile(filePath, offset = 0, count, options = {}) {
3115
+ assertNotFileIdAddressed(this._fileId, "downloadToFile");
2963
3116
  return tracingClient.withSpan("ShareFileClient-downloadToFile", options, async (updatedOptions) => {
2964
3117
  const response = await this.download(offset, count, updatedOptions);
2965
3118
  if (response.readableStreamBody) {
@@ -3031,8 +3184,7 @@ export class ShareFileClient extends StorageClient {
3031
3184
  * @param options - Options to list handles operation.
3032
3185
  */
3033
3186
  async *listHandleItems(options = {}) {
3034
- let marker;
3035
- for await (const listHandlesResponse of this.iterateHandleSegments(marker, options)) {
3187
+ for await (const listHandlesResponse of this.iterateHandleSegments(undefined, options)) {
3036
3188
  if (listHandlesResponse.handleList) {
3037
3189
  for (const handle of listHandlesResponse.handleList) {
3038
3190
  yield handle;
@@ -3051,6 +3203,7 @@ export class ShareFileClient extends StorageClient {
3051
3203
  * An asyncIterableIterator that supports paging.
3052
3204
  */
3053
3205
  listHandles(options = {}) {
3206
+ assertNotFileIdAddressed(this._fileId, "listHandles");
3054
3207
  // an AsyncIterableIterator to iterate over handles
3055
3208
  const iter = this.listHandleItems(options);
3056
3209
  return {
@@ -3109,6 +3262,7 @@ export class ShareFileClient extends StorageClient {
3109
3262
  * @param options - Options to force close handles operation.
3110
3263
  */
3111
3264
  async forceCloseAllHandles(options = {}) {
3265
+ assertNotFileIdAddressed(this._fileId, "forceCloseAllHandles");
3112
3266
  return tracingClient.withSpan("ShareFileClient-forceCloseAllHandles", options, async (updatedOptions) => {
3113
3267
  let handlesClosed = 0;
3114
3268
  let numberOfHandlesFailedToClose = 0;
@@ -3138,6 +3292,7 @@ export class ShareFileClient extends StorageClient {
3138
3292
  * @param FileForceCloseHandlesOptions - Options to force close handles operation.
3139
3293
  */
3140
3294
  async forceCloseHandle(handleId, options = {}) {
3295
+ assertNotFileIdAddressed(this._fileId, "forceCloseHandle");
3141
3296
  return tracingClient.withSpan("ShareFileClient-forceCloseHandle", options, async (updatedOptions) => {
3142
3297
  if (handleId === "*") {
3143
3298
  throw new RangeError(`Parameter handleID should be a specified handle ID. Use forceCloseHandlesSegment() to close all handles.`);
@@ -3159,6 +3314,7 @@ export class ShareFileClient extends StorageClient {
3159
3314
  * @param options - Options to create hard link operation.
3160
3315
  */
3161
3316
  async createHardLink(targetFile, options = {}) {
3317
+ assertNotFileIdAddressed(this._fileId, "createHardLink");
3162
3318
  return tracingClient.withSpan("ShareFileClient-createHardLink", options, async (updatedOptions) => {
3163
3319
  const response = adjustResponse(await this.context.createHardLink(targetFile, {
3164
3320
  ...updatedOptions,
@@ -3187,6 +3343,7 @@ export class ShareFileClient extends StorageClient {
3187
3343
  * @param options - Options to create hard link operation.
3188
3344
  */
3189
3345
  async createSymbolicLink(linkText, options = {}) {
3346
+ assertNotFileIdAddressed(this._fileId, "createSymbolicLink");
3190
3347
  return tracingClient.withSpan("ShareFileClient-createSymbolicLink", options, async (updatedOptions) => {
3191
3348
  const { metadata, ...restOptions } = updatedOptions;
3192
3349
  const metadataHeaders = metadataToRawHeaders(metadata);
@@ -3215,6 +3372,7 @@ export class ShareFileClient extends StorageClient {
3215
3372
  * @param options - Options to get symbolic link operation.
3216
3373
  */
3217
3374
  async getSymbolicLink(options = {}) {
3375
+ assertNotFileIdAddressed(this._fileId, "getSymbolicLink");
3218
3376
  return tracingClient.withSpan("ShareFileClient-getSymbolicLink", options, async (updatedOptions) => {
3219
3377
  return assertResponse(adjustResponse(await this.context.getSymbolicLink({
3220
3378
  ...updatedOptions,
@@ -3229,6 +3387,7 @@ export class ShareFileClient extends StorageClient {
3229
3387
  * @returns A new ShareLeaseClient object for managing leases on the file.
3230
3388
  */
3231
3389
  getShareLeaseClient(proposeLeaseId) {
3390
+ assertNotFileIdAddressed(this._fileId, "getShareLeaseClient");
3232
3391
  return new ShareLeaseClient(this, proposeLeaseId);
3233
3392
  }
3234
3393
  /**
@@ -3243,6 +3402,7 @@ export class ShareFileClient extends StorageClient {
3243
3402
  * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
3244
3403
  */
3245
3404
  generateSasUrl(options) {
3405
+ assertNotFileIdAddressed(this._fileId, "generateSasUrl");
3246
3406
  if (!(this.credential instanceof StorageSharedKeyCredential)) {
3247
3407
  throw RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
3248
3408
  }
@@ -3266,6 +3426,7 @@ export class ShareFileClient extends StorageClient {
3266
3426
  */
3267
3427
  /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/
3268
3428
  generateSasStringToSign(options) {
3429
+ assertNotFileIdAddressed(this._fileId, "generateSasStringToSign");
3269
3430
  if (!(this.credential instanceof StorageSharedKeyCredential)) {
3270
3431
  throw RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
3271
3432
  }
@@ -3287,6 +3448,7 @@ export class ShareFileClient extends StorageClient {
3287
3448
  * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
3288
3449
  */
3289
3450
  generateUserDelegationSasUrl(options, userDelegationKey) {
3451
+ assertNotFileIdAddressed(this._fileId, "generateUserDelegationSasUrl");
3290
3452
  const sas = generateFileSASQueryParameters({
3291
3453
  shareName: this.shareName,
3292
3454
  filePath: this.path,
@@ -3306,6 +3468,7 @@ export class ShareFileClient extends StorageClient {
3306
3468
  * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
3307
3469
  */
3308
3470
  generateUserDelegationStringToSign(options, userDelegationKey) {
3471
+ assertNotFileIdAddressed(this._fileId, "generateUserDelegationStringToSign");
3309
3472
  return generateFileSASQueryParametersInternal({
3310
3473
  shareName: this.shareName,
3311
3474
  filePath: this.path,
@@ -3347,6 +3510,7 @@ export class ShareFileClient extends StorageClient {
3347
3510
  * ```
3348
3511
  */
3349
3512
  async rename(destinationPath, options = {}) {
3513
+ assertNotFileIdAddressed(this._fileId, "rename");
3350
3514
  const split = destinationPath.split("?");
3351
3515
  let destinationUrl;
3352
3516
  if (split.length === 2) {
@@ -3412,7 +3576,8 @@ export class ShareLeaseClient {
3412
3576
  }
3413
3577
  /**
3414
3578
  * Creates an instance of ShareLeaseClient.
3415
- * @param client - The client to make the lease operation requests.
3579
+ * @param client - The client to make the lease operation requests. A {@link ShareFileClient} that
3580
+ * addresses its file by file ID isn't supported and makes the constructor throw an error.
3416
3581
  * @param leaseId - Initial proposed lease id.
3417
3582
  */
3418
3583
  constructor(client, leaseId) {
@@ -3422,6 +3587,7 @@ export class ShareLeaseClient {
3422
3587
  this.shareClientConfig = client["shareClientConfig"];
3423
3588
  }
3424
3589
  else {
3590
+ assertNotFileIdAddressed(client.fileId, "ShareLeaseClient");
3425
3591
  this.fileOrShare = clientContext.file;
3426
3592
  this.shareClientConfig = client["shareClientConfig"];
3427
3593
  }