@azure/storage-common 12.0.0-beta.2 → 12.0.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 (378) hide show
  1. package/dist/browser/BuffersStream.js +14 -0
  2. package/dist/browser/BuffersStream.js.map +1 -1
  3. package/dist/browser/PooledBuffer.js +13 -5
  4. package/dist/browser/PooledBuffer.js.map +1 -1
  5. package/dist/browser/StorageBrowserPolicyFactory.d.ts +16 -0
  6. package/dist/browser/StorageBrowserPolicyFactory.d.ts.map +1 -0
  7. package/dist/browser/StorageBrowserPolicyFactory.js +19 -0
  8. package/dist/browser/StorageBrowserPolicyFactory.js.map +1 -0
  9. package/dist/browser/StorageRetryPolicyFactory.d.ts +66 -0
  10. package/dist/browser/StorageRetryPolicyFactory.d.ts.map +1 -0
  11. package/dist/browser/StorageRetryPolicyFactory.js +28 -0
  12. package/dist/browser/StorageRetryPolicyFactory.js.map +1 -0
  13. package/dist/browser/credentials/AnonymousCredential.d.ts +19 -0
  14. package/dist/browser/credentials/AnonymousCredential.d.ts.map +1 -0
  15. package/dist/browser/credentials/AnonymousCredential.js +22 -0
  16. package/dist/browser/credentials/AnonymousCredential.js.map +1 -0
  17. package/dist/browser/credentials/Credential.d.ts +20 -0
  18. package/dist/browser/credentials/Credential.d.ts.map +1 -0
  19. package/dist/browser/credentials/Credential.js +18 -0
  20. package/dist/browser/credentials/Credential.js.map +1 -0
  21. package/dist/browser/credentials/StorageSharedKeyCredential-browser.d.mts.map +1 -0
  22. package/dist/browser/credentials/StorageSharedKeyCredential-browser.mjs.map +1 -0
  23. package/dist/browser/credentials/StorageSharedKeyCredential.d.ts +3 -0
  24. package/dist/browser/credentials/StorageSharedKeyCredential.js +5 -0
  25. package/dist/browser/index-browser.d.mts.map +1 -0
  26. package/dist/browser/index-browser.mjs.map +1 -0
  27. package/dist/browser/index.d.ts +17 -1
  28. package/dist/browser/index.js +17 -1
  29. package/dist/browser/log.d.ts +5 -0
  30. package/dist/browser/log.d.ts.map +1 -0
  31. package/dist/browser/log.js +8 -0
  32. package/dist/browser/log.js.map +1 -0
  33. package/dist/browser/policies/AnonymousCredentialPolicy.d.ts +15 -0
  34. package/dist/browser/policies/AnonymousCredentialPolicy.d.ts.map +1 -0
  35. package/dist/browser/policies/AnonymousCredentialPolicy.js +20 -0
  36. package/dist/browser/policies/AnonymousCredentialPolicy.js.map +1 -0
  37. package/dist/browser/policies/CredentialPolicy.d.ts +22 -0
  38. package/dist/browser/policies/CredentialPolicy.d.ts.map +1 -0
  39. package/dist/browser/policies/CredentialPolicy.js +29 -0
  40. package/dist/browser/policies/CredentialPolicy.js.map +1 -0
  41. package/dist/browser/policies/RequestPolicy.d.ts +45 -0
  42. package/dist/browser/policies/RequestPolicy.d.ts.map +1 -0
  43. package/dist/browser/policies/RequestPolicy.js +42 -0
  44. package/dist/browser/policies/RequestPolicy.js.map +1 -0
  45. package/dist/browser/policies/StorageBrowserPolicy.d.ts +28 -0
  46. package/dist/browser/policies/StorageBrowserPolicy.d.ts.map +1 -0
  47. package/dist/browser/policies/StorageBrowserPolicy.js +47 -0
  48. package/dist/browser/policies/StorageBrowserPolicy.js.map +1 -0
  49. package/dist/browser/policies/StorageBrowserPolicyV2.d.ts +11 -0
  50. package/dist/browser/policies/StorageBrowserPolicyV2.d.ts.map +1 -0
  51. package/dist/browser/policies/StorageBrowserPolicyV2.js +31 -0
  52. package/dist/browser/policies/StorageBrowserPolicyV2.js.map +1 -0
  53. package/dist/browser/policies/StorageCorrectContentLengthPolicy-browser.d.mts.map +1 -0
  54. package/dist/browser/policies/StorageCorrectContentLengthPolicy-browser.mjs.map +1 -0
  55. package/dist/browser/policies/StorageCorrectContentLengthPolicy.d.ts +10 -0
  56. package/dist/browser/policies/StorageCorrectContentLengthPolicy.js +18 -0
  57. package/dist/browser/policies/StorageRetryPolicy.d.ts +62 -0
  58. package/dist/browser/policies/StorageRetryPolicy.d.ts.map +1 -0
  59. package/dist/browser/policies/StorageRetryPolicy.js +220 -0
  60. package/dist/browser/policies/StorageRetryPolicy.js.map +1 -0
  61. package/dist/browser/policies/StorageRetryPolicyType.d.ts +14 -0
  62. package/dist/browser/policies/StorageRetryPolicyType.d.ts.map +1 -0
  63. package/dist/browser/policies/StorageRetryPolicyType.js +17 -0
  64. package/dist/browser/policies/StorageRetryPolicyType.js.map +1 -0
  65. package/dist/browser/policies/StorageRetryPolicyV2.d.ts +11 -0
  66. package/dist/browser/policies/StorageRetryPolicyV2.d.ts.map +1 -0
  67. package/dist/browser/policies/StorageRetryPolicyV2.js +165 -0
  68. package/dist/browser/policies/StorageRetryPolicyV2.js.map +1 -0
  69. package/dist/browser/policies/StorageSharedKeyCredentialPolicy.d.ts +54 -0
  70. package/dist/browser/policies/StorageSharedKeyCredentialPolicy.d.ts.map +1 -0
  71. package/dist/browser/policies/StorageSharedKeyCredentialPolicy.js +145 -0
  72. package/dist/browser/policies/StorageSharedKeyCredentialPolicy.js.map +1 -0
  73. package/dist/browser/policies/StorageSharedKeyCredentialPolicyV2-browser.d.mts.map +1 -0
  74. package/dist/browser/policies/StorageSharedKeyCredentialPolicyV2-browser.mjs.map +1 -0
  75. package/dist/browser/policies/StorageSharedKeyCredentialPolicyV2.d.ts +17 -0
  76. package/dist/browser/policies/StorageSharedKeyCredentialPolicyV2.js +18 -0
  77. package/dist/browser/utils/SharedKeyComparator.d.ts +2 -0
  78. package/dist/browser/utils/SharedKeyComparator.d.ts.map +1 -0
  79. package/dist/browser/utils/SharedKeyComparator.js +73 -0
  80. package/dist/browser/utils/SharedKeyComparator.js.map +1 -0
  81. package/dist/browser/utils/constants.d.ts +39 -0
  82. package/dist/browser/utils/constants.d.ts.map +1 -0
  83. package/dist/browser/utils/constants.js +64 -0
  84. package/dist/browser/utils/constants.js.map +1 -0
  85. package/dist/browser/utils/tracing.d.ts +6 -0
  86. package/dist/browser/utils/tracing.d.ts.map +1 -0
  87. package/dist/browser/utils/tracing.js +14 -0
  88. package/dist/browser/utils/tracing.js.map +1 -0
  89. package/dist/browser/utils/utils.common.d.ts +305 -0
  90. package/dist/browser/utils/utils.common.d.ts.map +1 -0
  91. package/dist/browser/utils/utils.common.js +544 -0
  92. package/dist/browser/utils/utils.common.js.map +1 -0
  93. package/dist/commonjs/BufferScheduler.js +70 -44
  94. package/dist/commonjs/BufferScheduler.js.map +1 -1
  95. package/dist/commonjs/BuffersStream.js +14 -0
  96. package/dist/commonjs/BuffersStream.js.map +1 -1
  97. package/dist/commonjs/PooledBuffer.js +13 -5
  98. package/dist/commonjs/PooledBuffer.js.map +1 -1
  99. package/dist/commonjs/StorageBrowserPolicyFactory.d.ts +16 -0
  100. package/dist/commonjs/StorageBrowserPolicyFactory.d.ts.map +1 -0
  101. package/dist/commonjs/StorageBrowserPolicyFactory.js +23 -0
  102. package/dist/commonjs/StorageBrowserPolicyFactory.js.map +1 -0
  103. package/dist/commonjs/StorageRetryPolicyFactory.d.ts +66 -0
  104. package/dist/commonjs/StorageRetryPolicyFactory.d.ts.map +1 -0
  105. package/dist/commonjs/StorageRetryPolicyFactory.js +33 -0
  106. package/dist/commonjs/StorageRetryPolicyFactory.js.map +1 -0
  107. package/dist/commonjs/credentials/AnonymousCredential.d.ts +19 -0
  108. package/dist/commonjs/credentials/AnonymousCredential.d.ts.map +1 -0
  109. package/dist/commonjs/credentials/AnonymousCredential.js +26 -0
  110. package/dist/commonjs/credentials/AnonymousCredential.js.map +1 -0
  111. package/dist/commonjs/credentials/Credential.d.ts +20 -0
  112. package/dist/commonjs/credentials/Credential.d.ts.map +1 -0
  113. package/dist/commonjs/credentials/Credential.js +22 -0
  114. package/dist/commonjs/credentials/Credential.js.map +1 -0
  115. package/dist/commonjs/credentials/StorageSharedKeyCredential.d.ts +38 -0
  116. package/dist/commonjs/credentials/StorageSharedKeyCredential.d.ts.map +1 -0
  117. package/dist/commonjs/credentials/StorageSharedKeyCredential.js +52 -0
  118. package/dist/commonjs/credentials/StorageSharedKeyCredential.js.map +1 -0
  119. package/dist/commonjs/index.d.ts +17 -0
  120. package/dist/commonjs/index.d.ts.map +1 -1
  121. package/dist/commonjs/index.js +19 -1
  122. package/dist/commonjs/index.js.map +1 -1
  123. package/dist/commonjs/log.d.ts +5 -0
  124. package/dist/commonjs/log.d.ts.map +1 -0
  125. package/dist/commonjs/log.js +11 -0
  126. package/dist/commonjs/log.js.map +1 -0
  127. package/dist/commonjs/policies/AnonymousCredentialPolicy.d.ts +15 -0
  128. package/dist/commonjs/policies/AnonymousCredentialPolicy.d.ts.map +1 -0
  129. package/dist/commonjs/policies/AnonymousCredentialPolicy.js +24 -0
  130. package/dist/commonjs/policies/AnonymousCredentialPolicy.js.map +1 -0
  131. package/dist/commonjs/policies/CredentialPolicy.d.ts +22 -0
  132. package/dist/commonjs/policies/CredentialPolicy.d.ts.map +1 -0
  133. package/dist/commonjs/policies/CredentialPolicy.js +33 -0
  134. package/dist/commonjs/policies/CredentialPolicy.js.map +1 -0
  135. package/dist/commonjs/policies/RequestPolicy.d.ts +45 -0
  136. package/dist/commonjs/policies/RequestPolicy.d.ts.map +1 -0
  137. package/dist/commonjs/policies/RequestPolicy.js +46 -0
  138. package/dist/commonjs/policies/RequestPolicy.js.map +1 -0
  139. package/dist/commonjs/policies/StorageBrowserPolicy.d.ts +28 -0
  140. package/dist/commonjs/policies/StorageBrowserPolicy.d.ts.map +1 -0
  141. package/dist/commonjs/policies/StorageBrowserPolicy.js +51 -0
  142. package/dist/commonjs/policies/StorageBrowserPolicy.js.map +1 -0
  143. package/dist/commonjs/policies/StorageBrowserPolicyV2.d.ts +11 -0
  144. package/dist/commonjs/policies/StorageBrowserPolicyV2.d.ts.map +1 -0
  145. package/dist/commonjs/policies/StorageBrowserPolicyV2.js +35 -0
  146. package/dist/commonjs/policies/StorageBrowserPolicyV2.js.map +1 -0
  147. package/dist/commonjs/policies/StorageCorrectContentLengthPolicy.d.ts +10 -0
  148. package/dist/commonjs/policies/StorageCorrectContentLengthPolicy.d.ts.map +1 -0
  149. package/dist/commonjs/policies/StorageCorrectContentLengthPolicy.js +31 -0
  150. package/dist/commonjs/policies/StorageCorrectContentLengthPolicy.js.map +1 -0
  151. package/dist/commonjs/policies/StorageRetryPolicy.d.ts +62 -0
  152. package/dist/commonjs/policies/StorageRetryPolicy.d.ts.map +1 -0
  153. package/dist/commonjs/policies/StorageRetryPolicy.js +225 -0
  154. package/dist/commonjs/policies/StorageRetryPolicy.js.map +1 -0
  155. package/dist/commonjs/policies/StorageRetryPolicyType.d.ts +14 -0
  156. package/dist/commonjs/policies/StorageRetryPolicyType.d.ts.map +1 -0
  157. package/dist/commonjs/policies/StorageRetryPolicyType.js +20 -0
  158. package/dist/commonjs/policies/StorageRetryPolicyType.js.map +1 -0
  159. package/dist/commonjs/policies/StorageRetryPolicyV2.d.ts +11 -0
  160. package/dist/commonjs/policies/StorageRetryPolicyV2.d.ts.map +1 -0
  161. package/dist/commonjs/policies/StorageRetryPolicyV2.js +169 -0
  162. package/dist/commonjs/policies/StorageRetryPolicyV2.js.map +1 -0
  163. package/dist/commonjs/policies/StorageSharedKeyCredentialPolicy.d.ts +54 -0
  164. package/dist/commonjs/policies/StorageSharedKeyCredentialPolicy.d.ts.map +1 -0
  165. package/dist/commonjs/policies/StorageSharedKeyCredentialPolicy.js +149 -0
  166. package/dist/commonjs/policies/StorageSharedKeyCredentialPolicy.js.map +1 -0
  167. package/dist/commonjs/policies/StorageSharedKeyCredentialPolicyV2.d.ts +17 -0
  168. package/dist/commonjs/policies/StorageSharedKeyCredentialPolicyV2.d.ts.map +1 -0
  169. package/dist/commonjs/policies/StorageSharedKeyCredentialPolicyV2.js +136 -0
  170. package/dist/commonjs/policies/StorageSharedKeyCredentialPolicyV2.js.map +1 -0
  171. package/dist/commonjs/tsdoc-metadata.json +11 -11
  172. package/dist/commonjs/utils/SharedKeyComparator.d.ts +2 -0
  173. package/dist/commonjs/utils/SharedKeyComparator.d.ts.map +1 -0
  174. package/dist/commonjs/utils/SharedKeyComparator.js +76 -0
  175. package/dist/commonjs/utils/SharedKeyComparator.js.map +1 -0
  176. package/dist/commonjs/utils/constants.d.ts +39 -0
  177. package/dist/commonjs/utils/constants.d.ts.map +1 -0
  178. package/dist/commonjs/utils/constants.js +67 -0
  179. package/dist/commonjs/utils/constants.js.map +1 -0
  180. package/dist/commonjs/utils/tracing.d.ts +6 -0
  181. package/dist/commonjs/utils/tracing.d.ts.map +1 -0
  182. package/dist/commonjs/utils/tracing.js +17 -0
  183. package/dist/commonjs/utils/tracing.js.map +1 -0
  184. package/dist/commonjs/utils/utils.common.d.ts +305 -0
  185. package/dist/commonjs/utils/utils.common.d.ts.map +1 -0
  186. package/dist/commonjs/utils/utils.common.js +573 -0
  187. package/dist/commonjs/utils/utils.common.js.map +1 -0
  188. package/dist/esm/BufferScheduler.js +70 -44
  189. package/dist/esm/BufferScheduler.js.map +1 -1
  190. package/dist/esm/BuffersStream.js +14 -0
  191. package/dist/esm/BuffersStream.js.map +1 -1
  192. package/dist/esm/PooledBuffer.js +13 -5
  193. package/dist/esm/PooledBuffer.js.map +1 -1
  194. package/dist/esm/StorageBrowserPolicyFactory.d.ts +16 -0
  195. package/dist/esm/StorageBrowserPolicyFactory.d.ts.map +1 -0
  196. package/dist/esm/StorageBrowserPolicyFactory.js +19 -0
  197. package/dist/esm/StorageBrowserPolicyFactory.js.map +1 -0
  198. package/dist/esm/StorageRetryPolicyFactory.d.ts +66 -0
  199. package/dist/esm/StorageRetryPolicyFactory.d.ts.map +1 -0
  200. package/dist/esm/StorageRetryPolicyFactory.js +28 -0
  201. package/dist/esm/StorageRetryPolicyFactory.js.map +1 -0
  202. package/dist/esm/credentials/AnonymousCredential.d.ts +19 -0
  203. package/dist/esm/credentials/AnonymousCredential.d.ts.map +1 -0
  204. package/dist/esm/credentials/AnonymousCredential.js +22 -0
  205. package/dist/esm/credentials/AnonymousCredential.js.map +1 -0
  206. package/dist/esm/credentials/Credential.d.ts +20 -0
  207. package/dist/esm/credentials/Credential.d.ts.map +1 -0
  208. package/dist/esm/credentials/Credential.js +18 -0
  209. package/dist/esm/credentials/Credential.js.map +1 -0
  210. package/dist/esm/credentials/StorageSharedKeyCredential.d.ts +38 -0
  211. package/dist/esm/credentials/StorageSharedKeyCredential.d.ts.map +1 -0
  212. package/dist/esm/credentials/StorageSharedKeyCredential.js +48 -0
  213. package/dist/esm/credentials/StorageSharedKeyCredential.js.map +1 -0
  214. package/dist/esm/index.d.ts +17 -0
  215. package/dist/esm/index.d.ts.map +1 -1
  216. package/dist/esm/index.js +17 -0
  217. package/dist/esm/index.js.map +1 -1
  218. package/dist/esm/log.d.ts +5 -0
  219. package/dist/esm/log.d.ts.map +1 -0
  220. package/dist/esm/log.js +8 -0
  221. package/dist/esm/log.js.map +1 -0
  222. package/dist/esm/policies/AnonymousCredentialPolicy.d.ts +15 -0
  223. package/dist/esm/policies/AnonymousCredentialPolicy.d.ts.map +1 -0
  224. package/dist/esm/policies/AnonymousCredentialPolicy.js +20 -0
  225. package/dist/esm/policies/AnonymousCredentialPolicy.js.map +1 -0
  226. package/dist/esm/policies/CredentialPolicy.d.ts +22 -0
  227. package/dist/esm/policies/CredentialPolicy.d.ts.map +1 -0
  228. package/dist/esm/policies/CredentialPolicy.js +29 -0
  229. package/dist/esm/policies/CredentialPolicy.js.map +1 -0
  230. package/dist/esm/policies/RequestPolicy.d.ts +45 -0
  231. package/dist/esm/policies/RequestPolicy.d.ts.map +1 -0
  232. package/dist/esm/policies/RequestPolicy.js +42 -0
  233. package/dist/esm/policies/RequestPolicy.js.map +1 -0
  234. package/dist/esm/policies/StorageBrowserPolicy.d.ts +28 -0
  235. package/dist/esm/policies/StorageBrowserPolicy.d.ts.map +1 -0
  236. package/dist/esm/policies/StorageBrowserPolicy.js +47 -0
  237. package/dist/esm/policies/StorageBrowserPolicy.js.map +1 -0
  238. package/dist/esm/policies/StorageBrowserPolicyV2.d.ts +11 -0
  239. package/dist/esm/policies/StorageBrowserPolicyV2.d.ts.map +1 -0
  240. package/dist/esm/policies/StorageBrowserPolicyV2.js +31 -0
  241. package/dist/esm/policies/StorageBrowserPolicyV2.js.map +1 -0
  242. package/dist/esm/policies/StorageCorrectContentLengthPolicy.d.ts +10 -0
  243. package/dist/esm/policies/StorageCorrectContentLengthPolicy.d.ts.map +1 -0
  244. package/dist/esm/policies/StorageCorrectContentLengthPolicy.js +27 -0
  245. package/dist/esm/policies/StorageCorrectContentLengthPolicy.js.map +1 -0
  246. package/dist/esm/policies/StorageRetryPolicy.d.ts +62 -0
  247. package/dist/esm/policies/StorageRetryPolicy.d.ts.map +1 -0
  248. package/dist/esm/policies/StorageRetryPolicy.js +220 -0
  249. package/dist/esm/policies/StorageRetryPolicy.js.map +1 -0
  250. package/dist/esm/policies/StorageRetryPolicyType.d.ts +14 -0
  251. package/dist/esm/policies/StorageRetryPolicyType.d.ts.map +1 -0
  252. package/dist/esm/policies/StorageRetryPolicyType.js +17 -0
  253. package/dist/esm/policies/StorageRetryPolicyType.js.map +1 -0
  254. package/dist/esm/policies/StorageRetryPolicyV2.d.ts +11 -0
  255. package/dist/esm/policies/StorageRetryPolicyV2.d.ts.map +1 -0
  256. package/dist/esm/policies/StorageRetryPolicyV2.js +165 -0
  257. package/dist/esm/policies/StorageRetryPolicyV2.js.map +1 -0
  258. package/dist/esm/policies/StorageSharedKeyCredentialPolicy.d.ts +54 -0
  259. package/dist/esm/policies/StorageSharedKeyCredentialPolicy.d.ts.map +1 -0
  260. package/dist/esm/policies/StorageSharedKeyCredentialPolicy.js +145 -0
  261. package/dist/esm/policies/StorageSharedKeyCredentialPolicy.js.map +1 -0
  262. package/dist/esm/policies/StorageSharedKeyCredentialPolicyV2.d.ts +17 -0
  263. package/dist/esm/policies/StorageSharedKeyCredentialPolicyV2.d.ts.map +1 -0
  264. package/dist/esm/policies/StorageSharedKeyCredentialPolicyV2.js +132 -0
  265. package/dist/esm/policies/StorageSharedKeyCredentialPolicyV2.js.map +1 -0
  266. package/dist/esm/utils/SharedKeyComparator.d.ts +2 -0
  267. package/dist/esm/utils/SharedKeyComparator.d.ts.map +1 -0
  268. package/dist/esm/utils/SharedKeyComparator.js +73 -0
  269. package/dist/esm/utils/SharedKeyComparator.js.map +1 -0
  270. package/dist/esm/utils/constants.d.ts +39 -0
  271. package/dist/esm/utils/constants.d.ts.map +1 -0
  272. package/dist/esm/utils/constants.js +64 -0
  273. package/dist/esm/utils/constants.js.map +1 -0
  274. package/dist/esm/utils/tracing.d.ts +6 -0
  275. package/dist/esm/utils/tracing.d.ts.map +1 -0
  276. package/dist/esm/utils/tracing.js +14 -0
  277. package/dist/esm/utils/tracing.js.map +1 -0
  278. package/dist/esm/utils/utils.common.d.ts +305 -0
  279. package/dist/esm/utils/utils.common.d.ts.map +1 -0
  280. package/dist/esm/utils/utils.common.js +544 -0
  281. package/dist/esm/utils/utils.common.js.map +1 -0
  282. package/dist/react-native/BufferScheduler.js +70 -44
  283. package/dist/react-native/BufferScheduler.js.map +1 -1
  284. package/dist/react-native/BuffersStream.js +14 -0
  285. package/dist/react-native/BuffersStream.js.map +1 -1
  286. package/dist/react-native/PooledBuffer.js +13 -5
  287. package/dist/react-native/PooledBuffer.js.map +1 -1
  288. package/dist/react-native/StorageBrowserPolicyFactory.d.ts +16 -0
  289. package/dist/react-native/StorageBrowserPolicyFactory.d.ts.map +1 -0
  290. package/dist/react-native/StorageBrowserPolicyFactory.js +19 -0
  291. package/dist/react-native/StorageBrowserPolicyFactory.js.map +1 -0
  292. package/dist/react-native/StorageRetryPolicyFactory.d.ts +66 -0
  293. package/dist/react-native/StorageRetryPolicyFactory.d.ts.map +1 -0
  294. package/dist/react-native/StorageRetryPolicyFactory.js +28 -0
  295. package/dist/react-native/StorageRetryPolicyFactory.js.map +1 -0
  296. package/dist/react-native/credentials/AnonymousCredential.d.ts +19 -0
  297. package/dist/react-native/credentials/AnonymousCredential.d.ts.map +1 -0
  298. package/dist/react-native/credentials/AnonymousCredential.js +22 -0
  299. package/dist/react-native/credentials/AnonymousCredential.js.map +1 -0
  300. package/dist/react-native/credentials/Credential.d.ts +20 -0
  301. package/dist/react-native/credentials/Credential.d.ts.map +1 -0
  302. package/dist/react-native/credentials/Credential.js +18 -0
  303. package/dist/react-native/credentials/Credential.js.map +1 -0
  304. package/dist/react-native/credentials/StorageSharedKeyCredential.d.ts +38 -0
  305. package/dist/react-native/credentials/StorageSharedKeyCredential.d.ts.map +1 -0
  306. package/dist/react-native/credentials/StorageSharedKeyCredential.js +48 -0
  307. package/dist/react-native/credentials/StorageSharedKeyCredential.js.map +1 -0
  308. package/dist/react-native/index.d.ts +17 -0
  309. package/dist/react-native/index.d.ts.map +1 -1
  310. package/dist/react-native/index.js +17 -0
  311. package/dist/react-native/index.js.map +1 -1
  312. package/dist/react-native/log.d.ts +5 -0
  313. package/dist/react-native/log.d.ts.map +1 -0
  314. package/dist/react-native/log.js +8 -0
  315. package/dist/react-native/log.js.map +1 -0
  316. package/dist/react-native/policies/AnonymousCredentialPolicy.d.ts +15 -0
  317. package/dist/react-native/policies/AnonymousCredentialPolicy.d.ts.map +1 -0
  318. package/dist/react-native/policies/AnonymousCredentialPolicy.js +20 -0
  319. package/dist/react-native/policies/AnonymousCredentialPolicy.js.map +1 -0
  320. package/dist/react-native/policies/CredentialPolicy.d.ts +22 -0
  321. package/dist/react-native/policies/CredentialPolicy.d.ts.map +1 -0
  322. package/dist/react-native/policies/CredentialPolicy.js +29 -0
  323. package/dist/react-native/policies/CredentialPolicy.js.map +1 -0
  324. package/dist/react-native/policies/RequestPolicy.d.ts +45 -0
  325. package/dist/react-native/policies/RequestPolicy.d.ts.map +1 -0
  326. package/dist/react-native/policies/RequestPolicy.js +42 -0
  327. package/dist/react-native/policies/RequestPolicy.js.map +1 -0
  328. package/dist/react-native/policies/StorageBrowserPolicy.d.ts +28 -0
  329. package/dist/react-native/policies/StorageBrowserPolicy.d.ts.map +1 -0
  330. package/dist/react-native/policies/StorageBrowserPolicy.js +47 -0
  331. package/dist/react-native/policies/StorageBrowserPolicy.js.map +1 -0
  332. package/dist/react-native/policies/StorageBrowserPolicyV2.d.ts +11 -0
  333. package/dist/react-native/policies/StorageBrowserPolicyV2.d.ts.map +1 -0
  334. package/dist/react-native/policies/StorageBrowserPolicyV2.js +31 -0
  335. package/dist/react-native/policies/StorageBrowserPolicyV2.js.map +1 -0
  336. package/dist/react-native/policies/StorageCorrectContentLengthPolicy.d.ts +10 -0
  337. package/dist/react-native/policies/StorageCorrectContentLengthPolicy.d.ts.map +1 -0
  338. package/dist/react-native/policies/StorageCorrectContentLengthPolicy.js +27 -0
  339. package/dist/react-native/policies/StorageCorrectContentLengthPolicy.js.map +1 -0
  340. package/dist/react-native/policies/StorageRetryPolicy.d.ts +62 -0
  341. package/dist/react-native/policies/StorageRetryPolicy.d.ts.map +1 -0
  342. package/dist/react-native/policies/StorageRetryPolicy.js +220 -0
  343. package/dist/react-native/policies/StorageRetryPolicy.js.map +1 -0
  344. package/dist/react-native/policies/StorageRetryPolicyType.d.ts +14 -0
  345. package/dist/react-native/policies/StorageRetryPolicyType.d.ts.map +1 -0
  346. package/dist/react-native/policies/StorageRetryPolicyType.js +17 -0
  347. package/dist/react-native/policies/StorageRetryPolicyType.js.map +1 -0
  348. package/dist/react-native/policies/StorageRetryPolicyV2.d.ts +11 -0
  349. package/dist/react-native/policies/StorageRetryPolicyV2.d.ts.map +1 -0
  350. package/dist/react-native/policies/StorageRetryPolicyV2.js +165 -0
  351. package/dist/react-native/policies/StorageRetryPolicyV2.js.map +1 -0
  352. package/dist/react-native/policies/StorageSharedKeyCredentialPolicy.d.ts +54 -0
  353. package/dist/react-native/policies/StorageSharedKeyCredentialPolicy.d.ts.map +1 -0
  354. package/dist/react-native/policies/StorageSharedKeyCredentialPolicy.js +145 -0
  355. package/dist/react-native/policies/StorageSharedKeyCredentialPolicy.js.map +1 -0
  356. package/dist/react-native/policies/StorageSharedKeyCredentialPolicyV2.d.ts +17 -0
  357. package/dist/react-native/policies/StorageSharedKeyCredentialPolicyV2.d.ts.map +1 -0
  358. package/dist/react-native/policies/StorageSharedKeyCredentialPolicyV2.js +132 -0
  359. package/dist/react-native/policies/StorageSharedKeyCredentialPolicyV2.js.map +1 -0
  360. package/dist/react-native/utils/SharedKeyComparator.d.ts +2 -0
  361. package/dist/react-native/utils/SharedKeyComparator.d.ts.map +1 -0
  362. package/dist/react-native/utils/SharedKeyComparator.js +73 -0
  363. package/dist/react-native/utils/SharedKeyComparator.js.map +1 -0
  364. package/dist/react-native/utils/constants.d.ts +39 -0
  365. package/dist/react-native/utils/constants.d.ts.map +1 -0
  366. package/dist/react-native/utils/constants.js +64 -0
  367. package/dist/react-native/utils/constants.js.map +1 -0
  368. package/dist/react-native/utils/tracing.d.ts +6 -0
  369. package/dist/react-native/utils/tracing.d.ts.map +1 -0
  370. package/dist/react-native/utils/tracing.js +14 -0
  371. package/dist/react-native/utils/tracing.js.map +1 -0
  372. package/dist/react-native/utils/utils.common.d.ts +305 -0
  373. package/dist/react-native/utils/utils.common.d.ts.map +1 -0
  374. package/dist/react-native/utils/utils.common.js +544 -0
  375. package/dist/react-native/utils/utils.common.js.map +1 -0
  376. package/package.json +12 -6
  377. package/dist/browser/index.d.ts.map +0 -1
  378. package/dist/browser/index.js.map +0 -1
@@ -0,0 +1,38 @@
1
+ import type { RequestPolicy, RequestPolicyOptionsLike as RequestPolicyOptions } from "@azure/core-http-compat";
2
+ import { StorageSharedKeyCredentialPolicy } from "../policies/StorageSharedKeyCredentialPolicy.js";
3
+ import { Credential } from "./Credential.js";
4
+ /**
5
+ * ONLY AVAILABLE IN NODE.JS RUNTIME.
6
+ *
7
+ * StorageSharedKeyCredential for account key authorization of Azure Storage service.
8
+ */
9
+ export declare class StorageSharedKeyCredential extends Credential {
10
+ /**
11
+ * Azure Storage account name; readonly.
12
+ */
13
+ readonly accountName: string;
14
+ /**
15
+ * Azure Storage account key; readonly.
16
+ */
17
+ private readonly accountKey;
18
+ /**
19
+ * Creates an instance of StorageSharedKeyCredential.
20
+ * @param accountName -
21
+ * @param accountKey -
22
+ */
23
+ constructor(accountName: string, accountKey: string);
24
+ /**
25
+ * Creates a StorageSharedKeyCredentialPolicy object.
26
+ *
27
+ * @param nextPolicy -
28
+ * @param options -
29
+ */
30
+ create(nextPolicy: RequestPolicy, options: RequestPolicyOptions): StorageSharedKeyCredentialPolicy;
31
+ /**
32
+ * Generates a hash signature for an HTTP request or for a SAS.
33
+ *
34
+ * @param stringToSign -
35
+ */
36
+ computeHMACSHA256(stringToSign: string): string;
37
+ }
38
+ //# sourceMappingURL=StorageSharedKeyCredential.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StorageSharedKeyCredential.d.ts","sourceRoot":"","sources":["../../../src/credentials/StorageSharedKeyCredential.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,aAAa,EACb,wBAAwB,IAAI,oBAAoB,EACjD,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,gCAAgC,EAAE,MAAM,iDAAiD,CAAC;AACnG,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C;;;;GAIG;AACH,qBAAa,0BAA2B,SAAQ,UAAU;IACxD;;OAEG;IACH,SAAgB,WAAW,EAAE,MAAM,CAAC;IAEpC;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IAEpC;;;;OAIG;gBACS,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;IAMnD;;;;;OAKG;IACI,MAAM,CACX,UAAU,EAAE,aAAa,EACzB,OAAO,EAAE,oBAAoB,GAC5B,gCAAgC;IAInC;;;;OAIG;IACI,iBAAiB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM;CAGvD"}
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation.
3
+ // Licensed under the MIT License.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.StorageSharedKeyCredential = void 0;
6
+ const node_crypto_1 = require("node:crypto");
7
+ const StorageSharedKeyCredentialPolicy_js_1 = require("../policies/StorageSharedKeyCredentialPolicy.js");
8
+ const Credential_js_1 = require("./Credential.js");
9
+ /**
10
+ * ONLY AVAILABLE IN NODE.JS RUNTIME.
11
+ *
12
+ * StorageSharedKeyCredential for account key authorization of Azure Storage service.
13
+ */
14
+ class StorageSharedKeyCredential extends Credential_js_1.Credential {
15
+ /**
16
+ * Azure Storage account name; readonly.
17
+ */
18
+ accountName;
19
+ /**
20
+ * Azure Storage account key; readonly.
21
+ */
22
+ accountKey;
23
+ /**
24
+ * Creates an instance of StorageSharedKeyCredential.
25
+ * @param accountName -
26
+ * @param accountKey -
27
+ */
28
+ constructor(accountName, accountKey) {
29
+ super();
30
+ this.accountName = accountName;
31
+ this.accountKey = Buffer.from(accountKey, "base64");
32
+ }
33
+ /**
34
+ * Creates a StorageSharedKeyCredentialPolicy object.
35
+ *
36
+ * @param nextPolicy -
37
+ * @param options -
38
+ */
39
+ create(nextPolicy, options) {
40
+ return new StorageSharedKeyCredentialPolicy_js_1.StorageSharedKeyCredentialPolicy(nextPolicy, options, this);
41
+ }
42
+ /**
43
+ * Generates a hash signature for an HTTP request or for a SAS.
44
+ *
45
+ * @param stringToSign -
46
+ */
47
+ computeHMACSHA256(stringToSign) {
48
+ return (0, node_crypto_1.createHmac)("sha256", this.accountKey).update(stringToSign, "utf8").digest("base64");
49
+ }
50
+ }
51
+ exports.StorageSharedKeyCredential = StorageSharedKeyCredential;
52
+ //# sourceMappingURL=StorageSharedKeyCredential.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StorageSharedKeyCredential.js","sourceRoot":"","sources":["../../../src/credentials/StorageSharedKeyCredential.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,6CAAyC;AAKzC,yGAAmG;AACnG,mDAA6C;AAE7C;;;;GAIG;AACH,MAAa,0BAA2B,SAAQ,0BAAU;IACxD;;OAEG;IACa,WAAW,CAAS;IAEpC;;OAEG;IACc,UAAU,CAAS;IAEpC;;;;OAIG;IACH,YAAY,WAAmB,EAAE,UAAkB;QACjD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IACtD,CAAC;IAED;;;;;OAKG;IACI,MAAM,CACX,UAAyB,EACzB,OAA6B;QAE7B,OAAO,IAAI,sEAAgC,CAAC,UAAU,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IACzE,CAAC;IAED;;;;OAIG;IACI,iBAAiB,CAAC,YAAoB;QAC3C,OAAO,IAAA,wBAAU,EAAC,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC7F,CAAC;CACF;AA3CD,gEA2CC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createHmac } from \"node:crypto\";\nimport type {\n RequestPolicy,\n RequestPolicyOptionsLike as RequestPolicyOptions,\n} from \"@azure/core-http-compat\";\nimport { StorageSharedKeyCredentialPolicy } from \"../policies/StorageSharedKeyCredentialPolicy.js\";\nimport { Credential } from \"./Credential.js\";\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * StorageSharedKeyCredential for account key authorization of Azure Storage service.\n */\nexport class StorageSharedKeyCredential extends Credential {\n /**\n * Azure Storage account name; readonly.\n */\n public readonly accountName: string;\n\n /**\n * Azure Storage account key; readonly.\n */\n private readonly accountKey: Buffer;\n\n /**\n * Creates an instance of StorageSharedKeyCredential.\n * @param accountName -\n * @param accountKey -\n */\n constructor(accountName: string, accountKey: string) {\n super();\n this.accountName = accountName;\n this.accountKey = Buffer.from(accountKey, \"base64\");\n }\n\n /**\n * Creates a StorageSharedKeyCredentialPolicy object.\n *\n * @param nextPolicy -\n * @param options -\n */\n public create(\n nextPolicy: RequestPolicy,\n options: RequestPolicyOptions,\n ): StorageSharedKeyCredentialPolicy {\n return new StorageSharedKeyCredentialPolicy(nextPolicy, options, this);\n }\n\n /**\n * Generates a hash signature for an HTTP request or for a SAS.\n *\n * @param stringToSign -\n */\n public computeHMACSHA256(stringToSign: string): string {\n return createHmac(\"sha256\", this.accountKey).update(stringToSign, \"utf8\").digest(\"base64\");\n }\n}\n"]}
@@ -1,3 +1,20 @@
1
1
  export * from "./BufferScheduler.js";
2
2
  export { getCachedDefaultHttpClient } from "./cache.js";
3
+ export * from "./StorageBrowserPolicyFactory.js";
4
+ export * from "./credentials/AnonymousCredential.js";
5
+ export * from "./credentials/Credential.js";
6
+ export * from "./credentials/StorageSharedKeyCredential.js";
7
+ export * from "./StorageRetryPolicyFactory.js";
8
+ export { BaseRequestPolicy } from "./policies/RequestPolicy.js";
9
+ export * from "./policies/AnonymousCredentialPolicy.js";
10
+ export * from "./policies/CredentialPolicy.js";
11
+ export * from "./policies/StorageBrowserPolicy.js";
12
+ export * from "./policies/StorageBrowserPolicyV2.js";
13
+ export * from "./policies/StorageCorrectContentLengthPolicy.js";
14
+ export * from "./policies/StorageRetryPolicyType.js";
15
+ export * from "./policies/StorageRetryPolicy.js";
16
+ export * from "./policies/StorageRetryPolicyV2.js";
17
+ export * from "./policies/StorageSharedKeyCredentialPolicy.js";
18
+ export * from "./policies/StorageSharedKeyCredentialPolicyV2.js";
19
+ export * from "./StorageRetryPolicyFactory.js";
3
20
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AAExD,cAAc,kCAAkC,CAAC;AACjD,cAAc,sCAAsC,CAAC;AACrD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6CAA6C,CAAC;AAE5D,cAAc,gCAAgC,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,cAAc,yCAAyC,CAAC;AACxD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AACnD,cAAc,sCAAsC,CAAC;AACrD,cAAc,iDAAiD,CAAC;AAChE,cAAc,sCAAsC,CAAC;AACrD,cAAc,kCAAkC,CAAC;AACjD,cAAc,oCAAoC,CAAC;AACnD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,kDAAkD,CAAC;AACjE,cAAc,gCAAgC,CAAC"}
@@ -2,9 +2,27 @@
2
2
  // Copyright (c) Microsoft Corporation.
3
3
  // Licensed under the MIT License.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.getCachedDefaultHttpClient = void 0;
5
+ exports.BaseRequestPolicy = exports.getCachedDefaultHttpClient = void 0;
6
6
  const tslib_1 = require("tslib");
7
7
  tslib_1.__exportStar(require("./BufferScheduler.js"), exports);
8
8
  var cache_js_1 = require("./cache.js");
9
9
  Object.defineProperty(exports, "getCachedDefaultHttpClient", { enumerable: true, get: function () { return cache_js_1.getCachedDefaultHttpClient; } });
10
+ tslib_1.__exportStar(require("./StorageBrowserPolicyFactory.js"), exports);
11
+ tslib_1.__exportStar(require("./credentials/AnonymousCredential.js"), exports);
12
+ tslib_1.__exportStar(require("./credentials/Credential.js"), exports);
13
+ tslib_1.__exportStar(require("./credentials/StorageSharedKeyCredential.js"), exports);
14
+ tslib_1.__exportStar(require("./StorageRetryPolicyFactory.js"), exports);
15
+ var RequestPolicy_js_1 = require("./policies/RequestPolicy.js");
16
+ Object.defineProperty(exports, "BaseRequestPolicy", { enumerable: true, get: function () { return RequestPolicy_js_1.BaseRequestPolicy; } });
17
+ tslib_1.__exportStar(require("./policies/AnonymousCredentialPolicy.js"), exports);
18
+ tslib_1.__exportStar(require("./policies/CredentialPolicy.js"), exports);
19
+ tslib_1.__exportStar(require("./policies/StorageBrowserPolicy.js"), exports);
20
+ tslib_1.__exportStar(require("./policies/StorageBrowserPolicyV2.js"), exports);
21
+ tslib_1.__exportStar(require("./policies/StorageCorrectContentLengthPolicy.js"), exports);
22
+ tslib_1.__exportStar(require("./policies/StorageRetryPolicyType.js"), exports);
23
+ tslib_1.__exportStar(require("./policies/StorageRetryPolicy.js"), exports);
24
+ tslib_1.__exportStar(require("./policies/StorageRetryPolicyV2.js"), exports);
25
+ tslib_1.__exportStar(require("./policies/StorageSharedKeyCredentialPolicy.js"), exports);
26
+ tslib_1.__exportStar(require("./policies/StorageSharedKeyCredentialPolicyV2.js"), exports);
27
+ tslib_1.__exportStar(require("./StorageRetryPolicyFactory.js"), exports);
10
28
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAElC,+DAAqC;AACrC,uCAAwD;AAA/C,sHAAA,0BAA0B,OAAA","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport * from \"./BufferScheduler.js\";\nexport { getCachedDefaultHttpClient } from \"./cache.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAElC,+DAAqC;AACrC,uCAAwD;AAA/C,sHAAA,0BAA0B,OAAA;AAEnC,2EAAiD;AACjD,+EAAqD;AACrD,sEAA4C;AAC5C,sFAA4D;AAE5D,yEAA+C;AAC/C,gEAAgE;AAAvD,qHAAA,iBAAiB,OAAA;AAC1B,kFAAwD;AACxD,yEAA+C;AAC/C,6EAAmD;AACnD,+EAAqD;AACrD,0FAAgE;AAChE,+EAAqD;AACrD,2EAAiD;AACjD,6EAAmD;AACnD,yFAA+D;AAC/D,2FAAiE;AACjE,yEAA+C","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport * from \"./BufferScheduler.js\";\nexport { getCachedDefaultHttpClient } from \"./cache.js\";\n\nexport * from \"./StorageBrowserPolicyFactory.js\";\nexport * from \"./credentials/AnonymousCredential.js\";\nexport * from \"./credentials/Credential.js\";\nexport * from \"./credentials/StorageSharedKeyCredential.js\";\n\nexport * from \"./StorageRetryPolicyFactory.js\";\nexport { BaseRequestPolicy } from \"./policies/RequestPolicy.js\";\nexport * from \"./policies/AnonymousCredentialPolicy.js\";\nexport * from \"./policies/CredentialPolicy.js\";\nexport * from \"./policies/StorageBrowserPolicy.js\";\nexport * from \"./policies/StorageBrowserPolicyV2.js\";\nexport * from \"./policies/StorageCorrectContentLengthPolicy.js\";\nexport * from \"./policies/StorageRetryPolicyType.js\";\nexport * from \"./policies/StorageRetryPolicy.js\";\nexport * from \"./policies/StorageRetryPolicyV2.js\";\nexport * from \"./policies/StorageSharedKeyCredentialPolicy.js\";\nexport * from \"./policies/StorageSharedKeyCredentialPolicyV2.js\";\nexport * from \"./StorageRetryPolicyFactory.js\";\n"]}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * The `@azure/logger` configuration for this package.
3
+ */
4
+ export declare const logger: import("@azure/logger").AzureLogger;
5
+ //# sourceMappingURL=log.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../src/log.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,eAAO,MAAM,MAAM,qCAAuC,CAAC"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation.
3
+ // Licensed under the MIT License.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.logger = void 0;
6
+ const logger_1 = require("@azure/logger");
7
+ /**
8
+ * The `@azure/logger` configuration for this package.
9
+ */
10
+ exports.logger = (0, logger_1.createClientLogger)("storage-common");
11
+ //# sourceMappingURL=log.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"log.js","sourceRoot":"","sources":["../../src/log.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,0CAAmD;AAEnD;;GAEG;AACU,QAAA,MAAM,GAAG,IAAA,2BAAkB,EAAC,gBAAgB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createClientLogger } from \"@azure/logger\";\n\n/**\n * The `@azure/logger` configuration for this package.\n */\nexport const logger = createClientLogger(\"storage-common\");\n"]}
@@ -0,0 +1,15 @@
1
+ import type { RequestPolicy, RequestPolicyOptionsLike as RequestPolicyOptions } from "@azure/core-http-compat";
2
+ import { CredentialPolicy } from "./CredentialPolicy.js";
3
+ /**
4
+ * AnonymousCredentialPolicy is used with HTTP(S) requests that read public resources
5
+ * or for use with Shared Access Signatures (SAS).
6
+ */
7
+ export declare class AnonymousCredentialPolicy extends CredentialPolicy {
8
+ /**
9
+ * Creates an instance of AnonymousCredentialPolicy.
10
+ * @param nextPolicy -
11
+ * @param options -
12
+ */
13
+ constructor(nextPolicy: RequestPolicy, options: RequestPolicyOptions);
14
+ }
15
+ //# sourceMappingURL=AnonymousCredentialPolicy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnonymousCredentialPolicy.d.ts","sourceRoot":"","sources":["../../../src/policies/AnonymousCredentialPolicy.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,aAAa,EACb,wBAAwB,IAAI,oBAAoB,EACjD,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD;;;GAGG;AACH,qBAAa,yBAA0B,SAAQ,gBAAgB;IAC7D;;;;OAIG;gBAGS,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,oBAAoB;CAGrE"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation.
3
+ // Licensed under the MIT License.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.AnonymousCredentialPolicy = void 0;
6
+ const CredentialPolicy_js_1 = require("./CredentialPolicy.js");
7
+ /**
8
+ * AnonymousCredentialPolicy is used with HTTP(S) requests that read public resources
9
+ * or for use with Shared Access Signatures (SAS).
10
+ */
11
+ class AnonymousCredentialPolicy extends CredentialPolicy_js_1.CredentialPolicy {
12
+ /**
13
+ * Creates an instance of AnonymousCredentialPolicy.
14
+ * @param nextPolicy -
15
+ * @param options -
16
+ */
17
+ // The base class has a protected constructor. Adding a public one to enable constructing of this class.
18
+ /* eslint-disable-next-line @typescript-eslint/no-useless-constructor*/
19
+ constructor(nextPolicy, options) {
20
+ super(nextPolicy, options);
21
+ }
22
+ }
23
+ exports.AnonymousCredentialPolicy = AnonymousCredentialPolicy;
24
+ //# sourceMappingURL=AnonymousCredentialPolicy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnonymousCredentialPolicy.js","sourceRoot":"","sources":["../../../src/policies/AnonymousCredentialPolicy.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAMlC,+DAAyD;AAEzD;;;GAGG;AACH,MAAa,yBAA0B,SAAQ,sCAAgB;IAC7D;;;;OAIG;IACH,wGAAwG;IACxG,uEAAuE;IACvE,YAAY,UAAyB,EAAE,OAA6B;QAClE,KAAK,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAC7B,CAAC;CACF;AAXD,8DAWC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n RequestPolicy,\n RequestPolicyOptionsLike as RequestPolicyOptions,\n} from \"@azure/core-http-compat\";\nimport { CredentialPolicy } from \"./CredentialPolicy.js\";\n\n/**\n * AnonymousCredentialPolicy is used with HTTP(S) requests that read public resources\n * or for use with Shared Access Signatures (SAS).\n */\nexport class AnonymousCredentialPolicy extends CredentialPolicy {\n /**\n * Creates an instance of AnonymousCredentialPolicy.\n * @param nextPolicy -\n * @param options -\n */\n // The base class has a protected constructor. Adding a public one to enable constructing of this class.\n /* eslint-disable-next-line @typescript-eslint/no-useless-constructor*/\n constructor(nextPolicy: RequestPolicy, options: RequestPolicyOptions) {\n super(nextPolicy, options);\n }\n}\n"]}
@@ -0,0 +1,22 @@
1
+ import { BaseRequestPolicy } from "./RequestPolicy.js";
2
+ import type { WebResourceLike as WebResource, CompatResponse as HttpOperationResponse } from "@azure/core-http-compat";
3
+ /**
4
+ * Credential policy used to sign HTTP(S) requests before sending. This is an
5
+ * abstract class.
6
+ */
7
+ export declare abstract class CredentialPolicy extends BaseRequestPolicy {
8
+ /**
9
+ * Sends out request.
10
+ *
11
+ * @param request -
12
+ */
13
+ sendRequest(request: WebResource): Promise<HttpOperationResponse>;
14
+ /**
15
+ * Child classes must implement this method with request signing. This method
16
+ * will be executed in {@link sendRequest}.
17
+ *
18
+ * @param request -
19
+ */
20
+ protected signRequest(request: WebResource): WebResource;
21
+ }
22
+ //# sourceMappingURL=CredentialPolicy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CredentialPolicy.d.ts","sourceRoot":"","sources":["../../../src/policies/CredentialPolicy.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EACV,eAAe,IAAI,WAAW,EAC9B,cAAc,IAAI,qBAAqB,EACxC,MAAM,yBAAyB,CAAC;AAEjC;;;GAGG;AACH,8BAAsB,gBAAiB,SAAQ,iBAAiB;IAC9D;;;;OAIG;IACI,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAIxE;;;;;OAKG;IACH,SAAS,CAAC,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,WAAW;CAKzD"}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation.
3
+ // Licensed under the MIT License.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.CredentialPolicy = void 0;
6
+ const RequestPolicy_js_1 = require("./RequestPolicy.js");
7
+ /**
8
+ * Credential policy used to sign HTTP(S) requests before sending. This is an
9
+ * abstract class.
10
+ */
11
+ class CredentialPolicy extends RequestPolicy_js_1.BaseRequestPolicy {
12
+ /**
13
+ * Sends out request.
14
+ *
15
+ * @param request -
16
+ */
17
+ sendRequest(request) {
18
+ return this._nextPolicy.sendRequest(this.signRequest(request));
19
+ }
20
+ /**
21
+ * Child classes must implement this method with request signing. This method
22
+ * will be executed in {@link sendRequest}.
23
+ *
24
+ * @param request -
25
+ */
26
+ signRequest(request) {
27
+ // Child classes must override this method with request signing. This method
28
+ // will be executed in sendRequest().
29
+ return request;
30
+ }
31
+ }
32
+ exports.CredentialPolicy = CredentialPolicy;
33
+ //# sourceMappingURL=CredentialPolicy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CredentialPolicy.js","sourceRoot":"","sources":["../../../src/policies/CredentialPolicy.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,yDAAuD;AAMvD;;;GAGG;AACH,MAAsB,gBAAiB,SAAQ,oCAAiB;IAC9D;;;;OAIG;IACI,WAAW,CAAC,OAAoB;QACrC,OAAO,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC;IACjE,CAAC;IAED;;;;;OAKG;IACO,WAAW,CAAC,OAAoB;QACxC,4EAA4E;QAC5E,qCAAqC;QACrC,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AArBD,4CAqBC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { BaseRequestPolicy } from \"./RequestPolicy.js\";\nimport type {\n WebResourceLike as WebResource,\n CompatResponse as HttpOperationResponse,\n} from \"@azure/core-http-compat\";\n\n/**\n * Credential policy used to sign HTTP(S) requests before sending. This is an\n * abstract class.\n */\nexport abstract class CredentialPolicy extends BaseRequestPolicy {\n /**\n * Sends out request.\n *\n * @param request -\n */\n public sendRequest(request: WebResource): Promise<HttpOperationResponse> {\n return this._nextPolicy.sendRequest(this.signRequest(request));\n }\n\n /**\n * Child classes must implement this method with request signing. This method\n * will be executed in {@link sendRequest}.\n *\n * @param request -\n */\n protected signRequest(request: WebResource): WebResource {\n // Child classes must override this method with request signing. This method\n // will be executed in sendRequest().\n return request;\n }\n}\n"]}
@@ -0,0 +1,45 @@
1
+ import type { HttpPipelineLogLevel, RequestPolicy, RequestPolicyOptionsLike, WebResourceLike, CompatResponse as HttpOperationResponse } from "@azure/core-http-compat";
2
+ /**
3
+ * The base class from which all request policies derive.
4
+ */
5
+ export declare abstract class BaseRequestPolicy implements RequestPolicy {
6
+ /**
7
+ * The next policy in the pipeline. Each policy is responsible for executing the next one if the request is to continue through the pipeline.
8
+ */
9
+ readonly _nextPolicy: RequestPolicy;
10
+ /**
11
+ * The options that can be passed to a given request policy.
12
+ */
13
+ readonly _options: RequestPolicyOptionsLike;
14
+ /**
15
+ * The main method to implement that manipulates a request/response.
16
+ */
17
+ protected constructor(
18
+ /**
19
+ * The next policy in the pipeline. Each policy is responsible for executing the next one if the request is to continue through the pipeline.
20
+ */
21
+ _nextPolicy: RequestPolicy,
22
+ /**
23
+ * The options that can be passed to a given request policy.
24
+ */
25
+ _options: RequestPolicyOptionsLike);
26
+ /**
27
+ * Sends a network request based on the given web resource.
28
+ * @param webResource - A {@link WebResourceLike} that describes a HTTP request to be made.
29
+ */
30
+ abstract sendRequest(webResource: WebResourceLike): Promise<HttpOperationResponse>;
31
+ /**
32
+ * Get whether or not a log with the provided log level should be logged.
33
+ * @param logLevel - The log level of the log that will be logged.
34
+ * @returns Whether or not a log with the provided log level should be logged.
35
+ */
36
+ shouldLog(logLevel: HttpPipelineLogLevel): boolean;
37
+ /**
38
+ * Attempt to log the provided message to the provided logger. If no logger was provided or if
39
+ * the log level does not meat the logger's threshold, then nothing will be logged.
40
+ * @param logLevel - The log level of this log.
41
+ * @param message - The message of this log.
42
+ */
43
+ log(logLevel: HttpPipelineLogLevel, message: string): void;
44
+ }
45
+ //# sourceMappingURL=RequestPolicy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RequestPolicy.d.ts","sourceRoot":"","sources":["../../../src/policies/RequestPolicy.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,oBAAoB,EACpB,aAAa,EACb,wBAAwB,EACxB,eAAe,EACf,cAAc,IAAI,qBAAqB,EACxC,MAAM,yBAAyB,CAAC;AAEjC;;GAEG;AACH,8BAAsB,iBAAkB,YAAW,aAAa;IAK5D;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAE,aAAa;IACnC;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,wBAAwB;IAX7C;;OAEG;IACH,SAAS;IACP;;OAEG;IACM,WAAW,EAAE,aAAa;IACnC;;OAEG;IACM,QAAQ,EAAE,wBAAwB;IAG7C;;;OAGG;aACa,WAAW,CAAC,WAAW,EAAE,eAAe,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAEzF;;;;OAIG;IACI,SAAS,CAAC,QAAQ,EAAE,oBAAoB,GAAG,OAAO;IAIzD;;;;;OAKG;IACI,GAAG,CAAC,QAAQ,EAAE,oBAAoB,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;CAGlE"}
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation.
3
+ // Licensed under the MIT License.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.BaseRequestPolicy = void 0;
6
+ /**
7
+ * The base class from which all request policies derive.
8
+ */
9
+ class BaseRequestPolicy {
10
+ _nextPolicy;
11
+ _options;
12
+ /**
13
+ * The main method to implement that manipulates a request/response.
14
+ */
15
+ constructor(
16
+ /**
17
+ * The next policy in the pipeline. Each policy is responsible for executing the next one if the request is to continue through the pipeline.
18
+ */
19
+ _nextPolicy,
20
+ /**
21
+ * The options that can be passed to a given request policy.
22
+ */
23
+ _options) {
24
+ this._nextPolicy = _nextPolicy;
25
+ this._options = _options;
26
+ }
27
+ /**
28
+ * Get whether or not a log with the provided log level should be logged.
29
+ * @param logLevel - The log level of the log that will be logged.
30
+ * @returns Whether or not a log with the provided log level should be logged.
31
+ */
32
+ shouldLog(logLevel) {
33
+ return this._options.shouldLog(logLevel);
34
+ }
35
+ /**
36
+ * Attempt to log the provided message to the provided logger. If no logger was provided or if
37
+ * the log level does not meat the logger's threshold, then nothing will be logged.
38
+ * @param logLevel - The log level of this log.
39
+ * @param message - The message of this log.
40
+ */
41
+ log(logLevel, message) {
42
+ this._options.log(logLevel, message);
43
+ }
44
+ }
45
+ exports.BaseRequestPolicy = BaseRequestPolicy;
46
+ //# sourceMappingURL=RequestPolicy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RequestPolicy.js","sourceRoot":"","sources":["../../../src/policies/RequestPolicy.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAUlC;;GAEG;AACH,MAAsB,iBAAiB;IAQ1B;IAIA;IAXX;;OAEG;IACH;IACE;;OAEG;IACM,WAA0B;IACnC;;OAEG;IACM,QAAkC;QAJlC,gBAAW,GAAX,WAAW,CAAe;QAI1B,aAAQ,GAAR,QAAQ,CAA0B;IAC1C,CAAC;IAQJ;;;;OAIG;IACI,SAAS,CAAC,QAA8B;QAC7C,OAAO,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IAC3C,CAAC;IAED;;;;;OAKG;IACI,GAAG,CAAC,QAA8B,EAAE,OAAe;QACxD,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACvC,CAAC;CACF;AAvCD,8CAuCC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n HttpPipelineLogLevel,\n RequestPolicy,\n RequestPolicyOptionsLike,\n WebResourceLike,\n CompatResponse as HttpOperationResponse,\n} from \"@azure/core-http-compat\";\n\n/**\n * The base class from which all request policies derive.\n */\nexport abstract class BaseRequestPolicy implements RequestPolicy {\n /**\n * The main method to implement that manipulates a request/response.\n */\n protected constructor(\n /**\n * The next policy in the pipeline. Each policy is responsible for executing the next one if the request is to continue through the pipeline.\n */\n readonly _nextPolicy: RequestPolicy,\n /**\n * The options that can be passed to a given request policy.\n */\n readonly _options: RequestPolicyOptionsLike,\n ) {}\n\n /**\n * Sends a network request based on the given web resource.\n * @param webResource - A {@link WebResourceLike} that describes a HTTP request to be made.\n */\n public abstract sendRequest(webResource: WebResourceLike): Promise<HttpOperationResponse>;\n\n /**\n * Get whether or not a log with the provided log level should be logged.\n * @param logLevel - The log level of the log that will be logged.\n * @returns Whether or not a log with the provided log level should be logged.\n */\n public shouldLog(logLevel: HttpPipelineLogLevel): boolean {\n return this._options.shouldLog(logLevel);\n }\n\n /**\n * Attempt to log the provided message to the provided logger. If no logger was provided or if\n * the log level does not meat the logger's threshold, then nothing will be logged.\n * @param logLevel - The log level of this log.\n * @param message - The message of this log.\n */\n public log(logLevel: HttpPipelineLogLevel, message: string): void {\n this._options.log(logLevel, message);\n }\n}\n"]}
@@ -0,0 +1,28 @@
1
+ import type { RequestPolicy, RequestPolicyOptionsLike as RequestPolicyOptions, WebResourceLike as WebResource, CompatResponse as HttpOperationResponse } from "@azure/core-http-compat";
2
+ import { BaseRequestPolicy } from "./RequestPolicy.js";
3
+ /**
4
+ * StorageBrowserPolicy will handle differences between Node.js and browser runtime, including:
5
+ *
6
+ * 1. Browsers cache GET/HEAD requests by adding conditional headers such as 'IF_MODIFIED_SINCE'.
7
+ * StorageBrowserPolicy is a policy used to add a timestamp query to GET/HEAD request URL
8
+ * thus avoid the browser cache.
9
+ *
10
+ * 2. Remove cookie header for security
11
+ *
12
+ * 3. Remove content-length header to avoid browsers warning
13
+ */
14
+ export declare class StorageBrowserPolicy extends BaseRequestPolicy {
15
+ /**
16
+ * Creates an instance of StorageBrowserPolicy.
17
+ * @param nextPolicy -
18
+ * @param options -
19
+ */
20
+ constructor(nextPolicy: RequestPolicy, options: RequestPolicyOptions);
21
+ /**
22
+ * Sends out request.
23
+ *
24
+ * @param request -
25
+ */
26
+ sendRequest(request: WebResource): Promise<HttpOperationResponse>;
27
+ }
28
+ //# sourceMappingURL=StorageBrowserPolicy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StorageBrowserPolicy.d.ts","sourceRoot":"","sources":["../../../src/policies/StorageBrowserPolicy.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,aAAa,EACb,wBAAwB,IAAI,oBAAoB,EAChD,eAAe,IAAI,WAAW,EAC9B,cAAc,IAAI,qBAAqB,EACxC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAKvD;;;;;;;;;;GAUG;AACH,qBAAa,oBAAqB,SAAQ,iBAAiB;IACzD;;;;OAIG;gBAGS,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,oBAAoB;IAIpE;;;;OAIG;IACU,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAoB/E"}
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation.
3
+ // Licensed under the MIT License.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.StorageBrowserPolicy = void 0;
6
+ const RequestPolicy_js_1 = require("./RequestPolicy.js");
7
+ const core_util_1 = require("@azure/core-util");
8
+ const constants_js_1 = require("../utils/constants.js");
9
+ const utils_common_js_1 = require("../utils/utils.common.js");
10
+ /**
11
+ * StorageBrowserPolicy will handle differences between Node.js and browser runtime, including:
12
+ *
13
+ * 1. Browsers cache GET/HEAD requests by adding conditional headers such as 'IF_MODIFIED_SINCE'.
14
+ * StorageBrowserPolicy is a policy used to add a timestamp query to GET/HEAD request URL
15
+ * thus avoid the browser cache.
16
+ *
17
+ * 2. Remove cookie header for security
18
+ *
19
+ * 3. Remove content-length header to avoid browsers warning
20
+ */
21
+ class StorageBrowserPolicy extends RequestPolicy_js_1.BaseRequestPolicy {
22
+ /**
23
+ * Creates an instance of StorageBrowserPolicy.
24
+ * @param nextPolicy -
25
+ * @param options -
26
+ */
27
+ // The base class has a protected constructor. Adding a public one to enable constructing of this class.
28
+ /* eslint-disable-next-line @typescript-eslint/no-useless-constructor*/
29
+ constructor(nextPolicy, options) {
30
+ super(nextPolicy, options);
31
+ }
32
+ /**
33
+ * Sends out request.
34
+ *
35
+ * @param request -
36
+ */
37
+ async sendRequest(request) {
38
+ if (core_util_1.isNodeLike) {
39
+ return this._nextPolicy.sendRequest(request);
40
+ }
41
+ if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") {
42
+ request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, new Date().getTime().toString());
43
+ }
44
+ request.headers.remove(constants_js_1.HeaderConstants.COOKIE);
45
+ // According to XHR standards, content-length should be fully controlled by browsers
46
+ request.headers.remove(constants_js_1.HeaderConstants.CONTENT_LENGTH);
47
+ return this._nextPolicy.sendRequest(request);
48
+ }
49
+ }
50
+ exports.StorageBrowserPolicy = StorageBrowserPolicy;
51
+ //# sourceMappingURL=StorageBrowserPolicy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StorageBrowserPolicy.js","sourceRoot":"","sources":["../../../src/policies/StorageBrowserPolicy.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAQlC,yDAAuD;AACvD,gDAA8C;AAC9C,wDAAsE;AACtE,8DAA2D;AAE3D;;;;;;;;;;GAUG;AACH,MAAa,oBAAqB,SAAQ,oCAAiB;IACzD;;;;OAIG;IACH,wGAAwG;IACxG,uEAAuE;IACvE,YAAY,UAAyB,EAAE,OAA6B;QAClE,KAAK,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAC7B,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,WAAW,CAAC,OAAoB;QAC3C,IAAI,sBAAU,EAAE,CAAC;YACf,OAAO,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAC/C,CAAC;QAED,IAAI,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,MAAM,EAAE,CAAC;YACtF,OAAO,CAAC,GAAG,GAAG,IAAA,iCAAe,EAC3B,OAAO,CAAC,GAAG,EACX,2BAAY,CAAC,UAAU,CAAC,sBAAsB,EAC9C,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAChC,CAAC;QACJ,CAAC;QAED,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,8BAAe,CAAC,MAAM,CAAC,CAAC;QAE/C,oFAAoF;QACpF,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,8BAAe,CAAC,cAAc,CAAC,CAAC;QAEvD,OAAO,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAC/C,CAAC;CACF;AArCD,oDAqCC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n RequestPolicy,\n RequestPolicyOptionsLike as RequestPolicyOptions,\n WebResourceLike as WebResource,\n CompatResponse as HttpOperationResponse,\n} from \"@azure/core-http-compat\";\nimport { BaseRequestPolicy } from \"./RequestPolicy.js\";\nimport { isNodeLike } from \"@azure/core-util\";\nimport { HeaderConstants, URLConstants } from \"../utils/constants.js\";\nimport { setURLParameter } from \"../utils/utils.common.js\";\n\n/**\n * StorageBrowserPolicy will handle differences between Node.js and browser runtime, including:\n *\n * 1. Browsers cache GET/HEAD requests by adding conditional headers such as 'IF_MODIFIED_SINCE'.\n * StorageBrowserPolicy is a policy used to add a timestamp query to GET/HEAD request URL\n * thus avoid the browser cache.\n *\n * 2. Remove cookie header for security\n *\n * 3. Remove content-length header to avoid browsers warning\n */\nexport class StorageBrowserPolicy extends BaseRequestPolicy {\n /**\n * Creates an instance of StorageBrowserPolicy.\n * @param nextPolicy -\n * @param options -\n */\n // The base class has a protected constructor. Adding a public one to enable constructing of this class.\n /* eslint-disable-next-line @typescript-eslint/no-useless-constructor*/\n constructor(nextPolicy: RequestPolicy, options: RequestPolicyOptions) {\n super(nextPolicy, options);\n }\n\n /**\n * Sends out request.\n *\n * @param request -\n */\n public async sendRequest(request: WebResource): Promise<HttpOperationResponse> {\n if (isNodeLike) {\n return this._nextPolicy.sendRequest(request);\n }\n\n if (request.method.toUpperCase() === \"GET\" || request.method.toUpperCase() === \"HEAD\") {\n request.url = setURLParameter(\n request.url,\n URLConstants.Parameters.FORCE_BROWSER_NO_CACHE,\n new Date().getTime().toString(),\n );\n }\n\n request.headers.remove(HeaderConstants.COOKIE);\n\n // According to XHR standards, content-length should be fully controlled by browsers\n request.headers.remove(HeaderConstants.CONTENT_LENGTH);\n\n return this._nextPolicy.sendRequest(request);\n }\n}\n"]}
@@ -0,0 +1,11 @@
1
+ import type { PipelinePolicy } from "@azure/core-rest-pipeline";
2
+ /**
3
+ * The programmatic identifier of the StorageBrowserPolicy.
4
+ */
5
+ export declare const storageBrowserPolicyName = "storageBrowserPolicy";
6
+ /**
7
+ * storageBrowserPolicy is a policy used to prevent browsers from caching requests
8
+ * and to remove cookies and explicit content-length headers.
9
+ */
10
+ export declare function storageBrowserPolicy(): PipelinePolicy;
11
+ //# sourceMappingURL=StorageBrowserPolicyV2.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StorageBrowserPolicyV2.d.ts","sourceRoot":"","sources":["../../../src/policies/StorageBrowserPolicyV2.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAIV,cAAc,EACf,MAAM,2BAA2B,CAAC;AAKnC;;GAEG;AACH,eAAO,MAAM,wBAAwB,yBAAyB,CAAC;AAE/D;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,cAAc,CAuBrD"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation.
3
+ // Licensed under the MIT License.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.storageBrowserPolicyName = void 0;
6
+ exports.storageBrowserPolicy = storageBrowserPolicy;
7
+ const core_util_1 = require("@azure/core-util");
8
+ const constants_js_1 = require("../utils/constants.js");
9
+ const utils_common_js_1 = require("../utils/utils.common.js");
10
+ /**
11
+ * The programmatic identifier of the StorageBrowserPolicy.
12
+ */
13
+ exports.storageBrowserPolicyName = "storageBrowserPolicy";
14
+ /**
15
+ * storageBrowserPolicy is a policy used to prevent browsers from caching requests
16
+ * and to remove cookies and explicit content-length headers.
17
+ */
18
+ function storageBrowserPolicy() {
19
+ return {
20
+ name: exports.storageBrowserPolicyName,
21
+ async sendRequest(request, next) {
22
+ if (core_util_1.isNodeLike) {
23
+ return next(request);
24
+ }
25
+ if (request.method === "GET" || request.method === "HEAD") {
26
+ request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, new Date().getTime().toString());
27
+ }
28
+ request.headers.delete(constants_js_1.HeaderConstants.COOKIE);
29
+ // According to XHR standards, content-length should be fully controlled by browsers
30
+ request.headers.delete(constants_js_1.HeaderConstants.CONTENT_LENGTH);
31
+ return next(request);
32
+ },
33
+ };
34
+ }
35
+ //# sourceMappingURL=StorageBrowserPolicyV2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StorageBrowserPolicyV2.js","sourceRoot":"","sources":["../../../src/policies/StorageBrowserPolicyV2.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAqBlC,oDAuBC;AApCD,gDAA8C;AAC9C,wDAAsE;AACtE,8DAA2D;AAE3D;;GAEG;AACU,QAAA,wBAAwB,GAAG,sBAAsB,CAAC;AAE/D;;;GAGG;AACH,SAAgB,oBAAoB;IAClC,OAAO;QACL,IAAI,EAAE,gCAAwB;QAC9B,KAAK,CAAC,WAAW,CAAC,OAAwB,EAAE,IAAiB;YAC3D,IAAI,sBAAU,EAAE,CAAC;gBACf,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;YACvB,CAAC;YAED,IAAI,OAAO,CAAC,MAAM,KAAK,KAAK,IAAI,OAAO,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;gBAC1D,OAAO,CAAC,GAAG,GAAG,IAAA,iCAAe,EAC3B,OAAO,CAAC,GAAG,EACX,2BAAY,CAAC,UAAU,CAAC,sBAAsB,EAC9C,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAChC,CAAC;YACJ,CAAC;YAED,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,8BAAe,CAAC,MAAM,CAAC,CAAC;YAE/C,oFAAoF;YACpF,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,8BAAe,CAAC,cAAc,CAAC,CAAC;YACvD,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;QACvB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n PipelinePolicy,\n} from \"@azure/core-rest-pipeline\";\nimport { isNodeLike } from \"@azure/core-util\";\nimport { HeaderConstants, URLConstants } from \"../utils/constants.js\";\nimport { setURLParameter } from \"../utils/utils.common.js\";\n\n/**\n * The programmatic identifier of the StorageBrowserPolicy.\n */\nexport const storageBrowserPolicyName = \"storageBrowserPolicy\";\n\n/**\n * storageBrowserPolicy is a policy used to prevent browsers from caching requests\n * and to remove cookies and explicit content-length headers.\n */\nexport function storageBrowserPolicy(): PipelinePolicy {\n return {\n name: storageBrowserPolicyName,\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n if (isNodeLike) {\n return next(request);\n }\n\n if (request.method === \"GET\" || request.method === \"HEAD\") {\n request.url = setURLParameter(\n request.url,\n URLConstants.Parameters.FORCE_BROWSER_NO_CACHE,\n new Date().getTime().toString(),\n );\n }\n\n request.headers.delete(HeaderConstants.COOKIE);\n\n // According to XHR standards, content-length should be fully controlled by browsers\n request.headers.delete(HeaderConstants.CONTENT_LENGTH);\n return next(request);\n },\n };\n}\n"]}
@@ -0,0 +1,10 @@
1
+ import type { PipelinePolicy } from "@azure/core-rest-pipeline";
2
+ /**
3
+ * The programmatic identifier of the storageCorrectContentLengthPolicy.
4
+ */
5
+ export declare const storageCorrectContentLengthPolicyName = "StorageCorrectContentLengthPolicy";
6
+ /**
7
+ * storageCorrectContentLengthPolicy to correctly set Content-Length header with request body length.
8
+ */
9
+ export declare function storageCorrectContentLengthPolicy(): PipelinePolicy;
10
+ //# sourceMappingURL=StorageCorrectContentLengthPolicy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StorageCorrectContentLengthPolicy.d.ts","sourceRoot":"","sources":["../../../src/policies/StorageCorrectContentLengthPolicy.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAIV,cAAc,EACf,MAAM,2BAA2B,CAAC;AAGnC;;GAEG;AACH,eAAO,MAAM,qCAAqC,sCAAsC,CAAC;AAEzF;;GAEG;AACH,wBAAgB,iCAAiC,IAAI,cAAc,CAkBlE"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation.
3
+ // Licensed under the MIT License.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.storageCorrectContentLengthPolicyName = void 0;
6
+ exports.storageCorrectContentLengthPolicy = storageCorrectContentLengthPolicy;
7
+ const constants_js_1 = require("../utils/constants.js");
8
+ /**
9
+ * The programmatic identifier of the storageCorrectContentLengthPolicy.
10
+ */
11
+ exports.storageCorrectContentLengthPolicyName = "StorageCorrectContentLengthPolicy";
12
+ /**
13
+ * storageCorrectContentLengthPolicy to correctly set Content-Length header with request body length.
14
+ */
15
+ function storageCorrectContentLengthPolicy() {
16
+ function correctContentLength(request) {
17
+ if (request.body &&
18
+ (typeof request.body === "string" || Buffer.isBuffer(request.body)) &&
19
+ request.body.length > 0) {
20
+ request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body));
21
+ }
22
+ }
23
+ return {
24
+ name: exports.storageCorrectContentLengthPolicyName,
25
+ async sendRequest(request, next) {
26
+ correctContentLength(request);
27
+ return next(request);
28
+ },
29
+ };
30
+ }
31
+ //# sourceMappingURL=StorageCorrectContentLengthPolicy.js.map