@azure/storage-file-share 12.29.0-beta.1 → 12.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (328) hide show
  1. package/dist/browser/AccountSASPermissions.js +32 -34
  2. package/dist/browser/AccountSASPermissions.js.map +1 -1
  3. package/dist/browser/AccountSASResourceTypes.js +12 -14
  4. package/dist/browser/AccountSASResourceTypes.js.map +1 -1
  5. package/dist/browser/AccountSASServices.js +16 -18
  6. package/dist/browser/AccountSASServices.js.map +1 -1
  7. package/dist/browser/AccountSASSignatureValues.d.ts +1 -1
  8. package/dist/browser/AccountSASSignatureValues.d.ts.map +1 -1
  9. package/dist/browser/AccountSASSignatureValues.js.map +1 -1
  10. package/dist/browser/Clients.d.ts +3 -2
  11. package/dist/browser/Clients.d.ts.map +1 -1
  12. package/dist/browser/Clients.js +555 -242
  13. package/dist/browser/Clients.js.map +1 -1
  14. package/dist/browser/FileSASPermissions.js +16 -18
  15. package/dist/browser/FileSASPermissions.js.map +1 -1
  16. package/dist/browser/FileSASSignatureValues.d.ts +1 -1
  17. package/dist/browser/FileSASSignatureValues.d.ts.map +1 -1
  18. package/dist/browser/FileSASSignatureValues.js.map +1 -1
  19. package/dist/browser/FileSystemAttributes.js +43 -45
  20. package/dist/browser/FileSystemAttributes.js.map +1 -1
  21. package/dist/browser/Pipeline.d.ts +2 -4
  22. package/dist/browser/Pipeline.d.ts.map +1 -1
  23. package/dist/browser/Pipeline.js +28 -19
  24. package/dist/browser/Pipeline.js.map +1 -1
  25. package/dist/browser/SASQueryParameters.js +70 -0
  26. package/dist/browser/SASQueryParameters.js.map +1 -1
  27. package/dist/browser/ShareClientInternal.js +1 -0
  28. package/dist/browser/ShareClientInternal.js.map +1 -1
  29. package/dist/browser/ShareSASPermissions.js +20 -22
  30. package/dist/browser/ShareSASPermissions.js.map +1 -1
  31. package/dist/browser/ShareServiceClient.d.ts +1 -1
  32. package/dist/browser/ShareServiceClient.d.ts.map +1 -1
  33. package/dist/browser/ShareServiceClient.js +66 -50
  34. package/dist/browser/ShareServiceClient.js.map +1 -1
  35. package/dist/browser/StorageClient.d.ts +2 -2
  36. package/dist/browser/StorageClient.d.ts.map +1 -1
  37. package/dist/browser/StorageClient.js +23 -0
  38. package/dist/browser/StorageClient.js.map +1 -1
  39. package/dist/browser/StorageContextClient.js +1 -1
  40. package/dist/browser/StorageContextClient.js.map +1 -1
  41. package/dist/browser/generated/src/operations/directory.js +1 -0
  42. package/dist/browser/generated/src/operations/directory.js.map +1 -1
  43. package/dist/browser/generated/src/operations/file.js +1 -0
  44. package/dist/browser/generated/src/operations/file.js.map +1 -1
  45. package/dist/browser/generated/src/operations/service.js +1 -0
  46. package/dist/browser/generated/src/operations/service.js.map +1 -1
  47. package/dist/browser/generated/src/operations/share.js +1 -0
  48. package/dist/browser/generated/src/operations/share.js.map +1 -1
  49. package/dist/browser/generated/src/storageClient.js +15 -4
  50. package/dist/browser/generated/src/storageClient.js.map +1 -1
  51. package/dist/browser/index-browser.d.mts.map +1 -1
  52. package/dist/browser/index-browser.mjs.map +1 -1
  53. package/dist/browser/index.d.ts +1 -7
  54. package/dist/browser/index.js +1 -7
  55. package/dist/browser/utils/Batch.js +29 -21
  56. package/dist/browser/utils/Batch.js.map +1 -1
  57. package/dist/browser/utils/BufferScheduler.js +70 -44
  58. package/dist/browser/utils/BufferScheduler.js.map +1 -1
  59. package/dist/browser/utils/RetriableReadableStream.js +70 -62
  60. package/dist/browser/utils/RetriableReadableStream.js.map +1 -1
  61. package/dist/browser/utils/constants.d.ts.map +1 -1
  62. package/dist/browser/utils/constants.js +1 -1
  63. package/dist/browser/utils/constants.js.map +1 -1
  64. package/dist/browser/utils/utils.common.js +31 -15
  65. package/dist/browser/utils/utils.common.js.map +1 -1
  66. package/dist/commonjs/AccountSASPermissions.js +32 -34
  67. package/dist/commonjs/AccountSASPermissions.js.map +1 -1
  68. package/dist/commonjs/AccountSASResourceTypes.js +12 -14
  69. package/dist/commonjs/AccountSASResourceTypes.js.map +1 -1
  70. package/dist/commonjs/AccountSASServices.js +16 -18
  71. package/dist/commonjs/AccountSASServices.js.map +1 -1
  72. package/dist/commonjs/AccountSASSignatureValues.d.ts +1 -1
  73. package/dist/commonjs/AccountSASSignatureValues.d.ts.map +1 -1
  74. package/dist/commonjs/AccountSASSignatureValues.js.map +1 -1
  75. package/dist/commonjs/Clients.d.ts +3 -2
  76. package/dist/commonjs/Clients.d.ts.map +1 -1
  77. package/dist/commonjs/Clients.js +567 -254
  78. package/dist/commonjs/Clients.js.map +1 -1
  79. package/dist/commonjs/FileDownloadResponse.js +2 -0
  80. package/dist/commonjs/FileDownloadResponse.js.map +1 -1
  81. package/dist/commonjs/FileSASPermissions.js +16 -18
  82. package/dist/commonjs/FileSASPermissions.js.map +1 -1
  83. package/dist/commonjs/FileSASSignatureValues.d.ts +1 -1
  84. package/dist/commonjs/FileSASSignatureValues.d.ts.map +1 -1
  85. package/dist/commonjs/FileSASSignatureValues.js.map +1 -1
  86. package/dist/commonjs/FileSystemAttributes.js +43 -45
  87. package/dist/commonjs/FileSystemAttributes.js.map +1 -1
  88. package/dist/commonjs/Pipeline.d.ts +2 -4
  89. package/dist/commonjs/Pipeline.d.ts.map +1 -1
  90. package/dist/commonjs/Pipeline.js +39 -30
  91. package/dist/commonjs/Pipeline.js.map +1 -1
  92. package/dist/commonjs/SASQueryParameters.js +70 -0
  93. package/dist/commonjs/SASQueryParameters.js.map +1 -1
  94. package/dist/commonjs/ShareClientInternal.js +1 -0
  95. package/dist/commonjs/ShareClientInternal.js.map +1 -1
  96. package/dist/commonjs/ShareSASPermissions.js +20 -22
  97. package/dist/commonjs/ShareSASPermissions.js.map +1 -1
  98. package/dist/commonjs/ShareServiceClient.d.ts +1 -1
  99. package/dist/commonjs/ShareServiceClient.d.ts.map +1 -1
  100. package/dist/commonjs/ShareServiceClient.js +72 -56
  101. package/dist/commonjs/ShareServiceClient.js.map +1 -1
  102. package/dist/commonjs/StorageClient.d.ts +2 -2
  103. package/dist/commonjs/StorageClient.d.ts.map +1 -1
  104. package/dist/commonjs/StorageClient.js +23 -0
  105. package/dist/commonjs/StorageClient.js.map +1 -1
  106. package/dist/commonjs/StorageContextClient.js +1 -1
  107. package/dist/commonjs/StorageContextClient.js.map +1 -1
  108. package/dist/commonjs/generated/src/operations/directory.js +1 -0
  109. package/dist/commonjs/generated/src/operations/directory.js.map +1 -1
  110. package/dist/commonjs/generated/src/operations/file.js +1 -0
  111. package/dist/commonjs/generated/src/operations/file.js.map +1 -1
  112. package/dist/commonjs/generated/src/operations/service.js +1 -0
  113. package/dist/commonjs/generated/src/operations/service.js.map +1 -1
  114. package/dist/commonjs/generated/src/operations/share.js +1 -0
  115. package/dist/commonjs/generated/src/operations/share.js.map +1 -1
  116. package/dist/commonjs/generated/src/storageClient.js +15 -4
  117. package/dist/commonjs/generated/src/storageClient.js.map +1 -1
  118. package/dist/commonjs/index.d.ts +1 -9
  119. package/dist/commonjs/index.d.ts.map +1 -1
  120. package/dist/commonjs/index.js +13 -18
  121. package/dist/commonjs/index.js.map +1 -1
  122. package/dist/commonjs/tsdoc-metadata.json +11 -11
  123. package/dist/commonjs/utils/Batch.js +29 -21
  124. package/dist/commonjs/utils/Batch.js.map +1 -1
  125. package/dist/commonjs/utils/BufferScheduler.js +70 -44
  126. package/dist/commonjs/utils/BufferScheduler.js.map +1 -1
  127. package/dist/commonjs/utils/RetriableReadableStream.js +70 -62
  128. package/dist/commonjs/utils/RetriableReadableStream.js.map +1 -1
  129. package/dist/commonjs/utils/constants.d.ts.map +1 -1
  130. package/dist/commonjs/utils/constants.js +1 -1
  131. package/dist/commonjs/utils/constants.js.map +1 -1
  132. package/dist/commonjs/utils/utils.common.js +31 -15
  133. package/dist/commonjs/utils/utils.common.js.map +1 -1
  134. package/dist/commonjs/utils/utils.d.ts +1 -1
  135. package/dist/commonjs/utils/utils.d.ts.map +1 -1
  136. package/dist/commonjs/utils/utils.js +5 -5
  137. package/dist/commonjs/utils/utils.js.map +1 -1
  138. package/dist/esm/AccountSASPermissions.js +32 -34
  139. package/dist/esm/AccountSASPermissions.js.map +1 -1
  140. package/dist/esm/AccountSASResourceTypes.js +12 -14
  141. package/dist/esm/AccountSASResourceTypes.js.map +1 -1
  142. package/dist/esm/AccountSASServices.js +16 -18
  143. package/dist/esm/AccountSASServices.js.map +1 -1
  144. package/dist/esm/AccountSASSignatureValues.d.ts +1 -1
  145. package/dist/esm/AccountSASSignatureValues.d.ts.map +1 -1
  146. package/dist/esm/AccountSASSignatureValues.js.map +1 -1
  147. package/dist/esm/Clients.d.ts +3 -2
  148. package/dist/esm/Clients.d.ts.map +1 -1
  149. package/dist/esm/Clients.js +555 -242
  150. package/dist/esm/Clients.js.map +1 -1
  151. package/dist/esm/FileDownloadResponse.js +2 -0
  152. package/dist/esm/FileDownloadResponse.js.map +1 -1
  153. package/dist/esm/FileSASPermissions.js +16 -18
  154. package/dist/esm/FileSASPermissions.js.map +1 -1
  155. package/dist/esm/FileSASSignatureValues.d.ts +1 -1
  156. package/dist/esm/FileSASSignatureValues.d.ts.map +1 -1
  157. package/dist/esm/FileSASSignatureValues.js.map +1 -1
  158. package/dist/esm/FileSystemAttributes.js +43 -45
  159. package/dist/esm/FileSystemAttributes.js.map +1 -1
  160. package/dist/esm/Pipeline.d.ts +2 -4
  161. package/dist/esm/Pipeline.d.ts.map +1 -1
  162. package/dist/esm/Pipeline.js +28 -19
  163. package/dist/esm/Pipeline.js.map +1 -1
  164. package/dist/esm/SASQueryParameters.js +70 -0
  165. package/dist/esm/SASQueryParameters.js.map +1 -1
  166. package/dist/esm/ShareClientInternal.js +1 -0
  167. package/dist/esm/ShareClientInternal.js.map +1 -1
  168. package/dist/esm/ShareSASPermissions.js +20 -22
  169. package/dist/esm/ShareSASPermissions.js.map +1 -1
  170. package/dist/esm/ShareServiceClient.d.ts +1 -1
  171. package/dist/esm/ShareServiceClient.d.ts.map +1 -1
  172. package/dist/esm/ShareServiceClient.js +66 -50
  173. package/dist/esm/ShareServiceClient.js.map +1 -1
  174. package/dist/esm/StorageClient.d.ts +2 -2
  175. package/dist/esm/StorageClient.d.ts.map +1 -1
  176. package/dist/esm/StorageClient.js +23 -0
  177. package/dist/esm/StorageClient.js.map +1 -1
  178. package/dist/esm/StorageContextClient.js +1 -1
  179. package/dist/esm/StorageContextClient.js.map +1 -1
  180. package/dist/esm/generated/src/operations/directory.js +1 -0
  181. package/dist/esm/generated/src/operations/directory.js.map +1 -1
  182. package/dist/esm/generated/src/operations/file.js +1 -0
  183. package/dist/esm/generated/src/operations/file.js.map +1 -1
  184. package/dist/esm/generated/src/operations/service.js +1 -0
  185. package/dist/esm/generated/src/operations/service.js.map +1 -1
  186. package/dist/esm/generated/src/operations/share.js +1 -0
  187. package/dist/esm/generated/src/operations/share.js.map +1 -1
  188. package/dist/esm/generated/src/storageClient.js +15 -4
  189. package/dist/esm/generated/src/storageClient.js.map +1 -1
  190. package/dist/esm/index.d.ts +1 -9
  191. package/dist/esm/index.d.ts.map +1 -1
  192. package/dist/esm/index.js +1 -9
  193. package/dist/esm/index.js.map +1 -1
  194. package/dist/esm/utils/Batch.js +29 -21
  195. package/dist/esm/utils/Batch.js.map +1 -1
  196. package/dist/esm/utils/BufferScheduler.js +70 -44
  197. package/dist/esm/utils/BufferScheduler.js.map +1 -1
  198. package/dist/esm/utils/RetriableReadableStream.js +70 -62
  199. package/dist/esm/utils/RetriableReadableStream.js.map +1 -1
  200. package/dist/esm/utils/constants.d.ts.map +1 -1
  201. package/dist/esm/utils/constants.js +1 -1
  202. package/dist/esm/utils/constants.js.map +1 -1
  203. package/dist/esm/utils/utils.common.js +31 -15
  204. package/dist/esm/utils/utils.common.js.map +1 -1
  205. package/dist/esm/utils/utils.d.ts +1 -1
  206. package/dist/esm/utils/utils.d.ts.map +1 -1
  207. package/dist/esm/utils/utils.js +2 -2
  208. package/dist/esm/utils/utils.js.map +1 -1
  209. package/dist/react-native/AccountSASPermissions.js +32 -34
  210. package/dist/react-native/AccountSASPermissions.js.map +1 -1
  211. package/dist/react-native/AccountSASResourceTypes.js +12 -14
  212. package/dist/react-native/AccountSASResourceTypes.js.map +1 -1
  213. package/dist/react-native/AccountSASServices.js +16 -18
  214. package/dist/react-native/AccountSASServices.js.map +1 -1
  215. package/dist/react-native/AccountSASSignatureValues.d.ts +1 -1
  216. package/dist/react-native/AccountSASSignatureValues.d.ts.map +1 -1
  217. package/dist/react-native/AccountSASSignatureValues.js.map +1 -1
  218. package/dist/react-native/Clients.d.ts +3 -2
  219. package/dist/react-native/Clients.d.ts.map +1 -1
  220. package/dist/react-native/Clients.js +555 -242
  221. package/dist/react-native/Clients.js.map +1 -1
  222. package/dist/react-native/FileDownloadResponse.js +2 -0
  223. package/dist/react-native/FileDownloadResponse.js.map +1 -1
  224. package/dist/react-native/FileSASPermissions.js +16 -18
  225. package/dist/react-native/FileSASPermissions.js.map +1 -1
  226. package/dist/react-native/FileSASSignatureValues.d.ts +1 -1
  227. package/dist/react-native/FileSASSignatureValues.d.ts.map +1 -1
  228. package/dist/react-native/FileSASSignatureValues.js.map +1 -1
  229. package/dist/react-native/FileSystemAttributes.js +43 -45
  230. package/dist/react-native/FileSystemAttributes.js.map +1 -1
  231. package/dist/react-native/Pipeline.d.ts +2 -4
  232. package/dist/react-native/Pipeline.d.ts.map +1 -1
  233. package/dist/react-native/Pipeline.js +28 -19
  234. package/dist/react-native/Pipeline.js.map +1 -1
  235. package/dist/react-native/SASQueryParameters.js +70 -0
  236. package/dist/react-native/SASQueryParameters.js.map +1 -1
  237. package/dist/react-native/ShareClientInternal.js +1 -0
  238. package/dist/react-native/ShareClientInternal.js.map +1 -1
  239. package/dist/react-native/ShareSASPermissions.js +20 -22
  240. package/dist/react-native/ShareSASPermissions.js.map +1 -1
  241. package/dist/react-native/ShareServiceClient.d.ts +1 -1
  242. package/dist/react-native/ShareServiceClient.d.ts.map +1 -1
  243. package/dist/react-native/ShareServiceClient.js +66 -50
  244. package/dist/react-native/ShareServiceClient.js.map +1 -1
  245. package/dist/react-native/StorageClient.d.ts +2 -2
  246. package/dist/react-native/StorageClient.d.ts.map +1 -1
  247. package/dist/react-native/StorageClient.js +23 -0
  248. package/dist/react-native/StorageClient.js.map +1 -1
  249. package/dist/react-native/StorageContextClient.js +1 -1
  250. package/dist/react-native/StorageContextClient.js.map +1 -1
  251. package/dist/react-native/generated/src/operations/directory.js +1 -0
  252. package/dist/react-native/generated/src/operations/directory.js.map +1 -1
  253. package/dist/react-native/generated/src/operations/file.js +1 -0
  254. package/dist/react-native/generated/src/operations/file.js.map +1 -1
  255. package/dist/react-native/generated/src/operations/service.js +1 -0
  256. package/dist/react-native/generated/src/operations/service.js.map +1 -1
  257. package/dist/react-native/generated/src/operations/share.js +1 -0
  258. package/dist/react-native/generated/src/operations/share.js.map +1 -1
  259. package/dist/react-native/generated/src/storageClient.js +15 -4
  260. package/dist/react-native/generated/src/storageClient.js.map +1 -1
  261. package/dist/react-native/index.d.ts +1 -9
  262. package/dist/react-native/index.d.ts.map +1 -1
  263. package/dist/react-native/index.js +1 -9
  264. package/dist/react-native/index.js.map +1 -1
  265. package/dist/react-native/utils/Batch.js +29 -21
  266. package/dist/react-native/utils/Batch.js.map +1 -1
  267. package/dist/react-native/utils/BufferScheduler.js +70 -44
  268. package/dist/react-native/utils/BufferScheduler.js.map +1 -1
  269. package/dist/react-native/utils/RetriableReadableStream.js +70 -62
  270. package/dist/react-native/utils/RetriableReadableStream.js.map +1 -1
  271. package/dist/react-native/utils/constants.d.ts.map +1 -1
  272. package/dist/react-native/utils/constants.js +1 -1
  273. package/dist/react-native/utils/constants.js.map +1 -1
  274. package/dist/react-native/utils/utils.common.js +31 -15
  275. package/dist/react-native/utils/utils.common.js.map +1 -1
  276. package/dist/react-native/utils/utils.d.ts +1 -1
  277. package/dist/react-native/utils/utils.d.ts.map +1 -1
  278. package/dist/react-native/utils/utils.js +2 -2
  279. package/dist/react-native/utils/utils.js.map +1 -1
  280. package/package.json +36 -36
  281. package/dist/browser/StorageRetryPolicyFactory.d.ts +0 -56
  282. package/dist/browser/StorageRetryPolicyFactory.d.ts.map +0 -1
  283. package/dist/browser/StorageRetryPolicyFactory.js +0 -26
  284. package/dist/browser/StorageRetryPolicyFactory.js.map +0 -1
  285. package/dist/browser/policies/StorageRetryPolicy.d.ts +0 -75
  286. package/dist/browser/policies/StorageRetryPolicy.d.ts.map +0 -1
  287. package/dist/browser/policies/StorageRetryPolicy.js +0 -218
  288. package/dist/browser/policies/StorageRetryPolicy.js.map +0 -1
  289. package/dist/browser/policies/StorageRetryPolicyV2.d.ts +0 -24
  290. package/dist/browser/policies/StorageRetryPolicyV2.d.ts.map +0 -1
  291. package/dist/browser/policies/StorageRetryPolicyV2.js +0 -174
  292. package/dist/browser/policies/StorageRetryPolicyV2.js.map +0 -1
  293. package/dist/commonjs/StorageRetryPolicyFactory.d.ts +0 -56
  294. package/dist/commonjs/StorageRetryPolicyFactory.d.ts.map +0 -1
  295. package/dist/commonjs/StorageRetryPolicyFactory.js +0 -31
  296. package/dist/commonjs/StorageRetryPolicyFactory.js.map +0 -1
  297. package/dist/commonjs/policies/StorageRetryPolicy.d.ts +0 -75
  298. package/dist/commonjs/policies/StorageRetryPolicy.d.ts.map +0 -1
  299. package/dist/commonjs/policies/StorageRetryPolicy.js +0 -223
  300. package/dist/commonjs/policies/StorageRetryPolicy.js.map +0 -1
  301. package/dist/commonjs/policies/StorageRetryPolicyV2.d.ts +0 -24
  302. package/dist/commonjs/policies/StorageRetryPolicyV2.d.ts.map +0 -1
  303. package/dist/commonjs/policies/StorageRetryPolicyV2.js +0 -178
  304. package/dist/commonjs/policies/StorageRetryPolicyV2.js.map +0 -1
  305. package/dist/esm/StorageRetryPolicyFactory.d.ts +0 -56
  306. package/dist/esm/StorageRetryPolicyFactory.d.ts.map +0 -1
  307. package/dist/esm/StorageRetryPolicyFactory.js +0 -26
  308. package/dist/esm/StorageRetryPolicyFactory.js.map +0 -1
  309. package/dist/esm/policies/StorageRetryPolicy.d.ts +0 -75
  310. package/dist/esm/policies/StorageRetryPolicy.d.ts.map +0 -1
  311. package/dist/esm/policies/StorageRetryPolicy.js +0 -218
  312. package/dist/esm/policies/StorageRetryPolicy.js.map +0 -1
  313. package/dist/esm/policies/StorageRetryPolicyV2.d.ts +0 -24
  314. package/dist/esm/policies/StorageRetryPolicyV2.d.ts.map +0 -1
  315. package/dist/esm/policies/StorageRetryPolicyV2.js +0 -174
  316. package/dist/esm/policies/StorageRetryPolicyV2.js.map +0 -1
  317. package/dist/react-native/StorageRetryPolicyFactory.d.ts +0 -56
  318. package/dist/react-native/StorageRetryPolicyFactory.d.ts.map +0 -1
  319. package/dist/react-native/StorageRetryPolicyFactory.js +0 -26
  320. package/dist/react-native/StorageRetryPolicyFactory.js.map +0 -1
  321. package/dist/react-native/policies/StorageRetryPolicy.d.ts +0 -75
  322. package/dist/react-native/policies/StorageRetryPolicy.d.ts.map +0 -1
  323. package/dist/react-native/policies/StorageRetryPolicy.js +0 -218
  324. package/dist/react-native/policies/StorageRetryPolicy.js.map +0 -1
  325. package/dist/react-native/policies/StorageRetryPolicyV2.d.ts +0 -24
  326. package/dist/react-native/policies/StorageRetryPolicyV2.d.ts.map +0 -1
  327. package/dist/react-native/policies/StorageRetryPolicyV2.js +0 -174
  328. package/dist/react-native/policies/StorageRetryPolicyV2.js.map +0 -1
@@ -353,6 +353,8 @@ class FileDownloadResponse {
353
353
  get _response() {
354
354
  return this.originalResponse._response;
355
355
  }
356
+ originalResponse;
357
+ fileDownloadStream;
356
358
  /**
357
359
  * Creates an instance of FileDownloadResponse.
358
360
  *
@@ -1 +1 @@
1
- {"version":3,"file":"FileDownloadResponse.js","sourceRoot":"","sources":["../../src/FileDownloadResponse.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,gDAA8C;AAc9C,mFAA6E;AAE7E,6DAAyD;AAEzD;;;;;;;;;GASG;AACH,MAAa,oBAAoB;IAC/B;;;;;OAKG;IACH,IAAW,YAAY;QACrB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,EAC5B,MAAc,EACd,KAAa,EACb,UAA0C,EAAE;QAE5C,IAAI,CAAC,gBAAgB,GAAG,IAAA,gCAAc,EACpC,gBAAgB,CACjB,CAAC;QACF,IAAI,CAAC,kBAAkB,GAAG,IAAI,oDAAuB,CACnD,IAAI,CAAC,gBAAgB,CAAC,kBAAmB,EACzC,MAAM,EACN,MAAM,EACN,KAAK,EACL,OAAO,CACR,CAAC;IACJ,CAAC;CACF;AAvZD,oDAuZC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { isNodeLike } from \"@azure/core-util\";\nimport type {\n CopyStatusType,\n FileDownloadHeaders,\n FileDownloadResponseModel,\n LeaseDurationType,\n LeaseStateType,\n LeaseStatusType,\n} from \"./generatedModels.js\";\nimport type { FilePosixProperties, Metadata } from \"./models.js\";\nimport type {\n ReadableStreamGetter,\n RetriableReadableStreamOptions,\n} from \"./utils/RetriableReadableStream.js\";\nimport { RetriableReadableStream } from \"./utils/RetriableReadableStream.js\";\nimport type { HttpResponse, WithResponse } from \"./utils/utils.common.js\";\nimport { assertResponse } from \"./utils/utils.common.js\";\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * FileDownloadResponse implements the `FileDownloadResponseModel` interface, and in a Node.js runtime it will\n * automatically retry when its internal read stream unexpectedly ends. (This kind of unexpected end cannot\n * trigger retries defined in the pipeline retry policy.)\n *\n * The {@link readableStreamBody} stream will retry beneath the `ReadableStream` layer, so you can just use it as\n * a normal Node.js Readable stream.\n */\nexport class FileDownloadResponse implements FileDownloadResponseModel {\n /**\n * Indicates that the service supports\n * requests for partial file content.\n *\n * @readonly\n */\n public get acceptRanges(): string | undefined {\n return this.originalResponse.acceptRanges;\n }\n\n /**\n * Returnes if it was previously specified\n * for the file.\n *\n * @readonly\n */\n public get cacheControl(): string | undefined {\n return this.originalResponse.cacheControl;\n }\n\n /**\n * Returns the value that was specified\n * for the 'x-ms-content-disposition' header and specifies how to process the\n * response.\n *\n * @readonly\n */\n public get contentDisposition(): string | undefined {\n return this.originalResponse.contentDisposition;\n }\n\n /**\n * Returns the value that was specified\n * for the Content-Encoding request header.\n *\n * @readonly\n */\n public get contentEncoding(): string | undefined {\n return this.originalResponse.contentEncoding;\n }\n\n /**\n * Returns the value that was specified\n * for the Content-Language request header.\n *\n * @readonly\n */\n public get contentLanguage(): string | undefined {\n return this.originalResponse.contentLanguage;\n }\n\n /**\n * The number of bytes present in the\n * response body.\n *\n * @readonly\n */\n public get contentLength(): number | undefined {\n return this.originalResponse.contentLength;\n }\n\n /**\n * If the file has an MD5 hash and the\n * request is to read the full file, this response header is returned so that\n * the client can check for message content integrity. If the request is to\n * read a specified range and the 'x-ms-range-get-content-md5' is set to\n * true, then the request returns an MD5 hash for the range, as long as the\n * range size is less than or equal to 4 MB. If neither of these sets of\n * conditions is true, then no value is returned for the 'Content-MD5'\n * header.\n *\n * @readonly\n */\n public get contentMD5(): Uint8Array | undefined {\n return this.originalResponse.contentMD5;\n }\n\n /**\n * Indicates the range of bytes returned if\n * the client requested a subset of the file by setting the Range request\n * header.\n *\n * @readonly\n */\n public get contentRange(): string | undefined {\n return this.originalResponse.contentRange;\n }\n\n /**\n * The content type specified for the file.\n * The default content type is 'application/octet-stream'\n *\n * @readonly\n */\n public get contentType(): string | undefined {\n return this.originalResponse.contentType;\n }\n\n /**\n * Conclusion time of the last attempted\n * Copy File operation where this file was the destination file. This value\n * can specify the time of a completed, aborted, or failed copy attempt.\n *\n * @readonly\n */\n public get copyCompletedOn(): Date | undefined {\n return this.originalResponse.copyCompletedOn;\n }\n\n /**\n * String identifier for the last attempted Copy\n * File operation where this file was the destination file.\n *\n * @readonly\n */\n public get copyId(): string | undefined {\n return this.originalResponse.copyId;\n }\n\n /**\n * Contains the number of bytes copied and\n * the total bytes in the source in the last attempted Copy File operation\n * where this file was the destination file. Can show between 0 and\n * Content-Length bytes copied.\n *\n * @readonly\n */\n public get copyProgress(): string | undefined {\n return this.originalResponse.copyProgress;\n }\n\n /**\n * URL up to 2KB in length that specifies the\n * source file used in the last attempted Copy File operation where this file\n * was the destination file.\n *\n * @readonly\n */\n public get copySource(): string | undefined {\n return this.originalResponse.copySource;\n }\n\n /**\n * State of the copy operation\n * identified by 'x-ms-copy-id'. Possible values include: 'pending',\n * 'success', 'aborted', 'failed'\n *\n * @readonly\n */\n public get copyStatus(): CopyStatusType | undefined {\n return this.originalResponse.copyStatus;\n }\n\n /**\n * Only appears when\n * x-ms-copy-status is failed or pending. Describes cause of fatal or\n * non-fatal copy operation failure.\n *\n * @readonly\n */\n public get copyStatusDescription(): string | undefined {\n return this.originalResponse.copyStatusDescription;\n }\n\n /**\n * A UTC date/time value generated by the service that\n * indicates the time at which the response was initiated.\n *\n * @readonly\n */\n public get date(): Date | undefined {\n return this.originalResponse.date;\n }\n\n /**\n * The ETag contains a value that you can use to\n * perform operations conditionally, in quotes.\n *\n * @readonly\n */\n public get etag(): string | undefined {\n return this.originalResponse.etag;\n }\n\n public get errorCode(): string | undefined {\n return this.originalResponse.errorCode;\n }\n\n /**\n * If the file has a MD5 hash, and if\n * request contains range header (Range or x-ms-range), this response header\n * is returned with the value of the whole file's MD5 value. This value may\n * or may not be equal to the value returned in Content-MD5 header, with the\n * latter calculated from the requested range.\n *\n * @readonly\n */\n public get fileContentMD5(): Uint8Array | undefined {\n return this.originalResponse.fileContentMD5;\n }\n\n /**\n * The value of this header is set to\n * true if the file data and application metadata are completely encrypted\n * using the specified algorithm. Otherwise, the value is set to false (when\n * the file is unencrypted, or if only parts of the file/application metadata\n * are encrypted).\n *\n * @readonly\n */\n public get isServerEncrypted(): boolean | undefined {\n return this.originalResponse.isServerEncrypted;\n }\n\n /**\n * Returns the date and time the file was last\n * modified. Any operation that modifies the file or its properties updates\n * the last modified time.\n *\n * @readonly\n */\n public get lastModified(): Date | undefined {\n return this.originalResponse.lastModified;\n }\n\n /**\n * A name-value pair\n * to associate with a file storage object.\n *\n * @readonly\n */\n public get metadata(): Metadata | undefined {\n return this.originalResponse.metadata;\n }\n\n /**\n * This header uniquely identifies the request\n * that was made and can be used for troubleshooting the request.\n *\n * @readonly\n */\n public get requestId(): string | undefined {\n return this.originalResponse.requestId;\n }\n\n /**\n * Indicates the version of the File service used\n * to execute the request.\n *\n * @readonly\n */\n public get version(): string | undefined {\n return this.originalResponse.version;\n }\n\n /**\n * Attributes set for the file.\n *\n * @readonly\n */\n public get fileAttributes(): string | undefined {\n return this.originalResponse.fileAttributes;\n }\n\n /**\n * Creation time for the file.\n *\n * @readonly\n */\n public get fileCreatedOn(): Date | undefined {\n return this.originalResponse.fileCreatedOn;\n }\n\n /**\n * Last write time for the file.\n *\n * @readonly\n */\n public get fileLastWriteOn(): Date | undefined {\n return this.originalResponse.fileLastWriteOn;\n }\n\n /**\n * Change time for the file.\n *\n * @readonly\n */\n public get fileChangeOn(): Date | undefined {\n return this.originalResponse.fileChangeOn;\n }\n\n /**\n * Key of the permission set for the file.\n *\n * @readonly\n */\n public get filePermissionKey(): string | undefined {\n return this.originalResponse.filePermissionKey;\n }\n\n /**\n * The fileId of the file.\n *\n * @readonly\n */\n public get fileId(): string | undefined {\n return this.originalResponse.fileId;\n }\n\n /**\n * The parent fileId of the file.\n *\n * @readonly\n */\n public get fileParentId(): string | undefined {\n return this.originalResponse.fileParentId;\n }\n\n /**\n * The response body as a browser Blob.\n * Always undefined in node.js.\n *\n * @readonly\n */\n public get contentAsBlob(): Promise<Blob> | undefined {\n return this.originalResponse.blobBody;\n }\n\n /**\n * When a file is leased, specifies whether the lease is of infinite or fixed duration. Possible\n * values include: 'infinite', 'fixed'\n */\n public get leaseDuration(): LeaseDurationType | undefined {\n return this.originalResponse.leaseDuration;\n }\n\n /**\n * Lease state of the file. Possible values include: 'available', 'leased', 'expired',\n * 'breaking', 'broken'\n */\n public get leaseState(): LeaseStateType | undefined {\n return this.originalResponse.leaseState;\n }\n\n /**\n * The current lease status of the file. Possible values include: 'locked', 'unlocked'\n */\n public get leaseStatus(): LeaseStatusType | undefined {\n return this.originalResponse.leaseStatus;\n }\n\n /**\n * Properties of NFS files\n */\n public get posixProperties(): FilePosixProperties | undefined {\n return this.originalResponse.posixProperties;\n }\n\n /**\n * The response body as a node.js Readable stream.\n * Always undefined in the browser.\n *\n * It will automatically retry when internal read stream unexpected ends.\n *\n * @readonly\n */\n public get readableStreamBody(): NodeJS.ReadableStream | undefined {\n return isNodeLike ? this.fileDownloadStream : undefined;\n }\n\n public get _response(): HttpResponse & {\n parsedHeaders: FileDownloadHeaders;\n } {\n return this.originalResponse._response;\n }\n\n private originalResponse: WithResponse<FileDownloadResponseModel, FileDownloadHeaders>;\n private fileDownloadStream?: RetriableReadableStream;\n\n /**\n * Creates an instance of FileDownloadResponse.\n *\n * @param originalResponse -\n * @param getter -\n * @param offset -\n * @param count -\n * @param options -\n */\n public constructor(\n originalResponse: FileDownloadResponseModel,\n getter: ReadableStreamGetter,\n offset: number,\n count: number,\n options: RetriableReadableStreamOptions = {},\n ) {\n this.originalResponse = assertResponse<FileDownloadResponseModel, FileDownloadHeaders>(\n originalResponse,\n );\n this.fileDownloadStream = new RetriableReadableStream(\n this.originalResponse.readableStreamBody!,\n getter,\n offset,\n count,\n options,\n );\n }\n}\n"]}
1
+ {"version":3,"file":"FileDownloadResponse.js","sourceRoot":"","sources":["../../src/FileDownloadResponse.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,gDAA8C;AAc9C,mFAA6E;AAE7E,6DAAyD;AAEzD;;;;;;;;;GASG;AACH,MAAa,oBAAoB;IAC/B;;;;;OAKG;IACH,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC;IAC5C,CAAC;IAED;;;;;OAKG;IACH,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC;IAC5C,CAAC;IAED;;;;;;OAMG;IACH,IAAW,kBAAkB;QAC3B,OAAO,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,CAA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AmB,EACzC,MAAM,EACN,MAAM,EACN,KAAK,EACL,OAAO,CACR,CAAC;IACJ,CAAC;CACF;AAvZD,oDAuZC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { isNodeLike } from \"@azure/core-util\";\nimport type {\n CopyStatusType,\n FileDownloadHeaders,\n FileDownloadResponseModel,\n LeaseDurationType,\n LeaseStateType,\n LeaseStatusType,\n} from \"./generatedModels.js\";\nimport type { FilePosixProperties, Metadata } from \"./models.js\";\nimport type {\n ReadableStreamGetter,\n RetriableReadableStreamOptions,\n} from \"./utils/RetriableReadableStream.js\";\nimport { RetriableReadableStream } from \"./utils/RetriableReadableStream.js\";\nimport type { HttpResponse, WithResponse } from \"./utils/utils.common.js\";\nimport { assertResponse } from \"./utils/utils.common.js\";\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * FileDownloadResponse implements the `FileDownloadResponseModel` interface, and in a Node.js runtime it will\n * automatically retry when its internal read stream unexpectedly ends. (This kind of unexpected end cannot\n * trigger retries defined in the pipeline retry policy.)\n *\n * The {@link readableStreamBody} stream will retry beneath the `ReadableStream` layer, so you can just use it as\n * a normal Node.js Readable stream.\n */\nexport class FileDownloadResponse implements FileDownloadResponseModel {\n /**\n * Indicates that the service supports\n * requests for partial file content.\n *\n * @readonly\n */\n public get acceptRanges(): string | undefined {\n return this.originalResponse.acceptRanges;\n }\n\n /**\n * Returnes if it was previously specified\n * for the file.\n *\n * @readonly\n */\n public get cacheControl(): string | undefined {\n return this.originalResponse.cacheControl;\n }\n\n /**\n * Returns the value that was specified\n * for the 'x-ms-content-disposition' header and specifies how to process the\n * response.\n *\n * @readonly\n */\n public get contentDisposition(): string | undefined {\n return this.originalResponse.contentDisposition;\n }\n\n /**\n * Returns the value that was specified\n * for the Content-Encoding request header.\n *\n * @readonly\n */\n public get contentEncoding(): string | undefined {\n return this.originalResponse.contentEncoding;\n }\n\n /**\n * Returns the value that was specified\n * for the Content-Language request header.\n *\n * @readonly\n */\n public get contentLanguage(): string | undefined {\n return this.originalResponse.contentLanguage;\n }\n\n /**\n * The number of bytes present in the\n * response body.\n *\n * @readonly\n */\n public get contentLength(): number | undefined {\n return this.originalResponse.contentLength;\n }\n\n /**\n * If the file has an MD5 hash and the\n * request is to read the full file, this response header is returned so that\n * the client can check for message content integrity. If the request is to\n * read a specified range and the 'x-ms-range-get-content-md5' is set to\n * true, then the request returns an MD5 hash for the range, as long as the\n * range size is less than or equal to 4 MB. If neither of these sets of\n * conditions is true, then no value is returned for the 'Content-MD5'\n * header.\n *\n * @readonly\n */\n public get contentMD5(): Uint8Array | undefined {\n return this.originalResponse.contentMD5;\n }\n\n /**\n * Indicates the range of bytes returned if\n * the client requested a subset of the file by setting the Range request\n * header.\n *\n * @readonly\n */\n public get contentRange(): string | undefined {\n return this.originalResponse.contentRange;\n }\n\n /**\n * The content type specified for the file.\n * The default content type is 'application/octet-stream'\n *\n * @readonly\n */\n public get contentType(): string | undefined {\n return this.originalResponse.contentType;\n }\n\n /**\n * Conclusion time of the last attempted\n * Copy File operation where this file was the destination file. This value\n * can specify the time of a completed, aborted, or failed copy attempt.\n *\n * @readonly\n */\n public get copyCompletedOn(): Date | undefined {\n return this.originalResponse.copyCompletedOn;\n }\n\n /**\n * String identifier for the last attempted Copy\n * File operation where this file was the destination file.\n *\n * @readonly\n */\n public get copyId(): string | undefined {\n return this.originalResponse.copyId;\n }\n\n /**\n * Contains the number of bytes copied and\n * the total bytes in the source in the last attempted Copy File operation\n * where this file was the destination file. Can show between 0 and\n * Content-Length bytes copied.\n *\n * @readonly\n */\n public get copyProgress(): string | undefined {\n return this.originalResponse.copyProgress;\n }\n\n /**\n * URL up to 2KB in length that specifies the\n * source file used in the last attempted Copy File operation where this file\n * was the destination file.\n *\n * @readonly\n */\n public get copySource(): string | undefined {\n return this.originalResponse.copySource;\n }\n\n /**\n * State of the copy operation\n * identified by 'x-ms-copy-id'. Possible values include: 'pending',\n * 'success', 'aborted', 'failed'\n *\n * @readonly\n */\n public get copyStatus(): CopyStatusType | undefined {\n return this.originalResponse.copyStatus;\n }\n\n /**\n * Only appears when\n * x-ms-copy-status is failed or pending. Describes cause of fatal or\n * non-fatal copy operation failure.\n *\n * @readonly\n */\n public get copyStatusDescription(): string | undefined {\n return this.originalResponse.copyStatusDescription;\n }\n\n /**\n * A UTC date/time value generated by the service that\n * indicates the time at which the response was initiated.\n *\n * @readonly\n */\n public get date(): Date | undefined {\n return this.originalResponse.date;\n }\n\n /**\n * The ETag contains a value that you can use to\n * perform operations conditionally, in quotes.\n *\n * @readonly\n */\n public get etag(): string | undefined {\n return this.originalResponse.etag;\n }\n\n public get errorCode(): string | undefined {\n return this.originalResponse.errorCode;\n }\n\n /**\n * If the file has a MD5 hash, and if\n * request contains range header (Range or x-ms-range), this response header\n * is returned with the value of the whole file's MD5 value. This value may\n * or may not be equal to the value returned in Content-MD5 header, with the\n * latter calculated from the requested range.\n *\n * @readonly\n */\n public get fileContentMD5(): Uint8Array | undefined {\n return this.originalResponse.fileContentMD5;\n }\n\n /**\n * The value of this header is set to\n * true if the file data and application metadata are completely encrypted\n * using the specified algorithm. Otherwise, the value is set to false (when\n * the file is unencrypted, or if only parts of the file/application metadata\n * are encrypted).\n *\n * @readonly\n */\n public get isServerEncrypted(): boolean | undefined {\n return this.originalResponse.isServerEncrypted;\n }\n\n /**\n * Returns the date and time the file was last\n * modified. Any operation that modifies the file or its properties updates\n * the last modified time.\n *\n * @readonly\n */\n public get lastModified(): Date | undefined {\n return this.originalResponse.lastModified;\n }\n\n /**\n * A name-value pair\n * to associate with a file storage object.\n *\n * @readonly\n */\n public get metadata(): Metadata | undefined {\n return this.originalResponse.metadata;\n }\n\n /**\n * This header uniquely identifies the request\n * that was made and can be used for troubleshooting the request.\n *\n * @readonly\n */\n public get requestId(): string | undefined {\n return this.originalResponse.requestId;\n }\n\n /**\n * Indicates the version of the File service used\n * to execute the request.\n *\n * @readonly\n */\n public get version(): string | undefined {\n return this.originalResponse.version;\n }\n\n /**\n * Attributes set for the file.\n *\n * @readonly\n */\n public get fileAttributes(): string | undefined {\n return this.originalResponse.fileAttributes;\n }\n\n /**\n * Creation time for the file.\n *\n * @readonly\n */\n public get fileCreatedOn(): Date | undefined {\n return this.originalResponse.fileCreatedOn;\n }\n\n /**\n * Last write time for the file.\n *\n * @readonly\n */\n public get fileLastWriteOn(): Date | undefined {\n return this.originalResponse.fileLastWriteOn;\n }\n\n /**\n * Change time for the file.\n *\n * @readonly\n */\n public get fileChangeOn(): Date | undefined {\n return this.originalResponse.fileChangeOn;\n }\n\n /**\n * Key of the permission set for the file.\n *\n * @readonly\n */\n public get filePermissionKey(): string | undefined {\n return this.originalResponse.filePermissionKey;\n }\n\n /**\n * The fileId of the file.\n *\n * @readonly\n */\n public get fileId(): string | undefined {\n return this.originalResponse.fileId;\n }\n\n /**\n * The parent fileId of the file.\n *\n * @readonly\n */\n public get fileParentId(): string | undefined {\n return this.originalResponse.fileParentId;\n }\n\n /**\n * The response body as a browser Blob.\n * Always undefined in node.js.\n *\n * @readonly\n */\n public get contentAsBlob(): Promise<Blob> | undefined {\n return this.originalResponse.blobBody;\n }\n\n /**\n * When a file is leased, specifies whether the lease is of infinite or fixed duration. Possible\n * values include: 'infinite', 'fixed'\n */\n public get leaseDuration(): LeaseDurationType | undefined {\n return this.originalResponse.leaseDuration;\n }\n\n /**\n * Lease state of the file. Possible values include: 'available', 'leased', 'expired',\n * 'breaking', 'broken'\n */\n public get leaseState(): LeaseStateType | undefined {\n return this.originalResponse.leaseState;\n }\n\n /**\n * The current lease status of the file. Possible values include: 'locked', 'unlocked'\n */\n public get leaseStatus(): LeaseStatusType | undefined {\n return this.originalResponse.leaseStatus;\n }\n\n /**\n * Properties of NFS files\n */\n public get posixProperties(): FilePosixProperties | undefined {\n return this.originalResponse.posixProperties;\n }\n\n /**\n * The response body as a node.js Readable stream.\n * Always undefined in the browser.\n *\n * It will automatically retry when internal read stream unexpected ends.\n *\n * @readonly\n */\n public get readableStreamBody(): NodeJS.ReadableStream | undefined {\n return isNodeLike ? this.fileDownloadStream : undefined;\n }\n\n public get _response(): HttpResponse & {\n parsedHeaders: FileDownloadHeaders;\n } {\n return this.originalResponse._response;\n }\n\n private originalResponse: WithResponse<FileDownloadResponseModel, FileDownloadHeaders>;\n private fileDownloadStream?: RetriableReadableStream;\n\n /**\n * Creates an instance of FileDownloadResponse.\n *\n * @param originalResponse -\n * @param getter -\n * @param offset -\n * @param count -\n * @param options -\n */\n public constructor(\n originalResponse: FileDownloadResponseModel,\n getter: ReadableStreamGetter,\n offset: number,\n count: number,\n options: RetriableReadableStreamOptions = {},\n ) {\n this.originalResponse = assertResponse<FileDownloadResponseModel, FileDownloadHeaders>(\n originalResponse,\n );\n this.fileDownloadStream = new RetriableReadableStream(\n this.originalResponse.readableStreamBody!,\n getter,\n offset,\n count,\n options,\n );\n }\n}\n"]}
@@ -13,24 +13,6 @@ exports.FileSASPermissions = void 0;
13
13
  * the order of the permissions is particular and this class guarantees correctness.
14
14
  */
15
15
  class FileSASPermissions {
16
- constructor() {
17
- /**
18
- * Specifies Read access granted.
19
- */
20
- this.read = false;
21
- /**
22
- * Specifies Create access granted.
23
- */
24
- this.create = false;
25
- /**
26
- * Specifies Write access granted.
27
- */
28
- this.write = false;
29
- /**
30
- * Specifies Delete access granted.
31
- */
32
- this.delete = false;
33
- }
34
16
  /**
35
17
  * Creates a FileSASPermissions from the specified permissions string. This method will throw an
36
18
  * Error if it encounters a character that does not correspond to a valid permission.
@@ -59,6 +41,22 @@ class FileSASPermissions {
59
41
  }
60
42
  return fileSASPermissions;
61
43
  }
44
+ /**
45
+ * Specifies Read access granted.
46
+ */
47
+ read = false;
48
+ /**
49
+ * Specifies Create access granted.
50
+ */
51
+ create = false;
52
+ /**
53
+ * Specifies Write access granted.
54
+ */
55
+ write = false;
56
+ /**
57
+ * Specifies Delete access granted.
58
+ */
59
+ delete = false;
62
60
  /**
63
61
  * Converts the given permissions to a string. Using this method will guarantee the permissions are in an
64
62
  * order accepted by the service.
@@ -1 +1 @@
1
- {"version":3,"file":"FileSASPermissions.js","sourceRoot":"","sources":["../../src/FileSASPermissions.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC;;;;;;;;GAQG;AACH,MAAa,kBAAkB;IAA/B;QAgCE;;WAEG;QACI,SAAI,GAAY,KAAK,CAAC;QAE7B;;WAEG;QACI,WAAM,GAAY,KAAK,CAAC;QAE/B;;WAEG;QACI,UAAK,GAAY,KAAK,CAAC;QAE9B;;WAEG;QACI,WAAM,GAAY,KAAK,CAAC;IAwBjC,CAAC;IAzEC;;;;;OAKG;IACI,MAAM,CAAC,KAAK,CAAC,WAAmB;QACrC,MAAM,kBAAkB,GAAG,IAAI,kBAAkB,EAAE,CAAC;QAEpD,KAAK,MAAM,IAAI,IAAI,WAAW,EAAE,CAAC;YAC/B,QAAQ,IAAI,EAAE,CAAC;gBACb,KAAK,GAAG;oBACN,kBAAkB,CAAC,IAAI,GAAG,IAAI,CAAC;oBAC/B,MAAM;gBACR,KAAK,GAAG;oBACN,kBAAkB,CAAC,MAAM,GAAG,IAAI,CAAC;oBACjC,MAAM;gBACR,KAAK,GAAG;oBACN,kBAAkB,CAAC,KAAK,GAAG,IAAI,CAAC;oBAChC,MAAM;gBACR,KAAK,GAAG;oBACN,kBAAkB,CAAC,MAAM,GAAG,IAAI,CAAC;oBACjC,MAAM;gBACR;oBACE,MAAM,IAAI,UAAU,CAAC,uBAAuB,IAAI,EAAE,CAAC,CAAC;YACxD,CAAC;QACH,CAAC;QAED,OAAO,kBAAkB,CAAC;IAC5B,CAAC;IAsBD;;;;;OAKG;IACI,QAAQ;QACb,MAAM,WAAW,GAAa,EAAE,CAAC;QACjC,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YACd,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACxB,CAAC;QACD,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACxB,CAAC;QACD,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YACf,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACxB,CAAC;QACD,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACxB,CAAC;QACD,OAAO,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC9B,CAAC;CACF;AA1ED,gDA0EC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * This is a helper class to construct a string representing the permissions granted by a ServiceSAS to a file. Setting\n * a value to true means that any SAS which uses these permissions will grant permissions for that operation. Once all\n * the values are set, this should be serialized with toString and set as the permissions field on a\n * {@link FileSASSignatureValues} object. It is possible to construct the permissions string without this class, but\n * the order of the permissions is particular and this class guarantees correctness.\n */\nexport class FileSASPermissions {\n /**\n * Creates a FileSASPermissions from the specified permissions string. This method will throw an\n * Error if it encounters a character that does not correspond to a valid permission.\n *\n * @param permissions -\n */\n public static parse(permissions: string): FileSASPermissions {\n const fileSASPermissions = new FileSASPermissions();\n\n for (const char of permissions) {\n switch (char) {\n case \"r\":\n fileSASPermissions.read = true;\n break;\n case \"c\":\n fileSASPermissions.create = true;\n break;\n case \"w\":\n fileSASPermissions.write = true;\n break;\n case \"d\":\n fileSASPermissions.delete = true;\n break;\n default:\n throw new RangeError(`Invalid permission: ${char}`);\n }\n }\n\n return fileSASPermissions;\n }\n\n /**\n * Specifies Read access granted.\n */\n public read: boolean = false;\n\n /**\n * Specifies Create access granted.\n */\n public create: boolean = false;\n\n /**\n * Specifies Write access granted.\n */\n public write: boolean = false;\n\n /**\n * Specifies Delete access granted.\n */\n public delete: boolean = false;\n\n /**\n * Converts the given permissions to a string. Using this method will guarantee the permissions are in an\n * order accepted by the service.\n *\n * @returns A string which represents the FileSASPermissions\n */\n public toString(): string {\n const permissions: string[] = [];\n if (this.read) {\n permissions.push(\"r\");\n }\n if (this.create) {\n permissions.push(\"c\");\n }\n if (this.write) {\n permissions.push(\"w\");\n }\n if (this.delete) {\n permissions.push(\"d\");\n }\n return permissions.join(\"\");\n }\n}\n"]}
1
+ {"version":3,"file":"FileSASPermissions.js","sourceRoot":"","sources":["../../src/FileSASPermissions.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC;;;;;;;;GAQG;AACH,MAAa,kBAAkB;IAC7B;;;;;OAKG;IACI,MAAM,CAAC,KAAK,CAAC,WAAmB;QACrC,MAAM,kBAAkB,GAAG,IAAI,kBAAkB,EAAE,CAAC;QAEpD,KAAK,MAAM,IAAI,IAAI,WAAW,EAAE,CAAC;YAC/B,QAAQ,IAAI,EAAE,CAAC;gBACb,KAAK,GAAG;oBACN,kBAAkB,CAAC,IAAI,GAAG,IAAI,CAAC;oBAC/B,MAAM;gBACR,KAAK,GAAG;oBACN,kBAAkB,CAAC,MAAM,GAAG,IAAI,CAAC;oBACjC,MAAM;gBACR,KAAK,GAAG;oBACN,kBAAkB,CAAC,KAAK,GAAG,IAAI,CAAC;oBAChC,MAAM;gBACR,KAAK,GAAG;oBACN,kBAAkB,CAAC,MAAM,GAAG,IAAI,CAAC;oBACjC,MAAM;gBACR;oBACE,MAAM,IAAI,UAAU,CAAC,uBAAuB,IAAI,EAAE,CAAC,CAAC;YACxD,CAAC;QACH,CAAC;QAED,OAAO,kBAAkB,CAAC;IAC5B,CAAC;IAED;;OAEG;IACI,IAAI,GAAY,KAAK,CAAC;IAE7B;;OAEG;IACI,MAAM,GAAY,KAAK,CAAC;IAE/B;;OAEG;IACI,KAAK,GAAY,KAAK,CAAC;IAE9B;;OAEG;IACI,MAAM,GAAY,KAAK,CAAC;IAE/B;;;;;OAKG;IACI,QAAQ;QACb,MAAM,WAAW,GAAa,EAAE,CAAC;QACjC,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YACd,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACxB,CAAC;QACD,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACxB,CAAC;QACD,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YACf,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACxB,CAAC;QACD,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACxB,CAAC;QACD,OAAO,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC9B,CAAC;CACF;AA1ED,gDA0EC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * This is a helper class to construct a string representing the permissions granted by a ServiceSAS to a file. Setting\n * a value to true means that any SAS which uses these permissions will grant permissions for that operation. Once all\n * the values are set, this should be serialized with toString and set as the permissions field on a\n * {@link FileSASSignatureValues} object. It is possible to construct the permissions string without this class, but\n * the order of the permissions is particular and this class guarantees correctness.\n */\nexport class FileSASPermissions {\n /**\n * Creates a FileSASPermissions from the specified permissions string. This method will throw an\n * Error if it encounters a character that does not correspond to a valid permission.\n *\n * @param permissions -\n */\n public static parse(permissions: string): FileSASPermissions {\n const fileSASPermissions = new FileSASPermissions();\n\n for (const char of permissions) {\n switch (char) {\n case \"r\":\n fileSASPermissions.read = true;\n break;\n case \"c\":\n fileSASPermissions.create = true;\n break;\n case \"w\":\n fileSASPermissions.write = true;\n break;\n case \"d\":\n fileSASPermissions.delete = true;\n break;\n default:\n throw new RangeError(`Invalid permission: ${char}`);\n }\n }\n\n return fileSASPermissions;\n }\n\n /**\n * Specifies Read access granted.\n */\n public read: boolean = false;\n\n /**\n * Specifies Create access granted.\n */\n public create: boolean = false;\n\n /**\n * Specifies Write access granted.\n */\n public write: boolean = false;\n\n /**\n * Specifies Delete access granted.\n */\n public delete: boolean = false;\n\n /**\n * Converts the given permissions to a string. Using this method will guarantee the permissions are in an\n * order accepted by the service.\n *\n * @returns A string which represents the FileSASPermissions\n */\n public toString(): string {\n const permissions: string[] = [];\n if (this.read) {\n permissions.push(\"r\");\n }\n if (this.create) {\n permissions.push(\"c\");\n }\n if (this.write) {\n permissions.push(\"w\");\n }\n if (this.delete) {\n permissions.push(\"d\");\n }\n return permissions.join(\"\");\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { StorageSharedKeyCredential } from "@azure/storage-blob";
1
+ import type { StorageSharedKeyCredential } from "@azure/storage-common";
2
2
  import { FileSASPermissions } from "./FileSASPermissions.js";
3
3
  import type { SasIPRange } from "./SasIPRange.js";
4
4
  import type { SASProtocol } from "./SASQueryParameters.js";
@@ -1 +1 @@
1
- {"version":3,"file":"FileSASSignatureValues.d.ts","sourceRoot":"","sources":["../../src/FileSASSignatureValues.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAI/D;;;;GAIG;AAEH,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,QAAQ,CAAC,EAAE,WAAW,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,EAAE,IAAI,CAAC;IAEhB;;OAEG;IACH,SAAS,CAAC,EAAE,IAAI,CAAC;IAEjB;;;;OAIG;IACH,WAAW,CAA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C;IACnC,4CAA4C;IAC5C,0DAA0D;IAC1D,MAAM,QAAQ,GAAa,CAAC,SAAS,WAAW,IAAI,SAAS,EAAE,CAAC,CAAC;IACjE,IAAI,QAAQ,EAAE,CAAC;QACb,QAAQ,CAAC,IAAI,CAAC,IAAI,QAAQ,EAAE,CAAC,CAAC;IAChC,CAAC;IACD,OAAO,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC3B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { StorageSharedKeyCredential } from \"@azure/storage-blob\";\nimport { FileSASPermissions } from \"./FileSASPermissions.js\";\nimport type { SasIPRange } from \"./SasIPRange.js\";\nimport { ipRangeToString } from \"./SasIPRange.js\";\nimport type { SASProtocol } from \"./SASQueryParameters.js\";\nimport { SASQueryParameters } from \"./SASQueryParameters.js\";\nimport { ShareSASPermissions } from \"./ShareSASPermissions.js\";\nimport { SERVICE_VERSION } from \"./utils/constants.js\";\nimport { truncatedISO8061Date } from \"./utils/utils.common.js\";\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * FileSASSignatureValues is used to help generating File service SAS tokens for shares or files.\n */\n\nexport interface FileSASSignatureValues {\n /**\n * The version of the service this SAS will target. If not specified, it will default to the version targeted by the\n * library.\n */\n version?: string;\n\n /**\n * Optional. SAS protocols, HTTPS only or HTTPSandHTTP\n */\n protocol?: SASProtocol;\n\n /**\n * Optional. When the SAS will take effect.\n */\n startsOn?: Date;\n\n /**\n * Optional only when identifier is provided. The time after which the SAS will no longer work.\n */\n expiresOn?: Date;\n\n /**\n * Optional only when identifier is provided.\n * Please refer to either {@link ShareSASPermissions} or {@link FileSASPermissions} depending on the resource\n * being accessed for help constructing the permissions string.\n */\n permissions?: FileSASPermissions | ShareSASPermissions;\n\n /**\n * Optional. IP ranges allowed in this SAS.\n */\n ipRange?: SasIPRange;\n\n /**\n * The name of the share the SAS user may access.\n */\n shareName: string;\n\n /**\n * Optional. The path of the file like, \"directory/FileName\" or \"FileName\".\n */\n filePath?: string;\n\n /**\n * Optional. The name of the access policy on the share this SAS references if any.\n *\n * @see https://learn.microsoft.com/rest/api/storageservices/establishing-a-stored-access-policy\n */\n identifier?: string;\n\n /**\n * Optional. The cache-control header for the SAS.\n */\n cacheControl?: string;\n\n /**\n * Optional. The content-disposition header for the SAS.\n */\n contentDisposition?: string;\n\n /**\n * Optional. The content-encoding header for the SAS.\n */\n contentEncoding?: string;\n\n /**\n * Optional. The content-language header for the SAS.\n */\n contentLanguage?: string;\n\n /**\n * Optional. The content-type header for the SAS.\n */\n contentType?: string;\n}\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * Creates an instance of SASQueryParameters.\n *\n * Only accepts required settings needed to create a SAS. For optional settings please\n * set corresponding properties directly, such as permissions, startsOn and identifier.\n *\n * WARNING: When identifier is not provided, permissions and expiresOn are required.\n * You MUST assign value to identifier or expiresOn & permissions manually if you initial with\n * this constructor.\n *\n * @param fileSASSignatureValues -\n * @param sharedKeyCredential -\n */\nexport function generateFileSASQueryParameters(\n fileSASSignatureValues: FileSASSignatureValues,\n sharedKeyCredential: StorageSharedKeyCredential,\n): SASQueryParameters {\n return generateFileSASQueryParametersInternal(fileSASSignatureValues, sharedKeyCredential)\n .sasQueryParameters;\n}\n\nexport function generateFileSASQueryParametersInternal(\n fileSASSignatureValues: FileSASSignatureValues,\n sharedKeyCredential: StorageSharedKeyCredential,\n): { sasQueryParameters: SASQueryParameters; stringToSign: string } {\n if (\n !fileSASSignatureValues.identifier &&\n !(fileSASSignatureValues.permissions && fileSASSignatureValues.expiresOn)\n ) {\n throw new RangeError(\n \"Must provide 'permissions' and 'expiresOn' for File SAS generation when 'identifier' is not provided.\",\n );\n }\n\n const version = fileSASSignatureValues.version ? fileSASSignatureValues.version : SERVICE_VERSION;\n let resource: string = \"s\";\n if (fileSASSignatureValues.filePath) {\n resource = \"f\";\n }\n\n let verifiedPermissions: string | undefined;\n // Calling parse and toString guarantees the proper ordering and throws on invalid characters.\n if (fileSASSignatureValues.permissions) {\n if (fileSASSignatureValues.filePath) {\n verifiedPermissions = FileSASPermissions.parse(\n fileSASSignatureValues.permissions.toString(),\n ).toString();\n } else {\n verifiedPermissions = ShareSASPermissions.parse(\n fileSASSignatureValues.permissions.toString(),\n ).toString();\n }\n }\n\n // Signature is generated on the un-url-encoded values.\n const stringToSign = [\n verifiedPermissions,\n fileSASSignatureValues.startsOn\n ? truncatedISO8061Date(fileSASSignatureValues.startsOn, false)\n : \"\",\n fileSASSignatureValues.expiresOn\n ? truncatedISO8061Date(fileSASSignatureValues.expiresOn, false)\n : \"\",\n getCanonicalName(\n sharedKeyCredential.accountName,\n fileSASSignatureValues.shareName,\n fileSASSignatureValues.filePath,\n ),\n fileSASSignatureValues.identifier,\n fileSASSignatureValues.ipRange ? ipRangeToString(fileSASSignatureValues.ipRange) : \"\",\n fileSASSignatureValues.protocol,\n version,\n fileSASSignatureValues.cacheControl,\n fileSASSignatureValues.contentDisposition,\n fileSASSignatureValues.contentEncoding,\n fileSASSignatureValues.contentLanguage,\n fileSASSignatureValues.contentType,\n ].join(\"\\n\");\n\n const signature = sharedKeyCredential.computeHMACSHA256(stringToSign);\n\n return {\n sasQueryParameters: new SASQueryParameters(\n version,\n signature,\n verifiedPermissions,\n undefined,\n undefined,\n fileSASSignatureValues.protocol,\n fileSASSignatureValues.startsOn,\n fileSASSignatureValues.expiresOn,\n fileSASSignatureValues.ipRange,\n fileSASSignatureValues.identifier,\n resource,\n fileSASSignatureValues.cacheControl,\n fileSASSignatureValues.contentDisposition,\n fileSASSignatureValues.contentEncoding,\n fileSASSignatureValues.contentLanguage,\n fileSASSignatureValues.contentType,\n ),\n stringToSign: stringToSign,\n };\n}\n\nfunction getCanonicalName(accountName: string, shareName: string, filePath?: string): string {\n // Share: \"/file/account/sharename\"\n // File: \"/file/account/sharename/filename\"\n // File: \"/file/account/sharename/directoryname/filename\"\n const elements: string[] = [`/file/${accountName}/${shareName}`];\n if (filePath) {\n elements.push(`/${filePath}`);\n }\n return elements.join(\"\");\n}\n"]}
1
+ {"version":3,"file":"FileSASSignatureValues.js","sourceRoot":"","sources":["../../src/FileSASSignatureValues.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AA8GlC,wEAMC;AAED,wFAiFC;AApMD,mEAA6D;AAE7D,mDAAkD;AAElD,mEAA6D;AAC7D,qEAA+D;AAC/D,uDAAuD;AACvD,6DAA+D;AAqF/D;;;;;;;;;;;;;;GAcG;AACH,SAAgB,8BAA8B,CAC5C,sBAA8C,EAC9C,mBAA+C;IAE/C,OAAO,sCAAsC,CAAC,sBAAsB,EAAE,mBAAmB,CAAC;SACvF,kBAAkB,CAAC;AACxB,CAAC;AAED,SAAgB,sCAAsC,CACpD,sBAA8C,EAC9C,mBAA+C;IAE/C,IACE,CAAC,sBAAsB,CAAC,UAAU;QAClC,CAAC,CAAC,sBAAsB,CAAC,WAAW,IAAI,sBAAsB,CAAC,SAAS,CAAC,EACzE,CAAC;QACD,MAAM,IAAI,UAAU,CAClB,uGAAuG,CACxG,CAAC;IACJ,CAAC;IAED,MAAM,OAAO,GAAG,sBAAsB,CAAC,OAAO,CAAC,CAAC,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC,CAAC,8BAAe,CAAC;IAClG,IAAI,QAAQ,GAAW,GAAG,CAAC;IAC3B,IAAI,sBAAsB,CAAC,QAAQ,EAAE,CAAC;QACpC,QAAQ,GAAG,GAAG,CAAC;IACjB,CAAC;IAED,IAAI,mBAAuC,CAAC;IAC5C,8FAA8F;IAC9F,IAAI,sBAAsB,CAAC,WAAW,EAAE,CAAC;QACvC,IAAI,sBAAsB,CAAC,QAAQ,EAAE,CAAC;YACpC,mBAAmB,GAAG,0CAAkB,CAAC,KAAK,CAC5C,sBAAsB,CAAC,WAAW,CAAC,QAAQ,EAAE,CAC9C,CAAC,QAAQ,EAAE,CAAC;QACf,CAAC;aAAM,CAAC;YACN,mBAAm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BAAsB,CAAC,YAAY,EACnC,sBAAsB,CAAC,kBAAkB,EACzC,sBAAsB,CAAC,eAAe,EACtC,sBAAsB,CAAC,eAAe,EACtC,sBAAsB,CAAC,WAAW,CACnC;QACD,YAAY,EAAE,YAAY;KAC3B,CAAC;AACJ,CAAC;AAED,SAAS,gBAAgB,CAAC,WAAmB,EAAE,SAAiB,EAAE,QAAiB;IACjF,mCAAmC;IACnC,4CAA4C;IAC5C,0DAA0D;IAC1D,MAAM,QAAQ,GAAa,CAAC,SAAS,WAAW,IAAI,SAAS,EAAE,CAAC,CAAC;IACjE,IAAI,QAAQ,EAAE,CAAC;QACb,QAAQ,CAAC,IAAI,CAAC,IAAI,QAAQ,EAAE,CAAC,CAAC;IAChC,CAAC;IACD,OAAO,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC3B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { StorageSharedKeyCredential } from \"@azure/storage-common\";\nimport { FileSASPermissions } from \"./FileSASPermissions.js\";\nimport type { SasIPRange } from \"./SasIPRange.js\";\nimport { ipRangeToString } from \"./SasIPRange.js\";\nimport type { SASProtocol } from \"./SASQueryParameters.js\";\nimport { SASQueryParameters } from \"./SASQueryParameters.js\";\nimport { ShareSASPermissions } from \"./ShareSASPermissions.js\";\nimport { SERVICE_VERSION } from \"./utils/constants.js\";\nimport { truncatedISO8061Date } from \"./utils/utils.common.js\";\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * FileSASSignatureValues is used to help generating File service SAS tokens for shares or files.\n */\n\nexport interface FileSASSignatureValues {\n /**\n * The version of the service this SAS will target. If not specified, it will default to the version targeted by the\n * library.\n */\n version?: string;\n\n /**\n * Optional. SAS protocols, HTTPS only or HTTPSandHTTP\n */\n protocol?: SASProtocol;\n\n /**\n * Optional. When the SAS will take effect.\n */\n startsOn?: Date;\n\n /**\n * Optional only when identifier is provided. The time after which the SAS will no longer work.\n */\n expiresOn?: Date;\n\n /**\n * Optional only when identifier is provided.\n * Please refer to either {@link ShareSASPermissions} or {@link FileSASPermissions} depending on the resource\n * being accessed for help constructing the permissions string.\n */\n permissions?: FileSASPermissions | ShareSASPermissions;\n\n /**\n * Optional. IP ranges allowed in this SAS.\n */\n ipRange?: SasIPRange;\n\n /**\n * The name of the share the SAS user may access.\n */\n shareName: string;\n\n /**\n * Optional. The path of the file like, \"directory/FileName\" or \"FileName\".\n */\n filePath?: string;\n\n /**\n * Optional. The name of the access policy on the share this SAS references if any.\n *\n * @see https://learn.microsoft.com/rest/api/storageservices/establishing-a-stored-access-policy\n */\n identifier?: string;\n\n /**\n * Optional. The cache-control header for the SAS.\n */\n cacheControl?: string;\n\n /**\n * Optional. The content-disposition header for the SAS.\n */\n contentDisposition?: string;\n\n /**\n * Optional. The content-encoding header for the SAS.\n */\n contentEncoding?: string;\n\n /**\n * Optional. The content-language header for the SAS.\n */\n contentLanguage?: string;\n\n /**\n * Optional. The content-type header for the SAS.\n */\n contentType?: string;\n}\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * Creates an instance of SASQueryParameters.\n *\n * Only accepts required settings needed to create a SAS. For optional settings please\n * set corresponding properties directly, such as permissions, startsOn and identifier.\n *\n * WARNING: When identifier is not provided, permissions and expiresOn are required.\n * You MUST assign value to identifier or expiresOn & permissions manually if you initial with\n * this constructor.\n *\n * @param fileSASSignatureValues -\n * @param sharedKeyCredential -\n */\nexport function generateFileSASQueryParameters(\n fileSASSignatureValues: FileSASSignatureValues,\n sharedKeyCredential: StorageSharedKeyCredential,\n): SASQueryParameters {\n return generateFileSASQueryParametersInternal(fileSASSignatureValues, sharedKeyCredential)\n .sasQueryParameters;\n}\n\nexport function generateFileSASQueryParametersInternal(\n fileSASSignatureValues: FileSASSignatureValues,\n sharedKeyCredential: StorageSharedKeyCredential,\n): { sasQueryParameters: SASQueryParameters; stringToSign: string } {\n if (\n !fileSASSignatureValues.identifier &&\n !(fileSASSignatureValues.permissions && fileSASSignatureValues.expiresOn)\n ) {\n throw new RangeError(\n \"Must provide 'permissions' and 'expiresOn' for File SAS generation when 'identifier' is not provided.\",\n );\n }\n\n const version = fileSASSignatureValues.version ? fileSASSignatureValues.version : SERVICE_VERSION;\n let resource: string = \"s\";\n if (fileSASSignatureValues.filePath) {\n resource = \"f\";\n }\n\n let verifiedPermissions: string | undefined;\n // Calling parse and toString guarantees the proper ordering and throws on invalid characters.\n if (fileSASSignatureValues.permissions) {\n if (fileSASSignatureValues.filePath) {\n verifiedPermissions = FileSASPermissions.parse(\n fileSASSignatureValues.permissions.toString(),\n ).toString();\n } else {\n verifiedPermissions = ShareSASPermissions.parse(\n fileSASSignatureValues.permissions.toString(),\n ).toString();\n }\n }\n\n // Signature is generated on the un-url-encoded values.\n const stringToSign = [\n verifiedPermissions,\n fileSASSignatureValues.startsOn\n ? truncatedISO8061Date(fileSASSignatureValues.startsOn, false)\n : \"\",\n fileSASSignatureValues.expiresOn\n ? truncatedISO8061Date(fileSASSignatureValues.expiresOn, false)\n : \"\",\n getCanonicalName(\n sharedKeyCredential.accountName,\n fileSASSignatureValues.shareName,\n fileSASSignatureValues.filePath,\n ),\n fileSASSignatureValues.identifier,\n fileSASSignatureValues.ipRange ? ipRangeToString(fileSASSignatureValues.ipRange) : \"\",\n fileSASSignatureValues.protocol,\n version,\n fileSASSignatureValues.cacheControl,\n fileSASSignatureValues.contentDisposition,\n fileSASSignatureValues.contentEncoding,\n fileSASSignatureValues.contentLanguage,\n fileSASSignatureValues.contentType,\n ].join(\"\\n\");\n\n const signature = sharedKeyCredential.computeHMACSHA256(stringToSign);\n\n return {\n sasQueryParameters: new SASQueryParameters(\n version,\n signature,\n verifiedPermissions,\n undefined,\n undefined,\n fileSASSignatureValues.protocol,\n fileSASSignatureValues.startsOn,\n fileSASSignatureValues.expiresOn,\n fileSASSignatureValues.ipRange,\n fileSASSignatureValues.identifier,\n resource,\n fileSASSignatureValues.cacheControl,\n fileSASSignatureValues.contentDisposition,\n fileSASSignatureValues.contentEncoding,\n fileSASSignatureValues.contentLanguage,\n fileSASSignatureValues.contentType,\n ),\n stringToSign: stringToSign,\n };\n}\n\nfunction getCanonicalName(accountName: string, shareName: string, filePath?: string): string {\n // Share: \"/file/account/sharename\"\n // File: \"/file/account/sharename/filename\"\n // File: \"/file/account/sharename/directoryname/filename\"\n const elements: string[] = [`/file/${accountName}/${shareName}`];\n if (filePath) {\n elements.push(`/${filePath}`);\n }\n return elements.join(\"\");\n}\n"]}
@@ -8,51 +8,6 @@ exports.FileSystemAttributes = void 0;
8
8
  * @see https://learn.microsoft.com/rest/api/storageservices/create-file#file-system-attributes
9
9
  */
10
10
  class FileSystemAttributes {
11
- constructor() {
12
- /**
13
- * Specifies a directory or file that is read-only.
14
- */
15
- this.readonly = false;
16
- /**
17
- * Specifies a directory or file is hidden.
18
- */
19
- this.hidden = false;
20
- /**
21
- * Specifies a directory or file that the operating system uses a part of, or uses exclusively.
22
- */
23
- this.system = false;
24
- /**
25
- * Specifies a directory or file that does not have other attributes set. This attribute is valid only when used alone.
26
- */
27
- this.none = false;
28
- /**
29
- * Specifies the handle identifies a directory.
30
- */
31
- this.directory = false;
32
- /**
33
- * Specifies a directory or file is an archive. Applications typically use this attribute to mark files for backup or removal.
34
- */
35
- this.archive = false;
36
- /**
37
- * Specifies if a file is temporary.
38
- */
39
- this.temporary = false;
40
- /**
41
- * Specifies the data of a directory or file is not available immediately.
42
- * This file system attribute is presented primarily to provide compatibility with Windows - Azure Files does not support with offline storage options.
43
- */
44
- this.offline = false;
45
- /**
46
- * Specifies the directory or file is not to be indexed by the content indexing service.
47
- */
48
- this.notContentIndexed = false;
49
- /**
50
- * Specifies the user data stream not to be read by the background data integrity scanner.
51
- * This file system attribute is presented primarily to provide compatibility with Windows.
52
- * Applicable to directory or file.
53
- */
54
- this.noScrubData = false;
55
- }
56
11
  /**
57
12
  * Creates a FileSystemAttributes from the specified attributes string. This method will throw an
58
13
  * Error if it encounters a string that does not correspond to a valid attributes.
@@ -104,6 +59,49 @@ class FileSystemAttributes {
104
59
  }
105
60
  return fileSystemAttributes;
106
61
  }
62
+ /**
63
+ * Specifies a directory or file that is read-only.
64
+ */
65
+ readonly = false;
66
+ /**
67
+ * Specifies a directory or file is hidden.
68
+ */
69
+ hidden = false;
70
+ /**
71
+ * Specifies a directory or file that the operating system uses a part of, or uses exclusively.
72
+ */
73
+ system = false;
74
+ /**
75
+ * Specifies a directory or file that does not have other attributes set. This attribute is valid only when used alone.
76
+ */
77
+ none = false;
78
+ /**
79
+ * Specifies the handle identifies a directory.
80
+ */
81
+ directory = false;
82
+ /**
83
+ * Specifies a directory or file is an archive. Applications typically use this attribute to mark files for backup or removal.
84
+ */
85
+ archive = false;
86
+ /**
87
+ * Specifies if a file is temporary.
88
+ */
89
+ temporary = false;
90
+ /**
91
+ * Specifies the data of a directory or file is not available immediately.
92
+ * This file system attribute is presented primarily to provide compatibility with Windows - Azure Files does not support with offline storage options.
93
+ */
94
+ offline = false;
95
+ /**
96
+ * Specifies the directory or file is not to be indexed by the content indexing service.
97
+ */
98
+ notContentIndexed = false;
99
+ /**
100
+ * Specifies the user data stream not to be read by the background data integrity scanner.
101
+ * This file system attribute is presented primarily to provide compatibility with Windows.
102
+ * Applicable to directory or file.
103
+ */
104
+ noScrubData = false;
107
105
  /**
108
106
  * Converts the given attributes to a string.
109
107
  *
@@ -1 +1 @@
1
- {"version":3,"file":"FileSystemAttributes.js","sourceRoot":"","sources":["../../src/FileSystemAttributes.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC;;;GAGG;AACH,MAAa,oBAAoB;IAAjC;QAyDE;;WAEG;QACI,aAAQ,GAAY,KAAK,CAAC;QAEjC;;WAEG;QACI,WAAM,GAAY,KAAK,CAAC;QAE/B;;WAEG;QACI,WAAM,GAAY,KAAK,CAAC;QAE/B;;WAEG;QACI,SAAI,GAAY,KAAK,CAAC;QAE7B;;WAEG;QACI,cAAS,GAAY,KA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QACD,IAAI,IAAI,CAAC,iBAAiB,EAAE,CAAC;YAC3B,UAAU,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;QACvC,CAAC;QACD,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACrB,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACjC,CAAC;QACD,OAAO,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC9B,CAAC;CACF;AArJD,oDAqJC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * This is a helper class to construct a string representing the NTFS attributes to a file or directory.\n * @see https://learn.microsoft.com/rest/api/storageservices/create-file#file-system-attributes\n */\nexport class FileSystemAttributes {\n /**\n * Creates a FileSystemAttributes from the specified attributes string. This method will throw an\n * Error if it encounters a string that does not correspond to a valid attributes.\n *\n * @param fileAttributes - The value of header x-ms-file-attributes.\n */\n public static parse(fileAttributes: string): FileSystemAttributes {\n if (!fileAttributes) {\n throw new RangeError(`Invalid fileAttributes: '${fileAttributes}'.`);\n }\n\n const fileSystemAttributes = new FileSystemAttributes();\n\n const attributes = fileAttributes.trim().split(\"|\");\n\n for (let str of attributes) {\n str = str.trim();\n switch (str) {\n case \"ReadOnly\":\n fileSystemAttributes.readonly = true;\n break;\n case \"Hidden\":\n fileSystemAttributes.hidden = true;\n break;\n case \"System\":\n fileSystemAttributes.system = true;\n break;\n case \"None\":\n fileSystemAttributes.none = true;\n break;\n case \"Temporary\":\n fileSystemAttributes.temporary = true;\n break;\n case \"Offline\":\n fileSystemAttributes.offline = true;\n break;\n case \"Directory\":\n fileSystemAttributes.directory = true;\n break;\n case \"Archive\":\n fileSystemAttributes.archive = true;\n break;\n case \"NotContentIndexed\":\n fileSystemAttributes.notContentIndexed = true;\n break;\n case \"NoScrubData\":\n fileSystemAttributes.noScrubData = true;\n break;\n default:\n throw new RangeError(`Invalid attribute: ${str}`);\n }\n }\n\n return fileSystemAttributes;\n }\n\n /**\n * Specifies a directory or file that is read-only.\n */\n public readonly: boolean = false;\n\n /**\n * Specifies a directory or file is hidden.\n */\n public hidden: boolean = false;\n\n /**\n * Specifies a directory or file that the operating system uses a part of, or uses exclusively.\n */\n public system: boolean = false;\n\n /**\n * Specifies a directory or file that does not have other attributes set. This attribute is valid only when used alone.\n */\n public none: boolean = false;\n\n /**\n * Specifies the handle identifies a directory.\n */\n public directory: boolean = false;\n\n /**\n * Specifies a directory or file is an archive. Applications typically use this attribute to mark files for backup or removal.\n */\n public archive: boolean = false;\n\n /**\n * Specifies if a file is temporary.\n */\n public temporary: boolean = false;\n\n /**\n * Specifies the data of a directory or file is not available immediately.\n * This file system attribute is presented primarily to provide compatibility with Windows - Azure Files does not support with offline storage options.\n */\n public offline: boolean = false;\n\n /**\n * Specifies the directory or file is not to be indexed by the content indexing service.\n */\n public notContentIndexed: boolean = false;\n\n /**\n * Specifies the user data stream not to be read by the background data integrity scanner.\n * This file system attribute is presented primarily to provide compatibility with Windows.\n * Applicable to directory or file.\n */\n public noScrubData: boolean = false;\n\n /**\n * Converts the given attributes to a string.\n *\n * @returns A string which represents the FileSystemAttributes\n */\n public toString(): string {\n const attributes: string[] = [];\n if (this.readonly) {\n attributes.push(\"ReadOnly\");\n }\n if (this.hidden) {\n attributes.push(\"Hidden\");\n }\n if (this.system) {\n attributes.push(\"System\");\n }\n if (this.none) {\n attributes.push(\"None\");\n }\n if (this.temporary) {\n attributes.push(\"Temporary\");\n }\n if (this.directory) {\n attributes.push(\"Directory\");\n }\n if (this.archive) {\n attributes.push(\"Archive\");\n }\n if (this.offline) {\n attributes.push(\"Offline\");\n }\n if (this.notContentIndexed) {\n attributes.push(\"NotContentIndexed\");\n }\n if (this.noScrubData) {\n attributes.push(\"NoScrubData\");\n }\n return attributes.join(\"|\");\n }\n}\n"]}
1
+ {"version":3,"file":"FileSystemAttributes.js","sourceRoot":"","sources":["../../src/FileSystemAttributes.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;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,CAAC;QAC/B,CAAC;QACD,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC7B,CAAC;QACD,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC7B,CAAC;QACD,IAAI,IAAI,CAAC,iBAAiB,EAAE,CAAC;YAC3B,UAAU,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;QACvC,CAAC;QACD,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACrB,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACjC,CAAC;QACD,OAAO,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC9B,CAAC;CACF;AArJD,oDAqJC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * This is a helper class to construct a string representing the NTFS attributes to a file or directory.\n * @see https://learn.microsoft.com/rest/api/storageservices/create-file#file-system-attributes\n */\nexport class FileSystemAttributes {\n /**\n * Creates a FileSystemAttributes from the specified attributes string. This method will throw an\n * Error if it encounters a string that does not correspond to a valid attributes.\n *\n * @param fileAttributes - The value of header x-ms-file-attributes.\n */\n public static parse(fileAttributes: string): FileSystemAttributes {\n if (!fileAttributes) {\n throw new RangeError(`Invalid fileAttributes: '${fileAttributes}'.`);\n }\n\n const fileSystemAttributes = new FileSystemAttributes();\n\n const attributes = fileAttributes.trim().split(\"|\");\n\n for (let str of attributes) {\n str = str.trim();\n switch (str) {\n case \"ReadOnly\":\n fileSystemAttributes.readonly = true;\n break;\n case \"Hidden\":\n fileSystemAttributes.hidden = true;\n break;\n case \"System\":\n fileSystemAttributes.system = true;\n break;\n case \"None\":\n fileSystemAttributes.none = true;\n break;\n case \"Temporary\":\n fileSystemAttributes.temporary = true;\n break;\n case \"Offline\":\n fileSystemAttributes.offline = true;\n break;\n case \"Directory\":\n fileSystemAttributes.directory = true;\n break;\n case \"Archive\":\n fileSystemAttributes.archive = true;\n break;\n case \"NotContentIndexed\":\n fileSystemAttributes.notContentIndexed = true;\n break;\n case \"NoScrubData\":\n fileSystemAttributes.noScrubData = true;\n break;\n default:\n throw new RangeError(`Invalid attribute: ${str}`);\n }\n }\n\n return fileSystemAttributes;\n }\n\n /**\n * Specifies a directory or file that is read-only.\n */\n public readonly: boolean = false;\n\n /**\n * Specifies a directory or file is hidden.\n */\n public hidden: boolean = false;\n\n /**\n * Specifies a directory or file that the operating system uses a part of, or uses exclusively.\n */\n public system: boolean = false;\n\n /**\n * Specifies a directory or file that does not have other attributes set. This attribute is valid only when used alone.\n */\n public none: boolean = false;\n\n /**\n * Specifies the handle identifies a directory.\n */\n public directory: boolean = false;\n\n /**\n * Specifies a directory or file is an archive. Applications typically use this attribute to mark files for backup or removal.\n */\n public archive: boolean = false;\n\n /**\n * Specifies if a file is temporary.\n */\n public temporary: boolean = false;\n\n /**\n * Specifies the data of a directory or file is not available immediately.\n * This file system attribute is presented primarily to provide compatibility with Windows - Azure Files does not support with offline storage options.\n */\n public offline: boolean = false;\n\n /**\n * Specifies the directory or file is not to be indexed by the content indexing service.\n */\n public notContentIndexed: boolean = false;\n\n /**\n * Specifies the user data stream not to be read by the background data integrity scanner.\n * This file system attribute is presented primarily to provide compatibility with Windows.\n * Applicable to directory or file.\n */\n public noScrubData: boolean = false;\n\n /**\n * Converts the given attributes to a string.\n *\n * @returns A string which represents the FileSystemAttributes\n */\n public toString(): string {\n const attributes: string[] = [];\n if (this.readonly) {\n attributes.push(\"ReadOnly\");\n }\n if (this.hidden) {\n attributes.push(\"Hidden\");\n }\n if (this.system) {\n attributes.push(\"System\");\n }\n if (this.none) {\n attributes.push(\"None\");\n }\n if (this.temporary) {\n attributes.push(\"Temporary\");\n }\n if (this.directory) {\n attributes.push(\"Directory\");\n }\n if (this.archive) {\n attributes.push(\"Archive\");\n }\n if (this.offline) {\n attributes.push(\"Offline\");\n }\n if (this.notContentIndexed) {\n attributes.push(\"NotContentIndexed\");\n }\n if (this.noScrubData) {\n attributes.push(\"NoScrubData\");\n }\n return attributes.join(\"|\");\n }\n}\n"]}
@@ -3,10 +3,8 @@ import { CompatResponse as HttpOperationResponse, RequestPolicy as IHttpClient,
3
3
  import type { ProxySettings as ProxyOptions, UserAgentPolicyOptions as UserAgentOptions } from "@azure/core-rest-pipeline";
4
4
  import { RequestBodyType as HttpRequestBody } from "@azure/core-rest-pipeline";
5
5
  import type { TokenCredential } from "@azure/core-auth";
6
- import type { StorageRetryOptions } from "./StorageRetryPolicyFactory.js";
7
- import { StorageSharedKeyCredential } from "@azure/storage-blob";
8
- import { AnonymousCredential } from "@azure/storage-blob";
9
- import type { Credential } from "@azure/storage-blob";
6
+ import type { Credential, StorageRetryOptions } from "@azure/storage-common";
7
+ import { AnonymousCredential, StorageSharedKeyCredential } from "@azure/storage-common";
10
8
  import { StorageOAuthScopes } from "./utils/constants.js";
11
9
  import type { ShareTokenIntent } from "./generatedModels.js";
12
10
  export { StorageOAuthScopes, IHttpClient, HttpHeaders, HttpRequestBody, HttpOperationResponse, WebResource, RequestPolicyFactory, RequestPolicy, RequestPolicyOptions, };
@@ -1 +1 @@
1
- {"version":3,"file":"Pipeline.d.ts","sourceRoot":"","sources":["../../src/Pipeline.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,gBAAgB,EAChB,4BAA4B,EAE7B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,cAAc,IAAI,qBAAqB,EACvC,aAAa,IAAI,WAAW,EAC5B,eAAe,IAAI,WAAW,EAC9B,aAAa,EACb,oBAAoB,EACpB,wBAAwB,IAAI,oBAAoB,EAChD,eAAe,IAAI,WAAW,EAG/B,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EACV,aAAa,IAAI,YAAY,EAC7B,sBAAsB,IAAI,gBAAgB,EAI3C,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,eAAe,IAAI,eAAe,EAGn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sB,IAAI,oBAAoB,CAAC;CAChD;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,YAAY,CAY1E;AAED;;;;;;;GAOG;AACH,qBAAa,QAAS,YAAW,YAAY;IAC3C;;OAEG;IACH,SAAgB,SAAS,EAAE,oBAAoB,EAAE,CAAC;IAClD;;OAEG;IACH,SAAgB,OAAO,EAAE,eAAe,CAAC;IAEzC;;;;;OAKG;gBACS,SAAS,EAAE,oBAAoB,EAAE,EAAE,OAAO,GAAE,eAAoB;IAK5E;;;;;OAKG;IACI,sBAAsB,IAAI,oBAAoB;CAMtD;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B;;OAEG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC;;OAEG;IACH,YAAY,CAAC,EAAE,mBAAmB,CAAC;IACnC;;OAEG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC;;OAEG;IACH,UAAU,CAAC,EAAE,WAAW,CAAC;IACzB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CACzB,UAAU,CAAC,EAAE,UAAU,GAAG,eAAe,EACzC,eAAe,GAAE,sBAA2B,GAC3C,QAAQ,CAOV;AA8BD,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,YAAY,GAAG,4BAA4B,CAuFzF;AAED,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,YAAY,GACrB,0BAA0B,GAAG,mBAAmB,GAAG,eAAe,CAiBpE"}
@@ -7,24 +7,15 @@ exports.isPipelineLike = isPipelineLike;
7
7
  exports.newPipeline = newPipeline;
8
8
  exports.getCoreClientOptions = getCoreClientOptions;
9
9
  exports.getCredentialFromPipeline = getCredentialFromPipeline;
10
- const tslib_1 = require("tslib");
11
10
  const core_http_compat_1 = require("@azure/core-http-compat");
12
11
  const core_rest_pipeline_1 = require("@azure/core-rest-pipeline");
13
12
  const core_client_1 = require("@azure/core-client");
14
13
  const core_xml_1 = require("@azure/core-xml");
15
14
  const core_auth_1 = require("@azure/core-auth");
16
15
  const log_js_1 = require("./log.js");
17
- const StorageRetryPolicyFactory_js_1 = require("./StorageRetryPolicyFactory.js");
18
- const storage_blob_1 = require("@azure/storage-blob");
19
- const storage_blob_2 = require("@azure/storage-blob");
16
+ const storage_common_1 = require("@azure/storage-common");
20
17
  const constants_js_1 = require("./utils/constants.js");
21
18
  Object.defineProperty(exports, "StorageOAuthScopes", { enumerable: true, get: function () { return constants_js_1.StorageOAuthScopes; } });
22
- const storage_common_1 = require("@azure/storage-common");
23
- const storage_blob_3 = require("@azure/storage-blob");
24
- const StorageRetryPolicyV2_js_1 = require("./policies/StorageRetryPolicyV2.js");
25
- const storage_blob_4 = require("@azure/storage-blob");
26
- const storage_blob_5 = require("@azure/storage-blob");
27
- const storage_blob_6 = require("@azure/storage-blob");
28
19
  /**
29
20
  * A helper to decide if a given argument satisfies the Pipeline contract
30
21
  * @param pipeline - An argument that may be a Pipeline
@@ -48,6 +39,14 @@ function isPipelineLike(pipeline) {
48
39
  * customized Pipeline.
49
40
  */
50
41
  class Pipeline {
42
+ /**
43
+ * A list of chained request policy factories.
44
+ */
45
+ factories;
46
+ /**
47
+ * Configures pipeline logger and HTTP client.
48
+ */
49
+ options;
51
50
  /**
52
51
  * Creates an instance of Pipeline. Customize HTTPClient by implementing IHttpClient interface.
53
52
  *
@@ -81,7 +80,7 @@ exports.Pipeline = Pipeline;
81
80
  */
82
81
  function newPipeline(credential, pipelineOptions = {}) {
83
82
  if (!credential) {
84
- credential = new storage_blob_2.AnonymousCredential();
83
+ credential = new storage_common_1.AnonymousCredential();
85
84
  }
86
85
  const pipeline = new Pipeline([], pipelineOptions);
87
86
  pipeline._credential = credential;
@@ -113,8 +112,7 @@ function processDownlevelPipeline(pipeline) {
113
112
  return undefined;
114
113
  }
115
114
  function getCoreClientOptions(pipeline) {
116
- var _a;
117
- const _b = pipeline.options, { httpClient: v1Client } = _b, restOptions = tslib_1.__rest(_b, ["httpClient"]);
115
+ const { httpClient: v1Client, ...restOptions } = pipeline.options;
118
116
  let httpClient = pipeline._coreHttpClient;
119
117
  if (!httpClient) {
120
118
  httpClient = v1Client ? (0, core_http_compat_1.convertHttpClient)(v1Client) : (0, storage_common_1.getCachedDefaultHttpClient)();
@@ -126,13 +124,17 @@ function getCoreClientOptions(pipeline) {
126
124
  const userAgentPrefix = restOptions.userAgentOptions && restOptions.userAgentOptions.userAgentPrefix
127
125
  ? `${restOptions.userAgentOptions.userAgentPrefix} ${packageDetails}`
128
126
  : `${packageDetails}`;
129
- corePipeline = (0, core_client_1.createClientPipeline)(Object.assign(Object.assign({}, restOptions), { loggingOptions: {
127
+ corePipeline = (0, core_client_1.createClientPipeline)({
128
+ ...restOptions,
129
+ loggingOptions: {
130
130
  additionalAllowedHeaderNames: constants_js_1.StorageFileLoggingAllowedHeaderNames,
131
131
  additionalAllowedQueryParameters: constants_js_1.StorageFileLoggingAllowedQueryParameters,
132
132
  logger: log_js_1.logger.info,
133
- }, userAgentOptions: {
133
+ },
134
+ userAgentOptions: {
134
135
  userAgentPrefix,
135
- }, serializationOptions: {
136
+ },
137
+ serializationOptions: {
136
138
  stringifyXML: core_xml_1.stringifyXML,
137
139
  serializerOptions: {
138
140
  xml: {
@@ -141,7 +143,8 @@ function getCoreClientOptions(pipeline) {
141
143
  xmlCharKey: "#",
142
144
  },
143
145
  },
144
- }, deserializationOptions: {
146
+ },
147
+ deserializationOptions: {
145
148
  parseXML: core_xml_1.parseXML,
146
149
  serializerOptions: {
147
150
  xml: {
@@ -150,13 +153,14 @@ function getCoreClientOptions(pipeline) {
150
153
  xmlCharKey: "#",
151
154
  },
152
155
  },
153
- } }));
156
+ },
157
+ });
154
158
  corePipeline.removePolicy({ phase: "Retry" });
155
159
  corePipeline.removePolicy({ name: core_rest_pipeline_1.decompressResponsePolicyName });
156
- corePipeline.addPolicy((0, storage_blob_6.storageCorrectContentLengthPolicy)());
157
- corePipeline.addPolicy((0, StorageRetryPolicyV2_js_1.storageRetryPolicy)(restOptions.retryOptions), { phase: "Retry" });
160
+ corePipeline.addPolicy((0, storage_common_1.storageCorrectContentLengthPolicy)());
161
+ corePipeline.addPolicy((0, storage_common_1.storageRetryPolicy)(restOptions.retryOptions), { phase: "Retry" });
158
162
  corePipeline.addPolicy((0, storage_common_1.storageRequestFailureDetailsParserPolicy)());
159
- corePipeline.addPolicy((0, storage_blob_3.storageBrowserPolicy)());
163
+ corePipeline.addPolicy((0, storage_common_1.storageBrowserPolicy)());
160
164
  const downlevelResults = processDownlevelPipeline(pipeline);
161
165
  if (downlevelResults) {
162
166
  corePipeline.addPolicy(downlevelResults.wrappedPolicies, downlevelResults.afterRetry ? { afterPhase: "Retry" } : undefined);
@@ -165,19 +169,24 @@ function getCoreClientOptions(pipeline) {
165
169
  if ((0, core_auth_1.isTokenCredential)(credential)) {
166
170
  corePipeline.addPolicy((0, core_rest_pipeline_1.bearerTokenAuthenticationPolicy)({
167
171
  credential,
168
- scopes: (_a = restOptions.audience) !== null && _a !== void 0 ? _a : constants_js_1.StorageOAuthScopes,
172
+ scopes: restOptions.audience ?? constants_js_1.StorageOAuthScopes,
169
173
  challengeCallbacks: { authorizeRequestOnChallenge: core_client_1.authorizeRequestOnTenantChallenge },
170
174
  }), { phase: "Sign" });
171
175
  }
172
- else if (credential instanceof storage_blob_1.StorageSharedKeyCredential) {
173
- corePipeline.addPolicy((0, storage_blob_4.storageSharedKeyCredentialPolicy)({
176
+ else if (credential instanceof storage_common_1.StorageSharedKeyCredential) {
177
+ corePipeline.addPolicy((0, storage_common_1.storageSharedKeyCredentialPolicy)({
174
178
  accountName: credential.accountName,
175
179
  accountKey: credential.accountKey,
176
180
  }), { phase: "Sign" });
177
181
  }
178
182
  pipeline._corePipeline = corePipeline;
179
183
  }
180
- return Object.assign(Object.assign({}, restOptions), { allowInsecureConnection: true, httpClient, pipeline: corePipeline });
184
+ return {
185
+ ...restOptions,
186
+ allowInsecureConnection: true,
187
+ httpClient,
188
+ pipeline: corePipeline,
189
+ };
181
190
  }
182
191
  function getCredentialFromPipeline(pipeline) {
183
192
  // see if we squirreled one away on the type itself
@@ -185,7 +194,7 @@ function getCredentialFromPipeline(pipeline) {
185
194
  return pipeline._credential;
186
195
  }
187
196
  // if it came from another package, loop over the factories and look for one like before
188
- let credential = new storage_blob_2.AnonymousCredential();
197
+ let credential = new storage_common_1.AnonymousCredential();
189
198
  for (const factory of pipeline.factories) {
190
199
  if ((0, core_auth_1.isTokenCredential)(factory.credential)) {
191
200
  // Only works if the factory has been attached a "credential" property.
@@ -199,13 +208,13 @@ function getCredentialFromPipeline(pipeline) {
199
208
  return credential;
200
209
  }
201
210
  function isStorageSharedKeyCredential(factory) {
202
- if (factory instanceof storage_blob_1.StorageSharedKeyCredential) {
211
+ if (factory instanceof storage_common_1.StorageSharedKeyCredential) {
203
212
  return true;
204
213
  }
205
214
  return factory.constructor.name === "StorageSharedKeyCredential";
206
215
  }
207
216
  function isAnonymousCredential(factory) {
208
- if (factory instanceof storage_blob_2.AnonymousCredential) {
217
+ if (factory instanceof storage_common_1.AnonymousCredential) {
209
218
  return true;
210
219
  }
211
220
  return factory.constructor.name === "AnonymousCredential";
@@ -214,13 +223,13 @@ function isCoreHttpBearerTokenFactory(factory) {
214
223
  return (0, core_auth_1.isTokenCredential)(factory.credential);
215
224
  }
216
225
  function isStorageBrowserPolicyFactory(factory) {
217
- if (factory instanceof storage_blob_5.StorageBrowserPolicyFactory) {
226
+ if (factory instanceof storage_common_1.StorageBrowserPolicyFactory) {
218
227
  return true;
219
228
  }
220
229
  return factory.constructor.name === "StorageBrowserPolicyFactory";
221
230
  }
222
231
  function isStorageRetryPolicyFactory(factory) {
223
- if (factory instanceof StorageRetryPolicyFactory_js_1.StorageRetryPolicyFactory) {
232
+ if (factory instanceof storage_common_1.StorageRetryPolicyFactory) {
224
233
  return true;
225
234
  }
226
235
  return factory.constructor.name === "StorageRetryPolicyFactory";