@fluidframework/odsp-driver 1.4.0-121020 → 2.0.0-dev-rc.1.0.0.225277

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 (666) hide show
  1. package/.eslintrc.js +12 -12
  2. package/.mocharc.js +12 -0
  3. package/CHANGELOG.md +162 -0
  4. package/README.md +56 -0
  5. package/api-extractor-esm.json +4 -0
  6. package/api-extractor-lint.json +4 -0
  7. package/api-extractor.json +2 -2
  8. package/api-report/odsp-driver.api.md +309 -0
  9. package/dist/{ReadBufferUtils.js → ReadBufferUtils.cjs} +16 -9
  10. package/dist/ReadBufferUtils.cjs.map +1 -0
  11. package/dist/ReadBufferUtils.d.ts.map +1 -1
  12. package/dist/{WriteBufferUtils.js → WriteBufferUtils.cjs} +73 -69
  13. package/dist/WriteBufferUtils.cjs.map +1 -0
  14. package/dist/WriteBufferUtils.d.ts +3 -5
  15. package/dist/WriteBufferUtils.d.ts.map +1 -1
  16. package/dist/{checkUrl.js → checkUrl.cjs} +7 -6
  17. package/dist/checkUrl.cjs.map +1 -0
  18. package/dist/checkUrl.d.ts +1 -0
  19. package/dist/checkUrl.d.ts.map +1 -1
  20. package/dist/compactSnapshotParser.cjs +207 -0
  21. package/dist/compactSnapshotParser.cjs.map +1 -0
  22. package/dist/compactSnapshotParser.d.ts +12 -3
  23. package/dist/compactSnapshotParser.d.ts.map +1 -1
  24. package/dist/{compactSnapshotWriter.js → compactSnapshotWriter.cjs} +43 -33
  25. package/dist/compactSnapshotWriter.cjs.map +1 -0
  26. package/dist/compactSnapshotWriter.d.ts +2 -3
  27. package/dist/compactSnapshotWriter.d.ts.map +1 -1
  28. package/dist/{constants.js → constants.cjs} +7 -1
  29. package/dist/constants.cjs.map +1 -0
  30. package/dist/constants.d.ts +6 -0
  31. package/dist/constants.d.ts.map +1 -1
  32. package/dist/{contracts.js → contracts.cjs} +1 -1
  33. package/dist/contracts.cjs.map +1 -0
  34. package/dist/contracts.d.ts +16 -53
  35. package/dist/contracts.d.ts.map +1 -1
  36. package/dist/{contractsPublic.js → contractsPublic.cjs} +9 -3
  37. package/dist/contractsPublic.cjs.map +1 -0
  38. package/dist/contractsPublic.d.ts +15 -0
  39. package/dist/contractsPublic.d.ts.map +1 -1
  40. package/dist/createFile.cjs +177 -0
  41. package/dist/createFile.cjs.map +1 -0
  42. package/dist/createFile.d.ts +6 -10
  43. package/dist/createFile.d.ts.map +1 -1
  44. package/dist/createNewContainerOnExistingFile.cjs +60 -0
  45. package/dist/createNewContainerOnExistingFile.cjs.map +1 -0
  46. package/dist/createNewContainerOnExistingFile.d.ts +22 -0
  47. package/dist/createNewContainerOnExistingFile.d.ts.map +1 -0
  48. package/dist/createNewModule.cjs +12 -0
  49. package/dist/createNewModule.cjs.map +1 -0
  50. package/dist/createNewModule.d.ts +7 -0
  51. package/dist/createNewModule.d.ts.map +1 -0
  52. package/dist/createNewUtils.cjs +203 -0
  53. package/dist/createNewUtils.cjs.map +1 -0
  54. package/dist/createNewUtils.d.ts +16 -0
  55. package/dist/createNewUtils.d.ts.map +1 -1
  56. package/dist/{createOdspCreateContainerRequest.js → createOdspCreateContainerRequest.cjs} +8 -4
  57. package/dist/createOdspCreateContainerRequest.cjs.map +1 -0
  58. package/dist/createOdspCreateContainerRequest.d.ts +5 -3
  59. package/dist/createOdspCreateContainerRequest.d.ts.map +1 -1
  60. package/dist/{createOdspUrl.js → createOdspUrl.cjs} +2 -1
  61. package/dist/createOdspUrl.cjs.map +1 -0
  62. package/dist/createOdspUrl.d.ts +1 -0
  63. package/dist/createOdspUrl.d.ts.map +1 -1
  64. package/dist/{epochTracker.js → epochTracker.cjs} +102 -48
  65. package/dist/epochTracker.cjs.map +1 -0
  66. package/dist/epochTracker.d.ts +32 -8
  67. package/dist/epochTracker.d.ts.map +1 -1
  68. package/dist/{fetch.js → fetch.cjs} +1 -1
  69. package/dist/fetch.cjs.map +1 -0
  70. package/dist/fetch.d.ts +1 -1
  71. package/dist/fetch.d.ts.map +1 -1
  72. package/dist/{fetchSnapshot.js → fetchSnapshot.cjs} +192 -176
  73. package/dist/fetchSnapshot.cjs.map +1 -0
  74. package/dist/fetchSnapshot.d.ts +10 -5
  75. package/dist/fetchSnapshot.d.ts.map +1 -1
  76. package/dist/{getFileLink.js → getFileLink.cjs} +52 -41
  77. package/dist/getFileLink.cjs.map +1 -0
  78. package/dist/getFileLink.d.ts +4 -7
  79. package/dist/getFileLink.d.ts.map +1 -1
  80. package/dist/{getQueryString.js → getQueryString.cjs} +1 -1
  81. package/dist/getQueryString.cjs.map +1 -0
  82. package/dist/getQueryString.d.ts.map +1 -1
  83. package/dist/{getUrlAndHeadersWithAuth.js → getUrlAndHeadersWithAuth.cjs} +4 -2
  84. package/dist/getUrlAndHeadersWithAuth.cjs.map +1 -0
  85. package/dist/getUrlAndHeadersWithAuth.d.ts.map +1 -1
  86. package/dist/index.cjs +59 -0
  87. package/dist/index.cjs.map +1 -0
  88. package/dist/index.d.ts +19 -16
  89. package/dist/index.d.ts.map +1 -1
  90. package/dist/localOdspDriver/localOdspDeltaStorageService.cjs +35 -0
  91. package/dist/localOdspDriver/localOdspDeltaStorageService.cjs.map +1 -0
  92. package/dist/localOdspDriver/localOdspDeltaStorageService.d.ts +17 -0
  93. package/dist/localOdspDriver/localOdspDeltaStorageService.d.ts.map +1 -0
  94. package/dist/localOdspDriver/{localOdspDocumentService.js → localOdspDocumentService.cjs} +7 -5
  95. package/dist/localOdspDriver/localOdspDocumentService.cjs.map +1 -0
  96. package/dist/localOdspDriver/localOdspDocumentService.d.ts +3 -2
  97. package/dist/localOdspDriver/localOdspDocumentService.d.ts.map +1 -1
  98. package/dist/localOdspDriver/{localOdspDocumentServiceFactory.js → localOdspDocumentServiceFactory.cjs} +9 -10
  99. package/dist/localOdspDriver/localOdspDocumentServiceFactory.cjs.map +1 -0
  100. package/dist/localOdspDriver/localOdspDocumentServiceFactory.d.ts +2 -3
  101. package/dist/localOdspDriver/localOdspDocumentServiceFactory.d.ts.map +1 -1
  102. package/dist/localOdspDriver/{localOdspDocumentStorageManager.js → localOdspDocumentStorageManager.cjs} +13 -11
  103. package/dist/localOdspDriver/localOdspDocumentStorageManager.cjs.map +1 -0
  104. package/dist/localOdspDriver/localOdspDocumentStorageManager.d.ts +2 -2
  105. package/dist/localOdspDriver/localOdspDocumentStorageManager.d.ts.map +1 -1
  106. package/dist/odsp-driver-alpha.d.ts +496 -0
  107. package/dist/odsp-driver-beta.d.ts +160 -0
  108. package/dist/odsp-driver-public.d.ts +160 -0
  109. package/dist/odsp-driver-untrimmed.d.ts +565 -0
  110. package/dist/{odspCache.js → odspCache.cjs} +9 -10
  111. package/dist/odspCache.cjs.map +1 -0
  112. package/dist/odspCache.d.ts +19 -4
  113. package/dist/odspCache.d.ts.map +1 -1
  114. package/dist/odspDelayLoadedDeltaStream.cjs +291 -0
  115. package/dist/odspDelayLoadedDeltaStream.cjs.map +1 -0
  116. package/dist/odspDelayLoadedDeltaStream.d.ts +75 -0
  117. package/dist/odspDelayLoadedDeltaStream.d.ts.map +1 -0
  118. package/dist/{odspDeltaStorageService.js → odspDeltaStorageService.cjs} +70 -71
  119. package/dist/odspDeltaStorageService.cjs.map +1 -0
  120. package/dist/odspDeltaStorageService.d.ts +8 -6
  121. package/dist/odspDeltaStorageService.d.ts.map +1 -1
  122. package/dist/{odspDocumentDeltaConnection.js → odspDocumentDeltaConnection.cjs} +224 -113
  123. package/dist/odspDocumentDeltaConnection.cjs.map +1 -0
  124. package/dist/odspDocumentDeltaConnection.d.ts +32 -12
  125. package/dist/odspDocumentDeltaConnection.d.ts.map +1 -1
  126. package/dist/odspDocumentService.cjs +225 -0
  127. package/dist/odspDocumentService.cjs.map +1 -0
  128. package/dist/odspDocumentService.d.ts +11 -25
  129. package/dist/odspDocumentService.d.ts.map +1 -1
  130. package/dist/{odspDocumentServiceFactory.js → odspDocumentServiceFactory.cjs} +8 -5
  131. package/dist/odspDocumentServiceFactory.cjs.map +1 -0
  132. package/dist/odspDocumentServiceFactory.d.ts +4 -0
  133. package/dist/odspDocumentServiceFactory.d.ts.map +1 -1
  134. package/dist/odspDocumentServiceFactoryCore.cjs +196 -0
  135. package/dist/odspDocumentServiceFactoryCore.cjs.map +1 -0
  136. package/dist/odspDocumentServiceFactoryCore.d.ts +18 -11
  137. package/dist/odspDocumentServiceFactoryCore.d.ts.map +1 -1
  138. package/dist/odspDocumentServiceFactoryWithCodeSplit.cjs +20 -0
  139. package/dist/odspDocumentServiceFactoryWithCodeSplit.cjs.map +1 -0
  140. package/dist/odspDocumentServiceFactoryWithCodeSplit.d.ts +5 -0
  141. package/dist/odspDocumentServiceFactoryWithCodeSplit.d.ts.map +1 -1
  142. package/dist/odspDocumentStorageManager.cjs +490 -0
  143. package/dist/odspDocumentStorageManager.cjs.map +1 -0
  144. package/dist/odspDocumentStorageManager.d.ts +11 -5
  145. package/dist/odspDocumentStorageManager.d.ts.map +1 -1
  146. package/dist/{odspDocumentStorageServiceBase.js → odspDocumentStorageServiceBase.cjs} +32 -34
  147. package/dist/odspDocumentStorageServiceBase.cjs.map +1 -0
  148. package/dist/odspDocumentStorageServiceBase.d.ts +7 -9
  149. package/dist/odspDocumentStorageServiceBase.d.ts.map +1 -1
  150. package/dist/{odspDriverUrlResolver.js → odspDriverUrlResolver.cjs} +50 -36
  151. package/dist/odspDriverUrlResolver.cjs.map +1 -0
  152. package/dist/odspDriverUrlResolver.d.ts +12 -0
  153. package/dist/odspDriverUrlResolver.d.ts.map +1 -1
  154. package/dist/{odspDriverUrlResolverForShareLink.js → odspDriverUrlResolverForShareLink.cjs} +37 -26
  155. package/dist/odspDriverUrlResolverForShareLink.cjs.map +1 -0
  156. package/dist/odspDriverUrlResolverForShareLink.d.ts +5 -3
  157. package/dist/odspDriverUrlResolverForShareLink.d.ts.map +1 -1
  158. package/dist/{odspError.js → odspError.cjs} +7 -3
  159. package/dist/odspError.cjs.map +1 -0
  160. package/dist/odspError.d.ts.map +1 -1
  161. package/dist/{odspFluidFileLink.js → odspFluidFileLink.cjs} +25 -18
  162. package/dist/odspFluidFileLink.cjs.map +1 -0
  163. package/dist/odspFluidFileLink.d.ts +10 -1
  164. package/dist/odspFluidFileLink.d.ts.map +1 -1
  165. package/dist/odspLocationRedirection.cjs +24 -0
  166. package/dist/odspLocationRedirection.cjs.map +1 -0
  167. package/dist/odspLocationRedirection.d.ts +14 -0
  168. package/dist/odspLocationRedirection.d.ts.map +1 -0
  169. package/dist/{odspPublicUtils.js → odspPublicUtils.cjs} +7 -4
  170. package/dist/odspPublicUtils.cjs.map +1 -0
  171. package/dist/odspPublicUtils.d.ts +6 -0
  172. package/dist/odspPublicUtils.d.ts.map +1 -1
  173. package/dist/{odspSnapshotParser.js → odspSnapshotParser.cjs} +11 -12
  174. package/dist/odspSnapshotParser.cjs.map +1 -0
  175. package/dist/odspSnapshotParser.d.ts.map +1 -1
  176. package/dist/{odspSummaryUploadManager.js → odspSummaryUploadManager.cjs} +47 -34
  177. package/dist/odspSummaryUploadManager.cjs.map +1 -0
  178. package/dist/odspSummaryUploadManager.d.ts +7 -4
  179. package/dist/odspSummaryUploadManager.d.ts.map +1 -1
  180. package/dist/{odspUrlHelper.js → odspUrlHelper.cjs} +9 -3
  181. package/dist/odspUrlHelper.cjs.map +1 -0
  182. package/dist/odspUrlHelper.d.ts +5 -0
  183. package/dist/odspUrlHelper.d.ts.map +1 -1
  184. package/dist/{odspUtils.js → odspUtils.cjs} +118 -30
  185. package/dist/odspUtils.cjs.map +1 -0
  186. package/dist/odspUtils.d.ts +35 -6
  187. package/dist/odspUtils.d.ts.map +1 -1
  188. package/dist/{opsCaching.js → opsCaching.cjs} +25 -9
  189. package/dist/opsCaching.cjs.map +1 -0
  190. package/dist/opsCaching.d.ts +3 -3
  191. package/dist/opsCaching.d.ts.map +1 -1
  192. package/dist/{packageVersion.js → packageVersion.cjs} +2 -2
  193. package/dist/packageVersion.cjs.map +1 -0
  194. package/dist/packageVersion.d.ts +1 -1
  195. package/dist/packageVersion.d.ts.map +1 -1
  196. package/dist/prefetchLatestSnapshot.cjs +100 -0
  197. package/dist/prefetchLatestSnapshot.cjs.map +1 -0
  198. package/dist/prefetchLatestSnapshot.d.ts +12 -7
  199. package/dist/prefetchLatestSnapshot.d.ts.map +1 -1
  200. package/dist/{retryErrorsStorageAdapter.js → retryErrorsStorageAdapter.cjs} +13 -6
  201. package/dist/retryErrorsStorageAdapter.cjs.map +1 -0
  202. package/dist/retryErrorsStorageAdapter.d.ts +5 -4
  203. package/dist/retryErrorsStorageAdapter.d.ts.map +1 -1
  204. package/dist/{retryUtils.js → retryUtils.cjs} +30 -14
  205. package/dist/retryUtils.cjs.map +1 -0
  206. package/dist/retryUtils.d.ts +2 -2
  207. package/dist/retryUtils.d.ts.map +1 -1
  208. package/dist/socketModule.cjs +10 -0
  209. package/dist/socketModule.cjs.map +1 -0
  210. package/dist/socketModule.d.ts +7 -0
  211. package/dist/socketModule.d.ts.map +1 -0
  212. package/dist/tsdoc-metadata.json +11 -0
  213. package/dist/{vroom.js → vroom.cjs} +24 -9
  214. package/dist/vroom.cjs.map +1 -0
  215. package/dist/vroom.d.ts +4 -4
  216. package/dist/vroom.d.ts.map +1 -1
  217. package/dist/{zipItDataRepresentationUtils.js → zipItDataRepresentationUtils.cjs} +227 -118
  218. package/dist/zipItDataRepresentationUtils.cjs.map +1 -0
  219. package/dist/zipItDataRepresentationUtils.d.ts +47 -20
  220. package/dist/zipItDataRepresentationUtils.d.ts.map +1 -1
  221. package/lib/{ReadBufferUtils.d.ts → ReadBufferUtils.d.mts} +1 -1
  222. package/lib/ReadBufferUtils.d.mts.map +1 -0
  223. package/lib/{ReadBufferUtils.js → ReadBufferUtils.mjs} +14 -7
  224. package/lib/ReadBufferUtils.mjs.map +1 -0
  225. package/lib/{WriteBufferUtils.d.ts → WriteBufferUtils.d.mts} +4 -6
  226. package/lib/WriteBufferUtils.d.mts.map +1 -0
  227. package/lib/{WriteBufferUtils.js → WriteBufferUtils.mjs} +68 -64
  228. package/lib/WriteBufferUtils.mjs.map +1 -0
  229. package/lib/{checkUrl.d.ts → checkUrl.d.mts} +2 -1
  230. package/lib/checkUrl.d.mts.map +1 -0
  231. package/lib/{checkUrl.js → checkUrl.mjs} +7 -6
  232. package/lib/checkUrl.mjs.map +1 -0
  233. package/lib/compactSnapshotParser.d.mts +24 -0
  234. package/lib/compactSnapshotParser.d.mts.map +1 -0
  235. package/lib/compactSnapshotParser.mjs +203 -0
  236. package/lib/compactSnapshotParser.mjs.map +1 -0
  237. package/lib/{compactSnapshotWriter.d.ts → compactSnapshotWriter.d.mts} +4 -5
  238. package/lib/compactSnapshotWriter.d.mts.map +1 -0
  239. package/lib/{compactSnapshotWriter.js → compactSnapshotWriter.mjs} +41 -31
  240. package/lib/compactSnapshotWriter.mjs.map +1 -0
  241. package/lib/{constants.d.ts → constants.d.mts} +7 -1
  242. package/lib/constants.d.mts.map +1 -0
  243. package/lib/{constants.js → constants.mjs} +7 -1
  244. package/lib/constants.mjs.map +1 -0
  245. package/lib/{contracts.d.ts → contracts.d.mts} +18 -55
  246. package/lib/contracts.d.mts.map +1 -0
  247. package/lib/{contracts.js → contracts.mjs} +1 -1
  248. package/lib/contracts.mjs.map +1 -0
  249. package/lib/{contractsPublic.d.ts → contractsPublic.d.mts} +16 -1
  250. package/lib/contractsPublic.d.mts.map +1 -0
  251. package/lib/{contractsPublic.js → contractsPublic.mjs} +7 -1
  252. package/lib/contractsPublic.mjs.map +1 -0
  253. package/lib/createFile.d.mts +18 -0
  254. package/lib/createFile.d.mts.map +1 -0
  255. package/lib/createFile.mjs +171 -0
  256. package/lib/createFile.mjs.map +1 -0
  257. package/lib/createNewContainerOnExistingFile.d.mts +22 -0
  258. package/lib/createNewContainerOnExistingFile.d.mts.map +1 -0
  259. package/lib/createNewContainerOnExistingFile.mjs +56 -0
  260. package/lib/createNewContainerOnExistingFile.mjs.map +1 -0
  261. package/lib/createNewModule.d.mts +7 -0
  262. package/lib/createNewModule.d.mts.map +1 -0
  263. package/lib/createNewModule.mjs +7 -0
  264. package/lib/createNewModule.mjs.map +1 -0
  265. package/lib/createNewUtils.d.mts +27 -0
  266. package/lib/createNewUtils.d.mts.map +1 -0
  267. package/lib/createNewUtils.mjs +197 -0
  268. package/lib/createNewUtils.mjs.map +1 -0
  269. package/lib/{createOdspCreateContainerRequest.d.ts → createOdspCreateContainerRequest.d.mts} +6 -8
  270. package/lib/createOdspCreateContainerRequest.d.mts.map +1 -0
  271. package/lib/{createOdspCreateContainerRequest.js → createOdspCreateContainerRequest.mjs} +8 -4
  272. package/lib/createOdspCreateContainerRequest.mjs.map +1 -0
  273. package/lib/{createOdspUrl.d.ts → createOdspUrl.d.mts} +3 -2
  274. package/lib/createOdspUrl.d.mts.map +1 -0
  275. package/lib/{createOdspUrl.js → createOdspUrl.mjs} +2 -1
  276. package/lib/createOdspUrl.mjs.map +1 -0
  277. package/lib/{epochTracker.d.ts → epochTracker.d.mts} +35 -11
  278. package/lib/epochTracker.d.mts.map +1 -0
  279. package/lib/{epochTracker.js → epochTracker.mjs} +97 -43
  280. package/lib/epochTracker.mjs.map +1 -0
  281. package/lib/{fetch.d.ts → fetch.d.mts} +2 -2
  282. package/lib/fetch.d.mts.map +1 -0
  283. package/lib/{fetch.js → fetch.mjs} +1 -1
  284. package/lib/fetch.mjs.map +1 -0
  285. package/lib/{fetchSnapshot.d.ts → fetchSnapshot.d.mts} +15 -10
  286. package/lib/fetchSnapshot.d.mts.map +1 -0
  287. package/lib/{fetchSnapshot.js → fetchSnapshot.mjs} +185 -167
  288. package/lib/fetchSnapshot.mjs.map +1 -0
  289. package/lib/{getFileLink.d.ts → getFileLink.d.mts} +5 -8
  290. package/lib/getFileLink.d.mts.map +1 -0
  291. package/lib/{getFileLink.js → getFileLink.mjs} +49 -38
  292. package/lib/getFileLink.mjs.map +1 -0
  293. package/lib/{getQueryString.d.ts → getQueryString.d.mts} +1 -5
  294. package/lib/getQueryString.d.mts.map +1 -0
  295. package/lib/{getQueryString.js → getQueryString.mjs} +1 -1
  296. package/lib/getQueryString.mjs.map +1 -0
  297. package/lib/{getUrlAndHeadersWithAuth.d.ts → getUrlAndHeadersWithAuth.d.mts} +1 -1
  298. package/lib/getUrlAndHeadersWithAuth.d.mts.map +1 -0
  299. package/lib/{getUrlAndHeadersWithAuth.js → getUrlAndHeadersWithAuth.mjs} +4 -2
  300. package/lib/getUrlAndHeadersWithAuth.mjs.map +1 -0
  301. package/lib/index.d.mts +24 -0
  302. package/lib/index.d.mts.map +1 -0
  303. package/lib/index.mjs +22 -0
  304. package/lib/index.mjs.map +1 -0
  305. package/lib/localOdspDriver/localOdspDeltaStorageService.d.mts +17 -0
  306. package/lib/localOdspDriver/localOdspDeltaStorageService.d.mts.map +1 -0
  307. package/lib/localOdspDriver/localOdspDeltaStorageService.mjs +31 -0
  308. package/lib/localOdspDriver/localOdspDeltaStorageService.mjs.map +1 -0
  309. package/lib/localOdspDriver/{localOdspDocumentService.d.ts → localOdspDocumentService.d.mts} +4 -3
  310. package/lib/localOdspDriver/localOdspDocumentService.d.mts.map +1 -0
  311. package/lib/localOdspDriver/{localOdspDocumentService.js → localOdspDocumentService.mjs} +8 -6
  312. package/lib/localOdspDriver/localOdspDocumentService.mjs.map +1 -0
  313. package/lib/localOdspDriver/{localOdspDocumentServiceFactory.d.ts → localOdspDocumentServiceFactory.d.mts} +5 -6
  314. package/lib/localOdspDriver/localOdspDocumentServiceFactory.d.mts.map +1 -0
  315. package/lib/localOdspDriver/{localOdspDocumentServiceFactory.js → localOdspDocumentServiceFactory.mjs} +9 -10
  316. package/lib/localOdspDriver/localOdspDocumentServiceFactory.mjs.map +1 -0
  317. package/lib/localOdspDriver/{localOdspDocumentStorageManager.d.ts → localOdspDocumentStorageManager.d.mts} +4 -4
  318. package/lib/localOdspDriver/localOdspDocumentStorageManager.d.mts.map +1 -0
  319. package/lib/localOdspDriver/{localOdspDocumentStorageManager.js → localOdspDocumentStorageManager.mjs} +11 -9
  320. package/lib/localOdspDriver/localOdspDocumentStorageManager.mjs.map +1 -0
  321. package/lib/odsp-driver-alpha.d.mts +496 -0
  322. package/lib/odsp-driver-beta.d.mts +160 -0
  323. package/lib/odsp-driver-public.d.mts +160 -0
  324. package/lib/odsp-driver-untrimmed.d.mts +565 -0
  325. package/lib/{odspCache.d.ts → odspCache.d.mts} +20 -9
  326. package/lib/odspCache.d.mts.map +1 -0
  327. package/lib/{odspCache.js → odspCache.mjs} +6 -11
  328. package/lib/odspCache.mjs.map +1 -0
  329. package/lib/odspDelayLoadedDeltaStream.d.mts +75 -0
  330. package/lib/odspDelayLoadedDeltaStream.d.mts.map +1 -0
  331. package/lib/odspDelayLoadedDeltaStream.mjs +287 -0
  332. package/lib/odspDelayLoadedDeltaStream.mjs.map +1 -0
  333. package/lib/{odspDeltaStorageService.d.ts → odspDeltaStorageService.d.mts} +10 -8
  334. package/lib/odspDeltaStorageService.d.mts.map +1 -0
  335. package/lib/{odspDeltaStorageService.js → odspDeltaStorageService.mjs} +70 -68
  336. package/lib/odspDeltaStorageService.mjs.map +1 -0
  337. package/lib/{odspDocumentDeltaConnection.d.ts → odspDocumentDeltaConnection.d.mts} +34 -14
  338. package/lib/odspDocumentDeltaConnection.d.mts.map +1 -0
  339. package/lib/{odspDocumentDeltaConnection.js → odspDocumentDeltaConnection.mjs} +214 -103
  340. package/lib/odspDocumentDeltaConnection.mjs.map +1 -0
  341. package/lib/{odspDocumentService.d.ts → odspDocumentService.d.mts} +15 -29
  342. package/lib/odspDocumentService.d.mts.map +1 -0
  343. package/lib/odspDocumentService.mjs +221 -0
  344. package/lib/odspDocumentService.mjs.map +1 -0
  345. package/lib/{odspDocumentServiceFactory.d.ts → odspDocumentServiceFactory.d.mts} +6 -2
  346. package/lib/odspDocumentServiceFactory.d.mts.map +1 -0
  347. package/lib/{odspDocumentServiceFactory.js → odspDocumentServiceFactory.mjs} +8 -6
  348. package/lib/odspDocumentServiceFactory.mjs.map +1 -0
  349. package/lib/{odspDocumentServiceFactoryCore.d.ts → odspDocumentServiceFactoryCore.d.mts} +20 -13
  350. package/lib/odspDocumentServiceFactoryCore.d.mts.map +1 -0
  351. package/lib/odspDocumentServiceFactoryCore.mjs +192 -0
  352. package/lib/odspDocumentServiceFactoryCore.mjs.map +1 -0
  353. package/lib/{odspDocumentServiceFactoryWithCodeSplit.d.ts → odspDocumentServiceFactoryWithCodeSplit.d.mts} +7 -2
  354. package/lib/odspDocumentServiceFactoryWithCodeSplit.d.mts.map +1 -0
  355. package/lib/{odspDocumentServiceFactoryWithCodeSplit.js → odspDocumentServiceFactoryWithCodeSplit.mjs} +8 -3
  356. package/lib/odspDocumentServiceFactoryWithCodeSplit.mjs.map +1 -0
  357. package/lib/{odspDocumentStorageManager.d.ts → odspDocumentStorageManager.d.mts} +18 -12
  358. package/lib/odspDocumentStorageManager.d.mts.map +1 -0
  359. package/lib/odspDocumentStorageManager.mjs +486 -0
  360. package/lib/odspDocumentStorageManager.mjs.map +1 -0
  361. package/lib/{odspDocumentStorageServiceBase.d.ts → odspDocumentStorageServiceBase.d.mts} +9 -11
  362. package/lib/odspDocumentStorageServiceBase.d.mts.map +1 -0
  363. package/lib/{odspDocumentStorageServiceBase.js → odspDocumentStorageServiceBase.mjs} +31 -33
  364. package/lib/odspDocumentStorageServiceBase.mjs.map +1 -0
  365. package/lib/{odspDriverUrlResolver.d.ts → odspDriverUrlResolver.d.mts} +13 -1
  366. package/lib/odspDriverUrlResolver.d.mts.map +1 -0
  367. package/lib/{odspDriverUrlResolver.js → odspDriverUrlResolver.mjs} +50 -40
  368. package/lib/odspDriverUrlResolver.mjs.map +1 -0
  369. package/lib/{odspDriverUrlResolverForShareLink.d.ts → odspDriverUrlResolverForShareLink.d.mts} +7 -5
  370. package/lib/odspDriverUrlResolverForShareLink.d.mts.map +1 -0
  371. package/lib/{odspDriverUrlResolverForShareLink.js → odspDriverUrlResolverForShareLink.mjs} +36 -29
  372. package/lib/odspDriverUrlResolverForShareLink.mjs.map +1 -0
  373. package/lib/{odspError.d.ts → odspError.d.mts} +2 -2
  374. package/lib/odspError.d.mts.map +1 -0
  375. package/lib/{odspError.js → odspError.mjs} +7 -3
  376. package/lib/odspError.mjs.map +1 -0
  377. package/lib/{odspFluidFileLink.d.ts → odspFluidFileLink.d.mts} +12 -3
  378. package/lib/odspFluidFileLink.d.mts.map +1 -0
  379. package/lib/{odspFluidFileLink.js → odspFluidFileLink.mjs} +23 -16
  380. package/lib/odspFluidFileLink.mjs.map +1 -0
  381. package/lib/odspLocationRedirection.d.mts +14 -0
  382. package/lib/odspLocationRedirection.d.mts.map +1 -0
  383. package/lib/odspLocationRedirection.mjs +20 -0
  384. package/lib/odspLocationRedirection.mjs.map +1 -0
  385. package/lib/{odspPublicUtils.d.ts → odspPublicUtils.d.mts} +7 -1
  386. package/lib/odspPublicUtils.d.mts.map +1 -0
  387. package/lib/{odspPublicUtils.js → odspPublicUtils.mjs} +5 -2
  388. package/lib/odspPublicUtils.mjs.map +1 -0
  389. package/lib/{odspSnapshotParser.d.ts → odspSnapshotParser.d.mts} +3 -3
  390. package/lib/odspSnapshotParser.d.mts.map +1 -0
  391. package/lib/{odspSnapshotParser.js → odspSnapshotParser.mjs} +10 -11
  392. package/lib/odspSnapshotParser.mjs.map +1 -0
  393. package/lib/{odspSummaryUploadManager.d.ts → odspSummaryUploadManager.d.mts} +9 -6
  394. package/lib/odspSummaryUploadManager.d.mts.map +1 -0
  395. package/lib/{odspSummaryUploadManager.js → odspSummaryUploadManager.mjs} +41 -32
  396. package/lib/odspSummaryUploadManager.mjs.map +1 -0
  397. package/lib/{odspUrlHelper.d.ts → odspUrlHelper.d.mts} +6 -1
  398. package/lib/odspUrlHelper.d.mts.map +1 -0
  399. package/lib/{odspUrlHelper.js → odspUrlHelper.mjs} +9 -3
  400. package/lib/odspUrlHelper.mjs.map +1 -0
  401. package/lib/{odspUtils.d.ts → odspUtils.d.mts} +37 -8
  402. package/lib/odspUtils.d.mts.map +1 -0
  403. package/lib/{odspUtils.js → odspUtils.mjs} +109 -27
  404. package/lib/odspUtils.mjs.map +1 -0
  405. package/lib/{opsCaching.d.ts → opsCaching.d.mts} +4 -4
  406. package/lib/opsCaching.d.mts.map +1 -0
  407. package/lib/{opsCaching.js → opsCaching.mjs} +23 -7
  408. package/lib/opsCaching.mjs.map +1 -0
  409. package/lib/{packageVersion.d.ts → packageVersion.d.mts} +2 -2
  410. package/lib/packageVersion.d.mts.map +1 -0
  411. package/lib/{packageVersion.js → packageVersion.mjs} +2 -2
  412. package/lib/packageVersion.mjs.map +1 -0
  413. package/lib/{prefetchLatestSnapshot.d.ts → prefetchLatestSnapshot.d.mts} +14 -9
  414. package/lib/prefetchLatestSnapshot.d.mts.map +1 -0
  415. package/lib/prefetchLatestSnapshot.mjs +96 -0
  416. package/lib/prefetchLatestSnapshot.mjs.map +1 -0
  417. package/lib/{retryErrorsStorageAdapter.d.ts → retryErrorsStorageAdapter.d.mts} +6 -5
  418. package/lib/retryErrorsStorageAdapter.d.mts.map +1 -0
  419. package/lib/{retryErrorsStorageAdapter.js → retryErrorsStorageAdapter.mjs} +13 -6
  420. package/lib/retryErrorsStorageAdapter.mjs.map +1 -0
  421. package/lib/{retryUtils.d.ts → retryUtils.d.mts} +3 -3
  422. package/lib/retryUtils.d.mts.map +1 -0
  423. package/lib/{retryUtils.js → retryUtils.mjs} +27 -11
  424. package/lib/retryUtils.mjs.map +1 -0
  425. package/lib/socketModule.d.mts +7 -0
  426. package/lib/socketModule.d.mts.map +1 -0
  427. package/lib/socketModule.mjs +7 -0
  428. package/lib/socketModule.mjs.map +1 -0
  429. package/lib/{vroom.d.ts → vroom.d.mts} +7 -7
  430. package/lib/vroom.d.mts.map +1 -0
  431. package/lib/{vroom.js → vroom.mjs} +24 -9
  432. package/lib/vroom.mjs.map +1 -0
  433. package/lib/{zipItDataRepresentationUtils.d.ts → zipItDataRepresentationUtils.d.mts} +49 -22
  434. package/lib/zipItDataRepresentationUtils.d.mts.map +1 -0
  435. package/lib/{zipItDataRepresentationUtils.js → zipItDataRepresentationUtils.mjs} +213 -111
  436. package/lib/zipItDataRepresentationUtils.mjs.map +1 -0
  437. package/package.json +87 -69
  438. package/prettier.config.cjs +8 -0
  439. package/src/ReadBufferUtils.ts +51 -44
  440. package/src/WriteBufferUtils.ts +203 -181
  441. package/src/checkUrl.ts +16 -15
  442. package/src/compactSnapshotParser.ts +219 -103
  443. package/src/compactSnapshotWriter.ts +118 -97
  444. package/src/constants.ts +7 -0
  445. package/src/contracts.ts +96 -136
  446. package/src/contractsPublic.ts +31 -16
  447. package/src/createFile.ts +243 -305
  448. package/src/createNewContainerOnExistingFile.ts +93 -0
  449. package/src/createNewModule.ts +7 -0
  450. package/src/createNewUtils.ts +266 -56
  451. package/src/createOdspCreateContainerRequest.ts +22 -18
  452. package/src/createOdspUrl.ts +12 -13
  453. package/src/epochTracker.ts +596 -457
  454. package/src/fetch.ts +4 -4
  455. package/src/fetchSnapshot.ts +583 -508
  456. package/src/getFileLink.ts +194 -155
  457. package/src/getQueryString.ts +11 -9
  458. package/src/getUrlAndHeadersWithAuth.ts +34 -33
  459. package/src/index.ts +42 -18
  460. package/src/localOdspDriver/localOdspDeltaStorageService.ts +49 -0
  461. package/src/localOdspDriver/localOdspDocumentService.ts +40 -38
  462. package/src/localOdspDriver/localOdspDocumentServiceFactory.ts +46 -43
  463. package/src/localOdspDriver/localOdspDocumentStorageManager.ts +55 -50
  464. package/src/odspCache.ts +112 -90
  465. package/src/odspDelayLoadedDeltaStream.ts +459 -0
  466. package/src/odspDeltaStorageService.ts +232 -221
  467. package/src/odspDocumentDeltaConnection.ts +751 -563
  468. package/src/odspDocumentService.ts +324 -523
  469. package/src/odspDocumentServiceFactory.ts +20 -21
  470. package/src/odspDocumentServiceFactoryCore.ts +329 -200
  471. package/src/odspDocumentServiceFactoryWithCodeSplit.ts +20 -20
  472. package/src/odspDocumentStorageManager.ts +730 -534
  473. package/src/odspDocumentStorageServiceBase.ts +279 -254
  474. package/src/odspDriverUrlResolver.ts +230 -188
  475. package/src/odspDriverUrlResolverForShareLink.ts +223 -203
  476. package/src/odspError.ts +27 -19
  477. package/src/odspFluidFileLink.ts +106 -87
  478. package/src/odspLocationRedirection.ts +26 -0
  479. package/src/odspPublicUtils.ts +20 -14
  480. package/src/odspSnapshotParser.ts +53 -46
  481. package/src/odspSummaryUploadManager.ts +243 -218
  482. package/src/odspUrlHelper.ts +81 -71
  483. package/src/odspUtils.ts +401 -259
  484. package/src/opsCaching.ts +214 -193
  485. package/src/packageVersion.ts +1 -1
  486. package/src/prefetchLatestSnapshot.ts +142 -80
  487. package/src/retryErrorsStorageAdapter.ts +92 -77
  488. package/src/retryUtils.ts +80 -57
  489. package/src/socketModule.ts +8 -0
  490. package/src/vroom.ts +92 -83
  491. package/src/zipItDataRepresentationUtils.ts +534 -394
  492. package/tsc-multi.test.json +4 -0
  493. package/tsconfig.json +11 -13
  494. package/.editorconfig +0 -7
  495. package/dist/ReadBufferUtils.js.map +0 -1
  496. package/dist/WriteBufferUtils.js.map +0 -1
  497. package/dist/checkUrl.js.map +0 -1
  498. package/dist/compactSnapshotParser.js +0 -115
  499. package/dist/compactSnapshotParser.js.map +0 -1
  500. package/dist/compactSnapshotWriter.js.map +0 -1
  501. package/dist/constants.js.map +0 -1
  502. package/dist/contracts.js.map +0 -1
  503. package/dist/contractsPublic.js.map +0 -1
  504. package/dist/createFile.js +0 -242
  505. package/dist/createFile.js.map +0 -1
  506. package/dist/createNewUtils.js +0 -67
  507. package/dist/createNewUtils.js.map +0 -1
  508. package/dist/createOdspCreateContainerRequest.js.map +0 -1
  509. package/dist/createOdspUrl.js.map +0 -1
  510. package/dist/epochTracker.js.map +0 -1
  511. package/dist/fetch.js.map +0 -1
  512. package/dist/fetchSnapshot.js.map +0 -1
  513. package/dist/getFileLink.js.map +0 -1
  514. package/dist/getQueryString.js.map +0 -1
  515. package/dist/getSocketIo.d.ts +0 -11
  516. package/dist/getSocketIo.d.ts.map +0 -1
  517. package/dist/getSocketIo.js +0 -20
  518. package/dist/getSocketIo.js.map +0 -1
  519. package/dist/getUrlAndHeadersWithAuth.js.map +0 -1
  520. package/dist/index.js +0 -41
  521. package/dist/index.js.map +0 -1
  522. package/dist/localOdspDriver/localOdspDocumentService.js.map +0 -1
  523. package/dist/localOdspDriver/localOdspDocumentServiceFactory.js.map +0 -1
  524. package/dist/localOdspDriver/localOdspDocumentStorageManager.js.map +0 -1
  525. package/dist/odspCache.js.map +0 -1
  526. package/dist/odspDeltaStorageService.js.map +0 -1
  527. package/dist/odspDocumentDeltaConnection.js.map +0 -1
  528. package/dist/odspDocumentService.js +0 -364
  529. package/dist/odspDocumentService.js.map +0 -1
  530. package/dist/odspDocumentServiceFactory.js.map +0 -1
  531. package/dist/odspDocumentServiceFactoryCore.js +0 -118
  532. package/dist/odspDocumentServiceFactoryCore.js.map +0 -1
  533. package/dist/odspDocumentServiceFactoryWithCodeSplit.js +0 -34
  534. package/dist/odspDocumentServiceFactoryWithCodeSplit.js.map +0 -1
  535. package/dist/odspDocumentStorageManager.js +0 -356
  536. package/dist/odspDocumentStorageManager.js.map +0 -1
  537. package/dist/odspDocumentStorageServiceBase.js.map +0 -1
  538. package/dist/odspDriverUrlResolver.js.map +0 -1
  539. package/dist/odspDriverUrlResolverForShareLink.js.map +0 -1
  540. package/dist/odspError.js.map +0 -1
  541. package/dist/odspFluidFileLink.js.map +0 -1
  542. package/dist/odspPublicUtils.js.map +0 -1
  543. package/dist/odspSnapshotParser.js.map +0 -1
  544. package/dist/odspSummaryUploadManager.js.map +0 -1
  545. package/dist/odspUrlHelper.js.map +0 -1
  546. package/dist/odspUtils.js.map +0 -1
  547. package/dist/opsCaching.js.map +0 -1
  548. package/dist/packageVersion.js.map +0 -1
  549. package/dist/prefetchLatestSnapshot.js +0 -57
  550. package/dist/prefetchLatestSnapshot.js.map +0 -1
  551. package/dist/retryErrorsStorageAdapter.js.map +0 -1
  552. package/dist/retryUtils.js.map +0 -1
  553. package/dist/vroom.js.map +0 -1
  554. package/dist/zipItDataRepresentationUtils.js.map +0 -1
  555. package/lib/ReadBufferUtils.d.ts.map +0 -1
  556. package/lib/ReadBufferUtils.js.map +0 -1
  557. package/lib/WriteBufferUtils.d.ts.map +0 -1
  558. package/lib/WriteBufferUtils.js.map +0 -1
  559. package/lib/checkUrl.d.ts.map +0 -1
  560. package/lib/checkUrl.js.map +0 -1
  561. package/lib/compactSnapshotParser.d.ts +0 -15
  562. package/lib/compactSnapshotParser.d.ts.map +0 -1
  563. package/lib/compactSnapshotParser.js +0 -111
  564. package/lib/compactSnapshotParser.js.map +0 -1
  565. package/lib/compactSnapshotWriter.d.ts.map +0 -1
  566. package/lib/compactSnapshotWriter.js.map +0 -1
  567. package/lib/constants.d.ts.map +0 -1
  568. package/lib/constants.js.map +0 -1
  569. package/lib/contracts.d.ts.map +0 -1
  570. package/lib/contracts.js.map +0 -1
  571. package/lib/contractsPublic.d.ts.map +0 -1
  572. package/lib/contractsPublic.js.map +0 -1
  573. package/lib/createFile.d.ts +0 -22
  574. package/lib/createFile.d.ts.map +0 -1
  575. package/lib/createFile.js +0 -235
  576. package/lib/createFile.js.map +0 -1
  577. package/lib/createNewUtils.d.ts +0 -11
  578. package/lib/createNewUtils.d.ts.map +0 -1
  579. package/lib/createNewUtils.js +0 -63
  580. package/lib/createNewUtils.js.map +0 -1
  581. package/lib/createOdspCreateContainerRequest.d.ts.map +0 -1
  582. package/lib/createOdspCreateContainerRequest.js.map +0 -1
  583. package/lib/createOdspUrl.d.ts.map +0 -1
  584. package/lib/createOdspUrl.js.map +0 -1
  585. package/lib/epochTracker.d.ts.map +0 -1
  586. package/lib/epochTracker.js.map +0 -1
  587. package/lib/fetch.d.ts.map +0 -1
  588. package/lib/fetch.js.map +0 -1
  589. package/lib/fetchSnapshot.d.ts.map +0 -1
  590. package/lib/fetchSnapshot.js.map +0 -1
  591. package/lib/getFileLink.d.ts.map +0 -1
  592. package/lib/getFileLink.js.map +0 -1
  593. package/lib/getQueryString.d.ts.map +0 -1
  594. package/lib/getQueryString.js.map +0 -1
  595. package/lib/getSocketIo.d.ts +0 -11
  596. package/lib/getSocketIo.d.ts.map +0 -1
  597. package/lib/getSocketIo.js +0 -13
  598. package/lib/getSocketIo.js.map +0 -1
  599. package/lib/getUrlAndHeadersWithAuth.d.ts.map +0 -1
  600. package/lib/getUrlAndHeadersWithAuth.js.map +0 -1
  601. package/lib/index.d.ts +0 -21
  602. package/lib/index.d.ts.map +0 -1
  603. package/lib/index.js +0 -29
  604. package/lib/index.js.map +0 -1
  605. package/lib/localOdspDriver/localOdspDocumentService.d.ts.map +0 -1
  606. package/lib/localOdspDriver/localOdspDocumentService.js.map +0 -1
  607. package/lib/localOdspDriver/localOdspDocumentServiceFactory.d.ts.map +0 -1
  608. package/lib/localOdspDriver/localOdspDocumentServiceFactory.js.map +0 -1
  609. package/lib/localOdspDriver/localOdspDocumentStorageManager.d.ts.map +0 -1
  610. package/lib/localOdspDriver/localOdspDocumentStorageManager.js.map +0 -1
  611. package/lib/odspCache.d.ts.map +0 -1
  612. package/lib/odspCache.js.map +0 -1
  613. package/lib/odspDeltaStorageService.d.ts.map +0 -1
  614. package/lib/odspDeltaStorageService.js.map +0 -1
  615. package/lib/odspDocumentDeltaConnection.d.ts.map +0 -1
  616. package/lib/odspDocumentDeltaConnection.js.map +0 -1
  617. package/lib/odspDocumentService.d.ts.map +0 -1
  618. package/lib/odspDocumentService.js +0 -360
  619. package/lib/odspDocumentService.js.map +0 -1
  620. package/lib/odspDocumentServiceFactory.d.ts.map +0 -1
  621. package/lib/odspDocumentServiceFactory.js.map +0 -1
  622. package/lib/odspDocumentServiceFactoryCore.d.ts.map +0 -1
  623. package/lib/odspDocumentServiceFactoryCore.js +0 -114
  624. package/lib/odspDocumentServiceFactoryCore.js.map +0 -1
  625. package/lib/odspDocumentServiceFactoryWithCodeSplit.d.ts.map +0 -1
  626. package/lib/odspDocumentServiceFactoryWithCodeSplit.js.map +0 -1
  627. package/lib/odspDocumentStorageManager.d.ts.map +0 -1
  628. package/lib/odspDocumentStorageManager.js +0 -352
  629. package/lib/odspDocumentStorageManager.js.map +0 -1
  630. package/lib/odspDocumentStorageServiceBase.d.ts.map +0 -1
  631. package/lib/odspDocumentStorageServiceBase.js.map +0 -1
  632. package/lib/odspDriverUrlResolver.d.ts.map +0 -1
  633. package/lib/odspDriverUrlResolver.js.map +0 -1
  634. package/lib/odspDriverUrlResolverForShareLink.d.ts.map +0 -1
  635. package/lib/odspDriverUrlResolverForShareLink.js.map +0 -1
  636. package/lib/odspError.d.ts.map +0 -1
  637. package/lib/odspError.js.map +0 -1
  638. package/lib/odspFluidFileLink.d.ts.map +0 -1
  639. package/lib/odspFluidFileLink.js.map +0 -1
  640. package/lib/odspPublicUtils.d.ts.map +0 -1
  641. package/lib/odspPublicUtils.js.map +0 -1
  642. package/lib/odspSnapshotParser.d.ts.map +0 -1
  643. package/lib/odspSnapshotParser.js.map +0 -1
  644. package/lib/odspSummaryUploadManager.d.ts.map +0 -1
  645. package/lib/odspSummaryUploadManager.js.map +0 -1
  646. package/lib/odspUrlHelper.d.ts.map +0 -1
  647. package/lib/odspUrlHelper.js.map +0 -1
  648. package/lib/odspUtils.d.ts.map +0 -1
  649. package/lib/odspUtils.js.map +0 -1
  650. package/lib/opsCaching.d.ts.map +0 -1
  651. package/lib/opsCaching.js.map +0 -1
  652. package/lib/packageVersion.d.ts.map +0 -1
  653. package/lib/packageVersion.js.map +0 -1
  654. package/lib/prefetchLatestSnapshot.d.ts.map +0 -1
  655. package/lib/prefetchLatestSnapshot.js +0 -53
  656. package/lib/prefetchLatestSnapshot.js.map +0 -1
  657. package/lib/retryErrorsStorageAdapter.d.ts.map +0 -1
  658. package/lib/retryErrorsStorageAdapter.js.map +0 -1
  659. package/lib/retryUtils.d.ts.map +0 -1
  660. package/lib/retryUtils.js.map +0 -1
  661. package/lib/vroom.d.ts.map +0 -1
  662. package/lib/vroom.js.map +0 -1
  663. package/lib/zipItDataRepresentationUtils.d.ts.map +0 -1
  664. package/lib/zipItDataRepresentationUtils.js.map +0 -1
  665. package/src/getSocketIo.ts +0 -14
  666. package/tsconfig.esnext.json +0 -7
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetchSnapshot.cjs","sourceRoot":"","sources":["../src/fetchSnapshot.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+BAAkC;AAClC,qEAKyC;AACzC,+DAAgE;AAChE,2DAAoD;AACpD,6DAAyD;AACzD,2EAAqE;AACrE,qFAKiD;AAEjD,+DAIsC;AACtC,yEAAkG;AAClG,+CAKqB;AACrB,yDAAkD;AAClD,6EAAsE;AACtE,+CAQqB;AAErB,iEAAiF;AACjF,uEAIiC;AAEjC,yDAA8C;AAE9C;;;GAGG;AACH,IAAY,yBAIX;AAJD,WAAY,yBAAyB;IACpC,yEAAQ,CAAA;IACR,6EAAU,CAAA;IACV,2FAAiB,CAAA;AAClB,CAAC,EAJW,yBAAyB,yCAAzB,yBAAyB,QAIpC;AAED;;;;;;;;;GASG;AACI,KAAK,UAAU,aAAa,CAClC,WAAmB;AACnB,kDAAkD;AAClD,KAAoB,EACpB,SAAiB,EACjB,iBAA0B,EAC1B,sCAA+C,EAC/C,MAA2B,EAC3B,kBAGoC;IAEpC,MAAM,IAAI,GAAG,UAAU,SAAS,EAAE,CAAC;IACnC,IAAI,WAAW,GAAqB,EAAE,CAAC;IAEvC,IAAI,iBAAiB,EAAE;QACtB,WAAW,GAAG,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;KAC9E;IAED,MAAM,WAAW,GAAG,IAAA,+BAAc,EAAC,WAAW,CAAC,CAAC;IAChD,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,IAAA,mDAAwB,EAChD,GAAG,WAAW,GAAG,IAAI,GAAG,WAAW,EAAE,EACrC,KAAK,EACL,sCAAsC,CACtC,CAAC;IACF,MAAM,Q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KAAK,CAAC;AACd,CAAC;AAED,SAAS,kBAAkB,CAAC,GAAW;IACtC;;;OAGG;IACH,IAAI,UAAU,GAAG,IAAA,+BAAgB,EAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;IAClD,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACpF,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IACrC,OAAO,UAAU,CAAC;AACnB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { v4 as uuid } from \"uuid\";\nimport {\n\tITelemetryLoggerExt,\n\tisFluidError,\n\tPerformanceEvent,\n\twrapError,\n} from \"@fluidframework/telemetry-utils\";\nimport { fromUtf8ToBase64 } from \"@fluid-internal/client-utils\";\nimport { assert } from \"@fluidframework/core-utils\";\nimport { getW3CData } from \"@fluidframework/driver-base\";\nimport { DriverErrorType } from \"@fluidframework/driver-definitions\";\nimport {\n\tIOdspResolvedUrl,\n\tISnapshotOptions,\n\tOdspErrorType,\n\tInstrumentedStorageTokenFetcher,\n} from \"@fluidframework/odsp-driver-definitions\";\nimport { ISnapshotTree } from \"@fluidframework/protocol-definitions\";\nimport {\n\tDriverErrorTelemetryProps,\n\tisRuntimeMessage,\n\tNonRetryableError,\n} from \"@fluidframework/driver-utils\";\nimport { fetchIncorrectResponse, throwOdspNetworkError } from \"@fluidframework/odsp-doclib-utils\";\nimport {\n\tIOdspSnapshot,\n\tISnapshotCachedEntry,\n\tIVersionedValueWithEpoch,\n\tpersistedCacheValueVersion,\n} from \"./contracts\";\nimport { getQueryString } from \"./getQueryString\";\nimport { getUrlAndHeadersWithAuth } from \"./getUrlAndHeadersWithAuth\";\nimport {\n\tfetchAndParseAsJSONHelper,\n\tfetchHelper,\n\tgetWithRetryForTokenRefresh,\n\tgetWithRetryForTokenRefreshRepeat,\n\tIOdspResponse,\n\tmeasure,\n\tmeasureP,\n} from \"./odspUtils\";\nimport { ISnapshotContents } from \"./odspPublicUtils\";\nimport { convertOdspSnapshotToSnapshotTreeAndBlobs } from \"./odspSnapshotParser\";\nimport {\n\tcurrentReadVersion,\n\tISnapshotContentsWithProps,\n\tparseCompactSnapshotResponse,\n} from \"./compactSnapshotParser\";\nimport { EpochTracker } from \"./epochTracker\";\nimport { pkgVersion } from \"./packageVersion\";\n\n/**\n * Enum to support different types of snapshot formats.\n * @alpha\n */\nexport enum SnapshotFormatSupportType {\n\tJson = 0,\n\tBinary = 1,\n\tJsonAndBinary = 2,\n}\n\n/**\n * Fetches a snapshot from the server with a given version id.\n * @param snapshotUrl - snapshot url from where the odsp snapshot will be fetched\n * @param token - token used for authorization in the request\n * @param storageFetchWrapper - Implementation of the get/post methods used to fetch the snapshot\n * @param versionId - id of specific snapshot to be fetched\n * @param fetchFullSnapshot - whether we want to fetch full snapshot(with blobs)\n * @param forceAccessTokenViaAuthorizationHeader - whether to force passing given token via authorization header\n * @returns A promise of the snapshot and the status code of the response\n */\nexport async function fetchSnapshot(\n\tsnapshotUrl: string,\n\t// eslint-disable-next-line @rushstack/no-new-null\n\ttoken: string | null,\n\tversionId: string,\n\tfetchFullSnapshot: boolean,\n\tforceAccessTokenViaAuthorizationHeader: boolean,\n\tlogger: ITelemetryLoggerExt,\n\tsnapshotDownloader: (\n\t\turl: string,\n\t\tfetchOptions: { [index: string]: any },\n\t) => Promise<IOdspResponse<unknown>>,\n): Promise<ISnapshotContents> {\n\tconst path = `/trees/${versionId}`;\n\tlet queryParams: ISnapshotOptions = {};\n\n\tif (fetchFullSnapshot) {\n\t\tqueryParams = versionId !== \"latest\" ? { blobs: 2 } : { deltas: 1, blobs: 2 };\n\t}\n\n\tconst queryString = getQueryString(queryParams);\n\tconst { url, headers } = getUrlAndHeadersWithAuth(\n\t\t`${snapshotUrl}${path}${queryString}`,\n\t\ttoken,\n\t\tforceAccessTokenViaAuthorizationHeader,\n\t);\n\tconst response = (await PerformanceEvent.timedExecAsync(\n\t\tlogger,\n\t\t{\n\t\t\teventName: \"fetchSnapshot\",\n\t\t\theaders: Object.keys(headers).length !== 0 ? true : undefined,\n\t\t},\n\t\tasync () => snapshotDownloader(url, { headers }),\n\t)) as IOdspResponse<IOdspSnapshot>;\n\treturn convertOdspSnapshotToSnapshotTreeAndBlobs(response.content);\n}\n\nexport async function fetchSnapshotWithRedeem(\n\todspResolvedUrl: IOdspResolvedUrl,\n\tstorageTokenFetcher: InstrumentedStorageTokenFetcher,\n\tsnapshotOptions: ISnapshotOptions | undefined,\n\tforceAccessTokenViaAuthorizationHeader: boolean,\n\tlogger: ITelemetryLoggerExt,\n\tsnapshotDownloader: (\n\t\tfinalOdspResolvedUrl: IOdspResolvedUrl,\n\t\tstorageToken: string,\n\t\tsnapshotOptions: ISnapshotOptions | undefined,\n\t\tcontroller?: AbortController,\n\t) => Promise<ISnapshotRequestAndResponseOptions>,\n\tputInCache: (valueWithEpoch: IVersionedValueWithEpoch) => Promise<void>,\n\tremoveEntries: () => Promise<void>,\n\tenableRedeemFallback?: boolean,\n): Promise<ISnapshotContents> {\n\t// back-compat: This block to be removed with #8784 when we only consume/consider odsp resolvers that are >= 0.51\n\tconst sharingLinkToRedeem = (odspResolvedUrl as any).sharingLinkToRedeem;\n\tif (sharingLinkToRedeem) {\n\t\todspResolvedUrl.shareLinkInfo = { ...odspResolvedUrl.shareLinkInfo, sharingLinkToRedeem };\n\t}\n\n\treturn fetchLatestSnapshotCore(\n\t\todspResolvedUrl,\n\t\tstorageTokenFetcher,\n\t\tsnapshotOptions,\n\t\tlogger,\n\t\tsnapshotDownloader,\n\t\tputInCache,\n\t\tenableRedeemFallback,\n\t)\n\t\t.catch(async (error) => {\n\t\t\tif (enableRedeemFallback && isRedeemSharingLinkError(odspResolvedUrl, error)) {\n\t\t\t\t// Execute the redeem fallback\n\n\t\t\t\tawait redeemSharingLink(\n\t\t\t\t\todspResolvedUrl,\n\t\t\t\t\tstorageTokenFetcher,\n\t\t\t\t\tlogger,\n\t\t\t\t\tforceAccessTokenViaAuthorizationHeader,\n\t\t\t\t);\n\t\t\t\tconst odspResolvedUrlWithoutShareLink: IOdspResolvedUrl = {\n\t\t\t\t\t...odspResolvedUrl,\n\t\t\t\t\tshareLinkInfo: {\n\t\t\t\t\t\t...odspResolvedUrl.shareLinkInfo,\n\t\t\t\t\t\tsharingLinkToRedeem: undefined,\n\t\t\t\t\t},\n\t\t\t\t};\n\n\t\t\t\t// Log initial failure only if redeem succeeded - it points out to some bug somewhere\n\t\t\t\t// If redeem failed, that most likely means user has no permissions to access a file,\n\t\t\t\t// and thus it's not worth it logging extra errors - same error will be logged by end-to-end\n\t\t\t\t// flow (container open) based on a failure above.\n\t\t\t\tlogger.sendTelemetryEvent(\n\t\t\t\t\t{\n\t\t\t\t\t\teventName: \"RedeemFallback\",\n\t\t\t\t\t\terrorType: error.errorType,\n\t\t\t\t\t},\n\t\t\t\t\terror,\n\t\t\t\t);\n\n\t\t\t\treturn fetchLatestSnapshotCore(\n\t\t\t\t\todspResolvedUrlWithoutShareLink,\n\t\t\t\t\tstorageTokenFetcher,\n\t\t\t\t\tsnapshotOptions,\n\t\t\t\t\tlogger,\n\t\t\t\t\tsnapshotDownloader,\n\t\t\t\t\tputInCache,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t})\n\t\t.catch(async (error) => {\n\t\t\t// Clear the cache on 401/403/404 on snapshot fetch from network because this means either the user doesn't\n\t\t\t// have permissions for the file or it was deleted. So, if we do not clear cache, we will continue fetching\n\t\t\t// snapshot from cache in the future.\n\t\t\tif (\n\t\t\t\t(typeof error === \"object\" &&\n\t\t\t\t\terror !== null &&\n\t\t\t\t\terror.errorType === DriverErrorType.authorizationError) ||\n\t\t\t\terror.errorType === DriverErrorType.fileNotFoundOrAccessDeniedError\n\t\t\t) {\n\t\t\t\tawait removeEntries();\n\t\t\t}\n\t\t\tthrow error;\n\t\t});\n}\n\nasync function redeemSharingLink(\n\todspResolvedUrl: IOdspResolvedUrl,\n\tstorageTokenFetcher: InstrumentedStorageTokenFetcher,\n\tlogger: ITelemetryLoggerExt,\n\tforceAccessTokenViaAuthorizationHeader: boolean,\n) {\n\treturn PerformanceEvent.timedExecAsync(\n\t\tlogger,\n\t\t{\n\t\t\teventName: \"RedeemShareLink\",\n\t\t},\n\t\tasync () =>\n\t\t\tgetWithRetryForTokenRefresh(async (tokenFetchOptions) => {\n\t\t\t\tassert(\n\t\t\t\t\t!!odspResolvedUrl.shareLinkInfo?.sharingLinkToRedeem,\n\t\t\t\t\t0x1ed /* \"Share link should be present\" */,\n\t\t\t\t);\n\t\t\t\tconst storageToken = await storageTokenFetcher(\n\t\t\t\t\ttokenFetchOptions,\n\t\t\t\t\t\"RedeemShareLink\",\n\t\t\t\t);\n\t\t\t\tconst encodedShareUrl = getEncodedShareUrl(\n\t\t\t\t\todspResolvedUrl.shareLinkInfo?.sharingLinkToRedeem,\n\t\t\t\t);\n\t\t\t\tconst redeemUrl = `${odspResolvedUrl.siteUrl}/_api/v2.0/shares/${encodedShareUrl}`;\n\t\t\t\tconst { url, headers } = getUrlAndHeadersWithAuth(\n\t\t\t\t\tredeemUrl,\n\t\t\t\t\tstorageToken,\n\t\t\t\t\tforceAccessTokenViaAuthorizationHeader,\n\t\t\t\t);\n\t\t\t\theaders.prefer = \"redeemSharingLink\";\n\t\t\t\treturn fetchAndParseAsJSONHelper(url, { headers });\n\t\t\t}),\n\t);\n}\n\nasync function fetchLatestSnapshotCore(\n\todspResolvedUrl: IOdspResolvedUrl,\n\tstorageTokenFetcher: InstrumentedStorageTokenFetcher,\n\tsnapshotOptions: ISnapshotOptions | undefined,\n\tlogger: ITelemetryLoggerExt,\n\tsnapshotDownloader: (\n\t\tfinalOdspResolvedUrl: IOdspResolvedUrl,\n\t\tstorageToken: string,\n\t\tsnapshotOptions: ISnapshotOptions | undefined,\n\t\tcontroller?: AbortController,\n\t) => Promise<ISnapshotRequestAndResponseOptions>,\n\tputInCache: (valueWithEpoch: IVersionedValueWithEpoch) => Promise<void>,\n\tenableRedeemFallback?: boolean,\n): Promise<ISnapshotContents> {\n\treturn getWithRetryForTokenRefresh(async (tokenFetchOptions) => {\n\t\tconst storageToken = await storageTokenFetcher(tokenFetchOptions, \"TreesLatest\", true);\n\t\tassert(storageToken !== null, 0x1e5 /* \"Storage token should not be null\" */);\n\n\t\tconst perfEvent = {\n\t\t\teventName: \"TreesLatest\",\n\t\t\tattempts: tokenFetchOptions.refresh ? 2 : 1,\n\t\t\tshareLinkPresent: odspResolvedUrl.shareLinkInfo?.sharingLinkToRedeem !== undefined,\n\t\t\tisSummarizer: odspResolvedUrl.summarizer,\n\t\t\tredeemFallbackEnabled: enableRedeemFallback,\n\t\t};\n\t\tif (snapshotOptions !== undefined) {\n\t\t\tObject.entries(snapshotOptions).forEach(([key, value]) => {\n\t\t\t\tif (value !== undefined) {\n\t\t\t\t\tperfEvent[`snapshotOption_${key}`] = value;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\t// This event measures only successful cases of getLatest call (no tokens, no retries).\n\t\treturn PerformanceEvent.timedExecAsync(logger, perfEvent, async (event) => {\n\t\t\tlet controller: AbortController | undefined;\n\t\t\tlet fetchTimeout: ReturnType<typeof setTimeout> | undefined;\n\t\t\tif (snapshotOptions?.timeout !== undefined) {\n\t\t\t\tcontroller = new AbortController();\n\t\t\t\tfetchTimeout = setTimeout(() => controller!.abort(), snapshotOptions.timeout);\n\t\t\t}\n\n\t\t\tconst [response, fetchTime] = await measureP(async () =>\n\t\t\t\tsnapshotDownloader(odspResolvedUrl, storageToken, snapshotOptions, controller),\n\t\t\t).finally(() => {\n\t\t\t\t// Clear the fetchTimeout once the response is fetched.\n\t\t\t\tif (fetchTimeout !== undefined) {\n\t\t\t\t\tclearTimeout(fetchTimeout);\n\t\t\t\t\tfetchTimeout = undefined;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tconst odspResponse = response.odspResponse;\n\t\t\tconst contentType = odspResponse.headers.get(\"content-type\");\n\n\t\t\tconst propsToLog: DriverErrorTelemetryProps = {\n\t\t\t\t...odspResponse.propsToLog,\n\t\t\t\tcontentType,\n\t\t\t\taccept: response.requestHeaders.accept,\n\t\t\t\tdriverVersion: pkgVersion,\n\t\t\t};\n\n\t\t\tlet parsedSnapshotContents: IOdspResponse<ISnapshotContentsWithProps> | undefined;\n\t\t\tlet contentTypeToRead: string | undefined;\n\t\t\tif (contentType?.includes(\"application/ms-fluid\")) {\n\t\t\t\tcontentTypeToRead = \"application/ms-fluid\";\n\t\t\t} else if (contentType?.includes(\"application/json\")) {\n\t\t\t\tcontentTypeToRead = \"application/json\";\n\t\t\t}\n\n\t\t\tlet parseTime: number;\n\t\t\tlet receiveContentTime: number;\n\t\t\ttry {\n\t\t\t\tswitch (contentTypeToRead) {\n\t\t\t\t\tcase \"application/json\": {\n\t\t\t\t\t\tlet text: string;\n\t\t\t\t\t\t[text, receiveContentTime] = await measureP(async () =>\n\t\t\t\t\t\t\todspResponse.content.text().catch((err) =>\n\t\t\t\t\t\t\t\t// Parsing can fail and message could contain full request URI, including\n\t\t\t\t\t\t\t\t// tokens, etc. So do not log error object itself.\n\t\t\t\t\t\t\t\tthrowOdspNetworkError(\n\t\t\t\t\t\t\t\t\t\"Error while parsing fetch response\",\n\t\t\t\t\t\t\t\t\tfetchIncorrectResponse,\n\t\t\t\t\t\t\t\t\todspResponse.content, // response\n\t\t\t\t\t\t\t\t\tundefined, // response text\n\t\t\t\t\t\t\t\t\tpropsToLog,\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t);\n\t\t\t\t\t\tpropsToLog.bodySize = text.length;\n\t\t\t\t\t\tlet content: IOdspSnapshot;\n\t\t\t\t\t\t[content, parseTime] = measure(() => JSON.parse(text) as IOdspSnapshot);\n\t\t\t\t\t\tvalidateBlobsAndTrees(content);\n\t\t\t\t\t\tconst snapshotContents: ISnapshotContents =\n\t\t\t\t\t\t\tconvertOdspSnapshotToSnapshotTreeAndBlobs(content);\n\t\t\t\t\t\tparsedSnapshotContents = {\n\t\t\t\t\t\t\t...odspResponse,\n\t\t\t\t\t\t\tcontent: {\n\t\t\t\t\t\t\t\t...snapshotContents,\n\t\t\t\t\t\t\t\ttelemetryProps: {},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t};\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase \"application/ms-fluid\": {\n\t\t\t\t\t\tlet content: ArrayBuffer;\n\t\t\t\t\t\t[content, receiveContentTime] = await measureP(async () =>\n\t\t\t\t\t\t\todspResponse.content.arrayBuffer().catch((err) =>\n\t\t\t\t\t\t\t\t// Parsing can fail and message could contain full request URI, including\n\t\t\t\t\t\t\t\t// tokens, etc. So do not log error object itself.\n\t\t\t\t\t\t\t\tthrowOdspNetworkError(\n\t\t\t\t\t\t\t\t\t\"Error while parsing fetch response\",\n\t\t\t\t\t\t\t\t\tfetchIncorrectResponse,\n\t\t\t\t\t\t\t\t\todspResponse.content, // response\n\t\t\t\t\t\t\t\t\tundefined, // response text\n\t\t\t\t\t\t\t\t\tpropsToLog,\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t);\n\t\t\t\t\t\tpropsToLog.bodySize = content.byteLength;\n\t\t\t\t\t\tlet snapshotContents: ISnapshotContentsWithProps;\n\t\t\t\t\t\t[snapshotContents, parseTime] = measure(() =>\n\t\t\t\t\t\t\tparseCompactSnapshotResponse(new Uint8Array(content), logger),\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tsnapshotContents.snapshotTree.trees === undefined ||\n\t\t\t\t\t\t\tsnapshotContents.snapshotTree.blobs === undefined\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tthrow new NonRetryableError(\n\t\t\t\t\t\t\t\t\"Returned odsp snapshot is malformed. No trees or blobs!\",\n\t\t\t\t\t\t\t\tDriverErrorType.incorrectServerResponse,\n\t\t\t\t\t\t\t\tpropsToLog,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst props = snapshotContents.telemetryProps;\n\t\t\t\t\t\tconst slowTreeParseCodePaths = props.slowTreeStructureCount ?? 0;\n\t\t\t\t\t\tconst slowBlobParseCodePaths = props.slowBlobStructureCount ?? 0;\n\t\t\t\t\t\tif (slowTreeParseCodePaths > 10 || slowBlobParseCodePaths > 10) {\n\t\t\t\t\t\t\tlogger.sendErrorEvent({\n\t\t\t\t\t\t\t\teventName: \"SlowSnapshotParseCodePaths\",\n\t\t\t\t\t\t\t\tslowTreeStructureCount: slowTreeParseCodePaths,\n\t\t\t\t\t\t\t\tslowBlobStructureCount: slowBlobParseCodePaths,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\tparsedSnapshotContents = { ...odspResponse, content: snapshotContents };\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tthrow new NonRetryableError(\n\t\t\t\t\t\t\t\"Unknown snapshot content type\",\n\t\t\t\t\t\t\tDriverErrorType.incorrectServerResponse,\n\t\t\t\t\t\t\tpropsToLog,\n\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tif (isFluidError(error)) {\n\t\t\t\t\terror.addTelemetryProperties(propsToLog);\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t\tconst enhancedError = wrapError(\n\t\t\t\t\terror,\n\t\t\t\t\t(errorMessage) =>\n\t\t\t\t\t\tnew NonRetryableError(\n\t\t\t\t\t\t\t`Error parsing snapshot response: ${errorMessage}`,\n\t\t\t\t\t\t\tDriverErrorType.genericError,\n\t\t\t\t\t\t\tpropsToLog,\n\t\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\tthrow enhancedError;\n\t\t\t}\n\n\t\t\tassert(parsedSnapshotContents !== undefined, 0x312 /* snapshot should be parsed */);\n\t\t\tconst snapshot = parsedSnapshotContents.content;\n\t\t\tconst { trees, numBlobs, encodedBlobsSize } = evalBlobsAndTrees(snapshot);\n\n\t\t\t// There are some scenarios in ODSP where we cannot cache, trees/latest will explicitly tell us when we\n\t\t\t// cannot cache using an HTTP response header.\n\t\t\tconst canCache =\n\t\t\t\todspResponse.headers.get(\"disablebrowsercachingofusercontent\") !== \"true\";\n\t\t\tconst sequenceNumber: number = snapshot.sequenceNumber ?? 0;\n\t\t\tconst seqNumberFromOps =\n\t\t\t\tsnapshot.ops && snapshot.ops.length > 0\n\t\t\t\t\t? snapshot.ops[0].sequenceNumber - 1\n\t\t\t\t\t: undefined;\n\n\t\t\tif (\n\t\t\t\t!Number.isInteger(sequenceNumber) ||\n\t\t\t\t(seqNumberFromOps !== undefined && seqNumberFromOps !== sequenceNumber)\n\t\t\t) {\n\t\t\t\tlogger.sendErrorEvent({\n\t\t\t\t\teventName: \"fetchSnapshotError\",\n\t\t\t\t\tsequenceNumber,\n\t\t\t\t\tseqNumberFromOps,\n\t\t\t\t});\n\t\t\t\tsnapshot.sequenceNumber = undefined;\n\t\t\t} else if (canCache) {\n\t\t\t\tconst fluidEpoch = odspResponse.headers.get(\"x-fluid-epoch\");\n\t\t\t\tassert(\n\t\t\t\t\tfluidEpoch !== undefined,\n\t\t\t\t\t0x1e6 /* \"Epoch should be present in response\" */,\n\t\t\t\t);\n\t\t\t\tconst value: ISnapshotCachedEntry = {\n\t\t\t\t\t...snapshot,\n\t\t\t\t\tcacheEntryTime: Date.now(),\n\t\t\t\t};\n\t\t\t\tconst valueWithEpoch: IVersionedValueWithEpoch = {\n\t\t\t\t\tvalue,\n\t\t\t\t\tfluidEpoch,\n\t\t\t\t\tversion: persistedCacheValueVersion,\n\t\t\t\t};\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-floating-promises\n\t\t\t\tputInCache(valueWithEpoch);\n\t\t\t}\n\n\t\t\tevent.end({\n\t\t\t\ttrees,\n\t\t\t\tblobs: snapshot.blobs?.size ?? 0,\n\t\t\t\tleafNodes: numBlobs,\n\t\t\t\tencodedBlobsSize,\n\t\t\t\tsequenceNumber,\n\t\t\t\tops: snapshot.ops?.length ?? 0,\n\t\t\t\tuserOps: snapshot.ops?.filter((op) => isRuntimeMessage(op)).length ?? 0,\n\t\t\t\theaders: Object.keys(response.requestHeaders).length !== 0 ? true : undefined,\n\t\t\t\t// Measures time to make fetch call. Should be similar to\n\t\t\t\t// fetchStartToResponseEndTime - receiveContentTime, i.e. it looks like it's time till first byte /\n\t\t\t\t// end of response headers\n\t\t\t\tfetchTime,\n\t\t\t\t// time it takes client to parse payload. Same payload as in \"SnapshotParse\" event, here for\n\t\t\t\t// easier analyzes.\n\t\t\t\tparseTime,\n\t\t\t\t// Time it takes to receive content (text of buffer) from Response object.\n\t\t\t\t// This time likely is very closely correlated with networkTime, i.e. time it takes to receive\n\t\t\t\t// actual content (starting measuring from first bite / end of response header)\n\t\t\t\treceiveContentTime,\n\t\t\t\t...getW3CData(response.requestUrl, \"fetch\"),\n\t\t\t\t// Sharing link telemetry regarding sharing link redeem status and performance. Ex: FRL; dur=100,\n\t\t\t\t// Azure Fluid Relay service; desc=S, FRP; desc=False. Here, FRL is the duration taken for redeem,\n\t\t\t\t// Azure Fluid Relay service is the redeem status (S means success), and FRP is a flag to indicate\n\t\t\t\t// if the permission has changed.\n\t\t\t\tsltelemetry: odspResponse.headers.get(\"x-fluid-sltelemetry\"),\n\t\t\t\t// All other props\n\t\t\t\t...propsToLog,\n\t\t\t\t// Various perf counters and measures collected by binary parsing code:\n\t\t\t\t// slowTreeStructureCount, slowBlobStructureCount, durationStructure, durationStrings,\n\t\t\t\t// durationSnapshotTree, durationBlobs, etc.\n\t\t\t\t...parsedSnapshotContents.content.telemetryProps,\n\t\t\t});\n\t\t\treturn snapshot;\n\t\t}).catch((error) => {\n\t\t\t// We hit these errors in stress tests, under load\n\t\t\t// It's useful to try one more time in such case.\n\t\t\tif (\n\t\t\t\ttypeof error === \"object\" &&\n\t\t\t\terror !== null &&\n\t\t\t\t(error.errorType === DriverErrorType.fetchFailure ||\n\t\t\t\t\terror.errorType === OdspErrorType.fetchTimeout)\n\t\t\t) {\n\t\t\t\terror[getWithRetryForTokenRefreshRepeat] = true;\n\t\t\t}\n\t\t\tthrow error;\n\t\t});\n\t});\n}\n\nexport interface ISnapshotRequestAndResponseOptions {\n\todspResponse: IOdspResponse<Response>;\n\trequestUrl: string;\n\trequestHeaders: { [index: string]: any };\n}\n\nfunction getFormBodyAndHeaders(\n\todspResolvedUrl: IOdspResolvedUrl,\n\tstorageToken: string,\n\theaders?: { [index: string]: string },\n) {\n\tconst formBoundary = uuid();\n\tconst formParams: string[] = [];\n\tformParams.push(`--${formBoundary}`);\n\tformParams.push(`Authorization: Bearer ${storageToken}`);\n\tformParams.push(`X-HTTP-Method-Override: GET`);\n\n\tif (headers !== undefined) {\n\t\tObject.entries(headers).forEach(([key, value]) => {\n\t\t\tif (value !== undefined) {\n\t\t\t\tformParams.push(`${key}: ${value}`);\n\t\t\t}\n\t\t});\n\t}\n\tif (odspResolvedUrl.shareLinkInfo?.sharingLinkToRedeem) {\n\t\tformParams.push(`sl: ${odspResolvedUrl.shareLinkInfo?.sharingLinkToRedeem}`);\n\t}\n\tformParams.push(`_post: 1`);\n\tformParams.push(`\\r\\n--${formBoundary}--`);\n\tconst postBody = formParams.join(\"\\r\\n\");\n\tconst header: { [index: string]: any } = {\n\t\t\"Content-Type\": `multipart/form-data;boundary=${formBoundary}`,\n\t};\n\treturn { body: postBody, headers: header };\n}\n\nexport function evalBlobsAndTrees(snapshot: ISnapshotContents) {\n\tconst trees = countTreesInSnapshotTree(snapshot.snapshotTree);\n\tconst numBlobs = snapshot.blobs.size;\n\tlet encodedBlobsSize = 0;\n\tfor (const [_, blobContent] of snapshot.blobs) {\n\t\tencodedBlobsSize += blobContent.byteLength;\n\t}\n\treturn { trees, numBlobs, encodedBlobsSize };\n}\n\nexport function validateBlobsAndTrees(snapshot: IOdspSnapshot) {\n\tassert(\n\t\tsnapshot.trees !== undefined,\n\t\t0x200 /* \"Returned odsp snapshot is malformed. No trees!\" */,\n\t);\n\tassert(\n\t\tsnapshot.blobs !== undefined,\n\t\t0x201 /* \"Returned odsp snapshot is malformed. No blobs!\" */,\n\t);\n}\n\nfunction countTreesInSnapshotTree(snapshotTree: ISnapshotTree): number {\n\tlet numTrees = 0;\n\tfor (const [_, tree] of Object.entries(snapshotTree.trees)) {\n\t\tnumTrees += 1;\n\t\tnumTrees += countTreesInSnapshotTree(tree);\n\t}\n\treturn numTrees;\n}\n\n/**\n * This function fetches the snapshot and parse it according to what is mentioned in response headers.\n * @param odspResolvedUrl - resolved odsp url.\n * @param storageToken - token to do the auth for network request.\n * @param snapshotOptions - Options used to specify how and what to fetch in the snapshot.\n * @param logger - logger\n * @param snapshotFormatFetchType - Snapshot format to fetch.\n * @param controller - abort controller if caller needs to abort the network call.\n * @param epochTracker - epoch tracker used to add/validate epoch in the network call.\n * @returns fetched snapshot.\n */\nexport async function downloadSnapshot(\n\todspResolvedUrl: IOdspResolvedUrl,\n\tstorageToken: string,\n\tlogger: ITelemetryLoggerExt,\n\tsnapshotOptions: ISnapshotOptions | undefined,\n\tsnapshotFormatFetchType?: SnapshotFormatSupportType,\n\tcontroller?: AbortController,\n\tepochTracker?: EpochTracker,\n\tscenarioName?: string,\n): Promise<ISnapshotRequestAndResponseOptions> {\n\t// back-compat: This block to be removed with #8784 when we only consume/consider odsp resolvers that are >= 0.51\n\tconst sharingLinkToRedeem = (odspResolvedUrl as any).sharingLinkToRedeem;\n\tif (sharingLinkToRedeem) {\n\t\todspResolvedUrl.shareLinkInfo = { ...odspResolvedUrl.shareLinkInfo, sharingLinkToRedeem };\n\t}\n\n\tconst snapshotUrl = odspResolvedUrl.endpoints.snapshotStorageUrl;\n\n\tconst queryParams = { ump: 1 };\n\tif (snapshotOptions !== undefined) {\n\t\tObject.entries(snapshotOptions).forEach(([key, value]) => {\n\t\t\t// Exclude \"timeout\" from query string\n\t\t\tif (value !== undefined && key !== \"timeout\") {\n\t\t\t\tqueryParams[key] = value;\n\t\t\t}\n\t\t});\n\t}\n\n\tconst queryString = getQueryString(queryParams);\n\tconst url = `${snapshotUrl}/trees/latest${queryString}`;\n\t// The location of file can move on Spo in which case server returns 308(Permanent Redirect) error.\n\t// Adding below header will make VROOM API return 404 instead of 308 and browser can intercept it.\n\t// This error thrown by server will contain the new redirect location. Look at the 404 error parsing\n\t// for futher reference here: \\packages\\utils\\odsp-doclib-utils\\src\\odspErrorUtils.ts\n\tconst header = { prefer: \"manualredirect\" };\n\tconst { body, headers } = getFormBodyAndHeaders(odspResolvedUrl, storageToken, header);\n\tconst fetchOptions = {\n\t\tbody,\n\t\theaders,\n\t\tsignal: controller?.signal,\n\t\tmethod: \"POST\",\n\t};\n\t// Decide what snapshot format to fetch as per the feature gate.\n\tswitch (snapshotFormatFetchType) {\n\t\tcase SnapshotFormatSupportType.Binary:\n\t\t\theaders.accept = `application/ms-fluid; v=${currentReadVersion}`;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t// By default ask both versions and let the server decide the format.\n\t\t\theaders.accept = `application/json, application/ms-fluid; v=${currentReadVersion}`;\n\t}\n\n\tconst odspResponse = await (epochTracker?.fetch(\n\t\turl,\n\t\tfetchOptions,\n\t\t\"treesLatest\",\n\t\ttrue,\n\t\tscenarioName,\n\t) ?? fetchHelper(url, fetchOptions));\n\n\treturn {\n\t\todspResponse,\n\t\trequestHeaders: headers,\n\t\trequestUrl: url,\n\t};\n}\n\nfunction isRedeemSharingLinkError(odspResolvedUrl: IOdspResolvedUrl, error: any) {\n\tif (\n\t\todspResolvedUrl.shareLinkInfo?.sharingLinkToRedeem !== undefined &&\n\t\ttypeof error === \"object\" &&\n\t\terror !== null &&\n\t\t(error.errorType === DriverErrorType.authorizationError ||\n\t\t\terror.errorType === DriverErrorType.fileNotFoundOrAccessDeniedError)\n\t) {\n\t\treturn true;\n\t}\n\treturn false;\n}\n\nfunction getEncodedShareUrl(url: string): string {\n\t/**\n\t * Encode the url to accepted format by Sharepoint\n\t * https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/shares_get\n\t */\n\tlet encodedUrl = fromUtf8ToBase64(encodeURI(url));\n\tencodedUrl = encodedUrl.replace(/=+$/g, \"\").replace(/\\//g, \"_\").replace(/\\+/g, \"-\");\n\tencodedUrl = \"u!\".concat(encodedUrl);\n\treturn encodedUrl;\n}\n"]}
@@ -2,8 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { default as AbortController } from "abort-controller";
6
- import { ITelemetryLogger } from "@fluidframework/common-definitions";
5
+ import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
7
6
  import { IOdspResolvedUrl, ISnapshotOptions, InstrumentedStorageTokenFetcher } from "@fluidframework/odsp-driver-definitions";
8
7
  import { IOdspSnapshot, IVersionedValueWithEpoch } from "./contracts";
9
8
  import { IOdspResponse } from "./odspUtils";
@@ -11,6 +10,7 @@ import { ISnapshotContents } from "./odspPublicUtils";
11
10
  import { EpochTracker } from "./epochTracker";
12
11
  /**
13
12
  * Enum to support different types of snapshot formats.
13
+ * @alpha
14
14
  */
15
15
  export declare enum SnapshotFormatSupportType {
16
16
  Json = 0,
@@ -27,10 +27,10 @@ export declare enum SnapshotFormatSupportType {
27
27
  * @param forceAccessTokenViaAuthorizationHeader - whether to force passing given token via authorization header
28
28
  * @returns A promise of the snapshot and the status code of the response
29
29
  */
30
- export declare function fetchSnapshot(snapshotUrl: string, token: string | null, versionId: string, fetchFullSnapshot: boolean, forceAccessTokenViaAuthorizationHeader: boolean, logger: ITelemetryLogger, snapshotDownloader: (url: string, fetchOptions: {
30
+ export declare function fetchSnapshot(snapshotUrl: string, token: string | null, versionId: string, fetchFullSnapshot: boolean, forceAccessTokenViaAuthorizationHeader: boolean, logger: ITelemetryLoggerExt, snapshotDownloader: (url: string, fetchOptions: {
31
31
  [index: string]: any;
32
32
  }) => Promise<IOdspResponse<unknown>>): Promise<ISnapshotContents>;
33
- export declare function fetchSnapshotWithRedeem(odspResolvedUrl: IOdspResolvedUrl, storageTokenFetcher: InstrumentedStorageTokenFetcher, snapshotOptions: ISnapshotOptions | undefined, forceAccessTokenViaAuthorizationHeader: boolean, logger: ITelemetryLogger, snapshotDownloader: (finalOdspResolvedUrl: IOdspResolvedUrl, storageToken: string, snapshotOptions: ISnapshotOptions | undefined, controller?: AbortController) => Promise<ISnapshotRequestAndResponseOptions>, putInCache: (valueWithEpoch: IVersionedValueWithEpoch) => Promise<void>, removeEntries: () => Promise<void>, enableRedeemFallback?: boolean): Promise<ISnapshotContents>;
33
+ export declare function fetchSnapshotWithRedeem(odspResolvedUrl: IOdspResolvedUrl, storageTokenFetcher: InstrumentedStorageTokenFetcher, snapshotOptions: ISnapshotOptions | undefined, forceAccessTokenViaAuthorizationHeader: boolean, logger: ITelemetryLoggerExt, snapshotDownloader: (finalOdspResolvedUrl: IOdspResolvedUrl, storageToken: string, snapshotOptions: ISnapshotOptions | undefined, controller?: AbortController) => Promise<ISnapshotRequestAndResponseOptions>, putInCache: (valueWithEpoch: IVersionedValueWithEpoch) => Promise<void>, removeEntries: () => Promise<void>, enableRedeemFallback?: boolean): Promise<ISnapshotContents>;
34
34
  export interface ISnapshotRequestAndResponseOptions {
35
35
  odspResponse: IOdspResponse<Response>;
36
36
  requestUrl: string;
@@ -38,6 +38,11 @@ export interface ISnapshotRequestAndResponseOptions {
38
38
  [index: string]: any;
39
39
  };
40
40
  }
41
+ export declare function evalBlobsAndTrees(snapshot: ISnapshotContents): {
42
+ trees: number;
43
+ numBlobs: number;
44
+ encodedBlobsSize: number;
45
+ };
41
46
  export declare function validateBlobsAndTrees(snapshot: IOdspSnapshot): void;
42
47
  /**
43
48
  * This function fetches the snapshot and parse it according to what is mentioned in response headers.
@@ -50,5 +55,5 @@ export declare function validateBlobsAndTrees(snapshot: IOdspSnapshot): void;
50
55
  * @param epochTracker - epoch tracker used to add/validate epoch in the network call.
51
56
  * @returns fetched snapshot.
52
57
  */
53
- export declare function downloadSnapshot(odspResolvedUrl: IOdspResolvedUrl, storageToken: string, logger: ITelemetryLogger, snapshotOptions: ISnapshotOptions | undefined, snapshotFormatFetchType?: SnapshotFormatSupportType, controller?: AbortController, epochTracker?: EpochTracker, scenarioName?: string): Promise<ISnapshotRequestAndResponseOptions>;
58
+ export declare function downloadSnapshot(odspResolvedUrl: IOdspResolvedUrl, storageToken: string, logger: ITelemetryLoggerExt, snapshotOptions: ISnapshotOptions | undefined, snapshotFormatFetchType?: SnapshotFormatSupportType, controller?: AbortController, epochTracker?: EpochTracker, scenarioName?: string): Promise<ISnapshotRequestAndResponseOptions>;
54
59
  //# sourceMappingURL=fetchSnapshot.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fetchSnapshot.d.ts","sourceRoot":"","sources":["../src/fetchSnapshot.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAE9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAItE,OAAO,EACH,gBAAgB,EAChB,gBAAgB,EAEhB,+BAA+B,EAClC,MAAM,yCAAyC,CAAC;AAGjD,OAAO,EAAE,aAAa,EAAwB,wBAAwB,EAA8B,MAAM,aAAa,CAAC;AAGxH,OAAO,EAKH,aAAa,EAChB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAItD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C;;GAEG;AACH,oBAAY,yBAAyB;IACjC,IAAI,IAAI;IACR,MAAM,IAAI;IACV,aAAa,IAAI;CACpB;AAED;;;;;;;;;GASG;AACH,wBAAsB,aAAa,CAC/B,W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});
7
7
  exports.getFileLink = void 0;
8
- const common_utils_1 = require("@fluidframework/common-utils");
9
- const driver_utils_1 = require("@fluidframework/driver-utils");
10
8
  const telemetry_utils_1 = require("@fluidframework/telemetry-utils");
9
+ const core_utils_1 = require("@fluidframework/core-utils");
10
+ const driver_utils_1 = require("@fluidframework/driver-utils");
11
11
  const driver_definitions_1 = require("@fluidframework/driver-definitions");
12
- const getUrlAndHeadersWithAuth_1 = require("./getUrlAndHeadersWithAuth");
13
- const odspUtils_1 = require("./odspUtils");
14
- const packageVersion_1 = require("./packageVersion");
15
- const retryUtils_1 = require("./retryUtils");
12
+ const getUrlAndHeadersWithAuth_1 = require("./getUrlAndHeadersWithAuth.cjs");
13
+ const odspUtils_1 = require("./odspUtils.cjs");
14
+ const packageVersion_1 = require("./packageVersion.cjs");
15
+ const retryUtils_1 = require("./retryUtils.cjs");
16
16
  // Store cached responses for the lifetime of web session as file link remains the same for given file item
17
17
  const fileLinkCache = new Map();
18
18
  /**
@@ -22,14 +22,11 @@ const fileLinkCache = new Map();
22
22
  * throttling error. In future, we are thinking of app allowing to pass some cancel token, with which
23
23
  * we would be able to stop retrying.
24
24
  * @param getToken - used to fetch access tokens needed to execute operation
25
- * @param siteUrl - url of the site that contains the file
26
- * @param driveId - drive where file is stored
27
- * @param itemId - file id
28
- * @param identityType - type of client account
25
+ * @param odspUrlParts - object describing file storage identity
29
26
  * @param logger - used to log results of operation, including any error
30
27
  * @returns Promise which resolves to file link url when successful; otherwise, undefined.
31
28
  */
32
- async function getFileLink(getToken, odspUrlParts, identityType, logger) {
29
+ async function getFileLink(getToken, odspUrlParts, logger) {
33
30
  const cacheKey = `${odspUrlParts.siteUrl}_${odspUrlParts.driveId}_${odspUrlParts.itemId}`;
34
31
  const maybeFileLinkCacheEntry = fileLinkCache.get(cacheKey);
35
32
  if (maybeFileLinkCacheEntry !== undefined) {
@@ -38,19 +35,27 @@ async function getFileLink(getToken, odspUrlParts, identityType, logger) {
38
35
  const fileLinkGenerator = async function () {
39
36
  let fileLinkCore;
40
37
  try {
41
- fileLinkCore = await (0, retryUtils_1.runWithRetry)(async () => getFileLinkCore(getToken, odspUrlParts, identityType, logger), "getFileLinkCore", logger);
38
+ let retryCount = 0;
39
+ fileLinkCore = await (0, driver_utils_1.runWithRetry)(async () => (0, retryUtils_1.runWithRetry)(async () => getFileLinkCore(getToken, odspUrlParts, logger), "getFileLinkCore", logger), "getShareLink", logger, {
40
+ onRetry(delayInMs, error) {
41
+ retryCount++;
42
+ if (retryCount === 5) {
43
+ if (error !== undefined && typeof error === "object") {
44
+ error.canRetry = false;
45
+ throw error;
46
+ }
47
+ throw error;
48
+ }
49
+ },
50
+ });
42
51
  }
43
52
  catch (err) {
44
- // runWithRetry throws a non retriable error after it hits the max # of attempts
45
- // or encounters an unexpected error type
46
- if (!(0, driver_utils_1.canRetryOnError)(err)) {
47
- // Delete from the cache to permit retrying later.
48
- fileLinkCache.delete(cacheKey);
49
- }
53
+ // Delete from the cache to permit retrying later.
54
+ fileLinkCache.delete(cacheKey);
50
55
  throw err;
51
56
  }
52
57
  // We are guaranteed to run the getFileLinkCore at least once with successful result (which must be a string)
53
- (0, common_utils_1.assert)(fileLinkCore !== undefined, 0x292 /* "Unexpected undefined result from getFileLinkCore" */);
58
+ (0, core_utils_1.assert)(fileLinkCore !== undefined, 0x292 /* "Unexpected undefined result from getFileLinkCore" */);
54
59
  return fileLinkCore;
55
60
  };
56
61
  const fileLink = fileLinkGenerator();
@@ -58,43 +63,49 @@ async function getFileLink(getToken, odspUrlParts, identityType, logger) {
58
63
  return fileLink;
59
64
  }
60
65
  exports.getFileLink = getFileLink;
61
- async function getFileLinkCore(getToken, odspUrlParts, identityType, logger) {
62
- const fileItem = await getFileItemLite(getToken, odspUrlParts, logger, identityType === "Consumer");
66
+ async function getFileLinkCore(getToken, odspUrlParts, logger) {
67
+ const fileItem = await getFileItemLite(getToken, odspUrlParts, logger, true);
63
68
  // ODSP link requires extra call to return link that is resistant to file being renamed or moved to different folder
64
- return telemetry_utils_1.PerformanceEvent.timedExecAsync(logger, { eventName: "odspFileLink", requestName: "getSharingLink" }, async (event) => {
69
+ return telemetry_utils_1.PerformanceEvent.timedExecAsync(logger, { eventName: "odspFileLink", requestName: "getSharingInformation" }, async (event) => {
65
70
  let attempts = 0;
66
71
  let additionalProps;
67
72
  const fileLink = await (0, odspUtils_1.getWithRetryForTokenRefresh)(async (options) => {
68
- var _a;
69
73
  attempts++;
70
74
  const storageTokenFetcher = (0, odspUtils_1.toInstrumentedOdspTokenFetcher)(logger, odspUrlParts, getToken, true /* throwOnNullToken */);
71
75
  const storageToken = await storageTokenFetcher(options, "GetFileLinkCore");
72
- (0, common_utils_1.assert)(storageToken !== null, 0x2bb /* "Instrumented token fetcher with throwOnNullToken = true should never return null" */);
73
- const { url, headers } = (0, getUrlAndHeadersWithAuth_1.getUrlAndHeadersWithAuth)(`${odspUrlParts.siteUrl}/_api/web/GetFileByServerRelativeUrl(@a1)/Linkingurl?@a1=${encodeURIComponent(`'${new URL(fileItem.webDavUrl).pathname}'`)}`, storageToken, false);
76
+ (0, core_utils_1.assert)(storageToken !== null, 0x2bb /* "Instrumented token fetcher with throwOnNullToken = true should never return null" */);
77
+ // IMPORTANT: In past we were using GetFileByUrl() API to get to the list item that was corresponding
78
+ // to the file. This was intentionally replaced with GetFileById() to solve the following issue:
79
+ // GetFileByUrl() uses webDavUrl to locate list item. This API does not work for Consumer scenarios
80
+ // where webDavUrl is constructed using legacy ODC format for backward compatibility reasons.
81
+ // GetFileByUrl() does not understand that format and thus fails. GetFileById() relies on file item
82
+ // unique guid (sharepointIds.listItemUniqueId) and it works uniformly across Consumer and Commercial.
83
+ const { url, headers } = (0, getUrlAndHeadersWithAuth_1.getUrlAndHeadersWithAuth)(`${odspUrlParts.siteUrl}/_api/web/GetFileById(@a1)/ListItemAllFields/GetSharingInformation?@a1=guid${encodeURIComponent(`'${fileItem.sharepointIds.listItemUniqueId}'`)}`, storageToken, true);
74
84
  const requestInit = {
75
85
  method: "POST",
76
- headers: Object.assign({ "Content-Type": "application/json;odata=verbose", "Accept": "application/json;odata=verbose" }, headers),
86
+ headers: {
87
+ "Content-Type": "application/json;odata=verbose",
88
+ "Accept": "application/json;odata=verbose",
89
+ ...headers,
90
+ },
77
91
  };
78
92
  const response = await (0, odspUtils_1.fetchHelper)(url, requestInit);
79
93
  additionalProps = response.propsToLog;
80
94
  const sharingInfo = await response.content.json();
81
- const linkingUrl = (_a = sharingInfo === null || sharingInfo === void 0 ? void 0 : sharingInfo.d) === null || _a === void 0 ? void 0 : _a.LinkingUrl;
82
- if (typeof linkingUrl !== "string") {
95
+ const directUrl = sharingInfo?.d?.directUrl;
96
+ if (typeof directUrl !== "string") {
83
97
  // This will retry once in getWithRetryForTokenRefresh
84
- throw new driver_utils_1.NonRetryableError("Malformed GetSharingLink response", driver_definitions_1.DriverErrorType.incorrectServerResponse, { driverVersion: packageVersion_1.pkgVersion });
98
+ throw new driver_utils_1.NonRetryableError("Malformed GetSharingInformation response", driver_definitions_1.DriverErrorType.incorrectServerResponse, { driverVersion: packageVersion_1.pkgVersion });
85
99
  }
86
- return linkingUrl;
100
+ return directUrl;
87
101
  });
88
- event.end(Object.assign(Object.assign({}, additionalProps), { attempts }));
102
+ event.end({ ...additionalProps, attempts });
89
103
  return fileLink;
90
104
  });
91
105
  }
92
- const isFileItemLite = (maybeFileItemLite) => {
93
- if (typeof maybeFileItemLite.webUrl !== "string" || typeof maybeFileItemLite.webDavUrl !== "string") {
94
- return false;
95
- }
96
- return true;
97
- };
106
+ const isFileItemLite = (maybeFileItemLite) => typeof maybeFileItemLite.webUrl === "string" &&
107
+ typeof maybeFileItemLite.webDavUrl === "string" &&
108
+ typeof maybeFileItemLite.sharepointIds === "object";
98
109
  async function getFileItemLite(getToken, odspUrlParts, logger, forceAccessTokenViaAuthorizationHeader) {
99
110
  return telemetry_utils_1.PerformanceEvent.timedExecAsync(logger, { eventName: "odspFileLink", requestName: "getFileItemLite" }, async (event) => {
100
111
  let attempts = 0;
@@ -104,8 +115,8 @@ async function getFileItemLite(getToken, odspUrlParts, logger, forceAccessTokenV
104
115
  const { siteUrl, driveId, itemId } = odspUrlParts;
105
116
  const storageTokenFetcher = (0, odspUtils_1.toInstrumentedOdspTokenFetcher)(logger, odspUrlParts, getToken, true /* throwOnNullToken */);
106
117
  const storageToken = await storageTokenFetcher(options, "GetFileItemLite");
107
- (0, common_utils_1.assert)(storageToken !== null, 0x2bc /* "Instrumented token fetcher with throwOnNullToken =true should never return null" */);
108
- const { url, headers } = (0, getUrlAndHeadersWithAuth_1.getUrlAndHeadersWithAuth)(`${siteUrl}/_api/v2.0/drives/${driveId}/items/${itemId}?select=webUrl,webDavUrl`, storageToken, forceAccessTokenViaAuthorizationHeader);
118
+ (0, core_utils_1.assert)(storageToken !== null, 0x2bc /* "Instrumented token fetcher with throwOnNullToken =true should never return null" */);
119
+ const { url, headers } = (0, getUrlAndHeadersWithAuth_1.getUrlAndHeadersWithAuth)(`${siteUrl}/_api/v2.0/drives/${driveId}/items/${itemId}?select=webUrl,webDavUrl,sharepointIds`, storageToken, forceAccessTokenViaAuthorizationHeader);
109
120
  const requestInit = { method: "GET", headers };
110
121
  const response = await (0, odspUtils_1.fetchHelper)(url, requestInit);
111
122
  additionalProps = response.propsToLog;
@@ -116,8 +127,8 @@ async function getFileItemLite(getToken, odspUrlParts, logger, forceAccessTokenV
116
127
  }
117
128
  return responseJson;
118
129
  });
119
- event.end(Object.assign(Object.assign({}, additionalProps), { attempts }));
130
+ event.end({ ...additionalProps, attempts });
120
131
  return fileItem;
121
132
  });
122
133
  }
123
- //# sourceMappingURL=getFileLink.js.map
134
+ //# sourceMappingURL=getFileLink.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getFileLink.cjs","sourceRoot":"","sources":["../src/getFileLink.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,qEAAwF;AACxF,2DAAoD;AACpD,+DAA+E;AAC/E,2EAAqE;AAMrE,6EAAs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rB,CAAC,CAAC,CAAC;QACH,KAAK,CAAC,GAAG,CAAC,EAAE,GAAG,eAAe,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC5C,OAAO,QAAQ,CAAC;IACjB,CAAC,CACD,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryLoggerExt, PerformanceEvent } from \"@fluidframework/telemetry-utils\";\nimport { assert } from \"@fluidframework/core-utils\";\nimport { NonRetryableError, runWithRetry } from \"@fluidframework/driver-utils\";\nimport { DriverErrorType } from \"@fluidframework/driver-definitions\";\nimport {\n\tIOdspUrlParts,\n\tOdspResourceTokenFetchOptions,\n\tTokenFetcher,\n} from \"@fluidframework/odsp-driver-definitions\";\nimport { getUrlAndHeadersWithAuth } from \"./getUrlAndHeadersWithAuth\";\nimport {\n\tfetchHelper,\n\tgetWithRetryForTokenRefresh,\n\ttoInstrumentedOdspTokenFetcher,\n} from \"./odspUtils\";\nimport { pkgVersion as driverVersion } from \"./packageVersion\";\nimport { runWithRetry as runWithRetryForCoherencyAndServiceReadOnlyErrors } from \"./retryUtils\";\n\n// Store cached responses for the lifetime of web session as file link remains the same for given file item\nconst fileLinkCache = new Map<string, Promise<string>>();\n\n/**\n * Returns file link for a file with given drive and item ids.\n * Scope needed: files.readwrite.all.\n * This function keeps retrying if it gets a retriable error or wait for some delay if it gets a\n * throttling error. In future, we are thinking of app allowing to pass some cancel token, with which\n * we would be able to stop retrying.\n * @param getToken - used to fetch access tokens needed to execute operation\n * @param odspUrlParts - object describing file storage identity\n * @param logger - used to log results of operation, including any error\n * @returns Promise which resolves to file link url when successful; otherwise, undefined.\n */\nexport async function getFileLink(\n\tgetToken: TokenFetcher<OdspResourceTokenFetchOptions>,\n\todspUrlParts: IOdspUrlParts,\n\tlogger: ITelemetryLoggerExt,\n): Promise<string> {\n\tconst cacheKey = `${odspUrlParts.siteUrl}_${odspUrlParts.driveId}_${odspUrlParts.itemId}`;\n\tconst maybeFileLinkCacheEntry = fileLinkCache.get(cacheKey);\n\tif (maybeFileLinkCacheEntry !== undefined) {\n\t\treturn maybeFileLinkCacheEntry;\n\t}\n\n\tconst fileLinkGenerator = async function () {\n\t\tlet fileLinkCore: string;\n\t\ttry {\n\t\t\tlet retryCount = 0;\n\t\t\tfileLinkCore = await runWithRetry(\n\t\t\t\tasync () =>\n\t\t\t\t\trunWithRetryForCoherencyAndServiceReadOnlyErrors(\n\t\t\t\t\t\tasync () => getFileLinkCore(getToken, odspUrlParts, logger),\n\t\t\t\t\t\t\"getFileLinkCore\",\n\t\t\t\t\t\tlogger,\n\t\t\t\t\t),\n\t\t\t\t\"getShareLink\",\n\t\t\t\tlogger,\n\t\t\t\t{\n\t\t\t\t\tonRetry(delayInMs: number, error: any) {\n\t\t\t\t\t\tretryCount++;\n\t\t\t\t\t\tif (retryCount === 5) {\n\t\t\t\t\t\t\tif (error !== undefined && typeof error === \"object\") {\n\t\t\t\t\t\t\t\terror.canRetry = false;\n\t\t\t\t\t\t\t\tthrow error;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tthrow error;\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t);\n\t\t} catch (err) {\n\t\t\t// Delete from the cache to permit retrying later.\n\t\t\tfileLinkCache.delete(cacheKey);\n\t\t\tthrow err;\n\t\t}\n\n\t\t// We are guaranteed to run the getFileLinkCore at least once with successful result (which must be a string)\n\t\tassert(\n\t\t\tfileLinkCore !== undefined,\n\t\t\t0x292 /* \"Unexpected undefined result from getFileLinkCore\" */,\n\t\t);\n\t\treturn fileLinkCore;\n\t};\n\tconst fileLink = fileLinkGenerator();\n\tfileLinkCache.set(cacheKey, fileLink);\n\treturn fileLink;\n}\n\nasync function getFileLinkCore(\n\tgetToken: TokenFetcher<OdspResourceTokenFetchOptions>,\n\todspUrlParts: IOdspUrlParts,\n\tlogger: ITelemetryLoggerExt,\n): Promise<string> {\n\tconst fileItem = await getFileItemLite(getToken, odspUrlParts, logger, true);\n\n\t// ODSP link requires extra call to return link that is resistant to file being renamed or moved to different folder\n\treturn PerformanceEvent.timedExecAsync(\n\t\tlogger,\n\t\t{ eventName: \"odspFileLink\", requestName: \"getSharingInformation\" },\n\t\tasync (event) => {\n\t\t\tlet attempts = 0;\n\t\t\tlet additionalProps;\n\t\t\tconst fileLink = await getWithRetryForTokenRefresh(async (options) => {\n\t\t\t\tattempts++;\n\t\t\t\tconst storageTokenFetcher = toInstrumentedOdspTokenFetcher(\n\t\t\t\t\tlogger,\n\t\t\t\t\todspUrlParts,\n\t\t\t\t\tgetToken,\n\t\t\t\t\ttrue /* throwOnNullToken */,\n\t\t\t\t);\n\t\t\t\tconst storageToken = await storageTokenFetcher(options, \"GetFileLinkCore\");\n\t\t\t\tassert(\n\t\t\t\t\tstorageToken !== null,\n\t\t\t\t\t0x2bb /* \"Instrumented token fetcher with throwOnNullToken = true should never return null\" */,\n\t\t\t\t);\n\n\t\t\t\t// IMPORTANT: In past we were using GetFileByUrl() API to get to the list item that was corresponding\n\t\t\t\t// to the file. This was intentionally replaced with GetFileById() to solve the following issue:\n\t\t\t\t// GetFileByUrl() uses webDavUrl to locate list item. This API does not work for Consumer scenarios\n\t\t\t\t// where webDavUrl is constructed using legacy ODC format for backward compatibility reasons.\n\t\t\t\t// GetFileByUrl() does not understand that format and thus fails. GetFileById() relies on file item\n\t\t\t\t// unique guid (sharepointIds.listItemUniqueId) and it works uniformly across Consumer and Commercial.\n\t\t\t\tconst { url, headers } = getUrlAndHeadersWithAuth(\n\t\t\t\t\t`${\n\t\t\t\t\t\todspUrlParts.siteUrl\n\t\t\t\t\t}/_api/web/GetFileById(@a1)/ListItemAllFields/GetSharingInformation?@a1=guid${encodeURIComponent(\n\t\t\t\t\t\t`'${fileItem.sharepointIds.listItemUniqueId}'`,\n\t\t\t\t\t)}`,\n\t\t\t\t\tstorageToken,\n\t\t\t\t\ttrue,\n\t\t\t\t);\n\t\t\t\tconst requestInit = {\n\t\t\t\t\tmethod: \"POST\",\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t\"Content-Type\": \"application/json;odata=verbose\",\n\t\t\t\t\t\t\"Accept\": \"application/json;odata=verbose\",\n\t\t\t\t\t\t...headers,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\tconst response = await fetchHelper(url, requestInit);\n\t\t\t\tadditionalProps = response.propsToLog;\n\n\t\t\t\tconst sharingInfo = await response.content.json();\n\t\t\t\tconst directUrl = sharingInfo?.d?.directUrl;\n\t\t\t\tif (typeof directUrl !== \"string\") {\n\t\t\t\t\t// This will retry once in getWithRetryForTokenRefresh\n\t\t\t\t\tthrow new NonRetryableError(\n\t\t\t\t\t\t\"Malformed GetSharingInformation response\",\n\t\t\t\t\t\tDriverErrorType.incorrectServerResponse,\n\t\t\t\t\t\t{ driverVersion },\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn directUrl;\n\t\t\t});\n\t\t\tevent.end({ ...additionalProps, attempts });\n\t\t\treturn fileLink;\n\t\t},\n\t);\n}\n\n/**\n * Sharepoint Ids Interface\n */\ninterface IGraphSharepointIds {\n\tlistId: string;\n\tlistItemId: string;\n\tlistItemUniqueId: string;\n\tsiteId: string;\n\tsiteUrl: string;\n\twebId: string;\n}\n\n/**\n * This represents a lite version of file item containing only select file properties\n */\ninterface FileItemLite {\n\twebUrl: string;\n\twebDavUrl: string;\n\tsharepointIds: IGraphSharepointIds;\n}\n\nconst isFileItemLite = (maybeFileItemLite: any): maybeFileItemLite is FileItemLite =>\n\ttypeof maybeFileItemLite.webUrl === \"string\" &&\n\ttypeof maybeFileItemLite.webDavUrl === \"string\" &&\n\ttypeof maybeFileItemLite.sharepointIds === \"object\";\n\nasync function getFileItemLite(\n\tgetToken: TokenFetcher<OdspResourceTokenFetchOptions>,\n\todspUrlParts: IOdspUrlParts,\n\tlogger: ITelemetryLoggerExt,\n\tforceAccessTokenViaAuthorizationHeader: boolean,\n): Promise<FileItemLite> {\n\treturn PerformanceEvent.timedExecAsync(\n\t\tlogger,\n\t\t{ eventName: \"odspFileLink\", requestName: \"getFileItemLite\" },\n\t\tasync (event) => {\n\t\t\tlet attempts = 0;\n\t\t\tlet additionalProps;\n\t\t\tconst fileItem = await getWithRetryForTokenRefresh(async (options) => {\n\t\t\t\tattempts++;\n\t\t\t\tconst { siteUrl, driveId, itemId } = odspUrlParts;\n\t\t\t\tconst storageTokenFetcher = toInstrumentedOdspTokenFetcher(\n\t\t\t\t\tlogger,\n\t\t\t\t\todspUrlParts,\n\t\t\t\t\tgetToken,\n\t\t\t\t\ttrue /* throwOnNullToken */,\n\t\t\t\t);\n\t\t\t\tconst storageToken = await storageTokenFetcher(options, \"GetFileItemLite\");\n\t\t\t\tassert(\n\t\t\t\t\tstorageToken !== null,\n\t\t\t\t\t0x2bc /* \"Instrumented token fetcher with throwOnNullToken =true should never return null\" */,\n\t\t\t\t);\n\n\t\t\t\tconst { url, headers } = getUrlAndHeadersWithAuth(\n\t\t\t\t\t`${siteUrl}/_api/v2.0/drives/${driveId}/items/${itemId}?select=webUrl,webDavUrl,sharepointIds`,\n\t\t\t\t\tstorageToken,\n\t\t\t\t\tforceAccessTokenViaAuthorizationHeader,\n\t\t\t\t);\n\t\t\t\tconst requestInit = { method: \"GET\", headers };\n\t\t\t\tconst response = await fetchHelper(url, requestInit);\n\t\t\t\tadditionalProps = response.propsToLog;\n\n\t\t\t\tconst responseJson = await response.content.json();\n\t\t\t\tif (!isFileItemLite(responseJson)) {\n\t\t\t\t\t// This will retry once in getWithRetryForTokenRefresh\n\t\t\t\t\tthrow new NonRetryableError(\n\t\t\t\t\t\t\"Malformed getFileItemLite response\",\n\t\t\t\t\t\tDriverErrorType.incorrectServerResponse,\n\t\t\t\t\t\t{ driverVersion },\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn responseJson;\n\t\t\t});\n\t\t\tevent.end({ ...additionalProps, attempts });\n\t\t\treturn fileItem;\n\t\t},\n\t);\n}\n"]}
@@ -2,8 +2,8 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { ITelemetryLogger } from "@fluidframework/common-definitions";
6
- import { IOdspUrlParts, OdspResourceTokenFetchOptions, IdentityType, TokenFetcher } from "@fluidframework/odsp-driver-definitions";
5
+ import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
6
+ import { IOdspUrlParts, OdspResourceTokenFetchOptions, TokenFetcher } from "@fluidframework/odsp-driver-definitions";
7
7
  /**
8
8
  * Returns file link for a file with given drive and item ids.
9
9
  * Scope needed: files.readwrite.all.
@@ -11,12 +11,9 @@ import { IOdspUrlParts, OdspResourceTokenFetchOptions, IdentityType, TokenFetche
11
11
  * throttling error. In future, we are thinking of app allowing to pass some cancel token, with which
12
12
  * we would be able to stop retrying.
13
13
  * @param getToken - used to fetch access tokens needed to execute operation
14
- * @param siteUrl - url of the site that contains the file
15
- * @param driveId - drive where file is stored
16
- * @param itemId - file id
17
- * @param identityType - type of client account
14
+ * @param odspUrlParts - object describing file storage identity
18
15
  * @param logger - used to log results of operation, including any error
19
16
  * @returns Promise which resolves to file link url when successful; otherwise, undefined.
20
17
  */
21
- export declare function getFileLink(getToken: TokenFetcher<OdspResourceTokenFetchOptions>, odspUrlParts: IOdspUrlParts, identityType: IdentityType, logger: ITelemetryLogger): Promise<string>;
18
+ export declare function getFileLink(getToken: TokenFetcher<OdspResourceTokenFetchOptions>, odspUrlParts: IOdspUrlParts, logger: ITelemetryLoggerExt): Promise<string>;
22
19
  //# sourceMappingURL=getFileLink.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getFileLink.d.ts","sourceRoot":"","sources":["../src/getFileLink.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAKtE,OAAO,EACH,aAAa,EACb,6BAA6B,EAC7B,YAAY,EACZ,YAAY,EACf,MAAM,yCAAyC,CAAC;AASjD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,WAAW,CAC7B,QAAQ,EAAE,YAAY,CAAC,6BAA6B,CAAC,EACrD,YAAY,EAAE,aAAa,EAC3B,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,gBAAgB,GACzB,OAAO,CAAC,MAAM,CAAC,CAgCjB"}
1
+ {"version":3,"file":"getFileLink.d.ts","sourceRoot":"","sources":["../src/getFileLink.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,mBAAmB,EAAoB,MAAM,iCAAiC,CAAC;AAIxF,OAAO,EACN,aAAa,EACb,6BAA6B,EAC7B,YAAY,EACZ,MAAM,yCAAyC,CAAC;AAajD;;;;;;;;;;GAUG;AACH,wBAAsB,WAAW,CAChC,QAAQ,EAAE,YAAY,CAAC,6BAA6B,CAAC,EACrD,YAAY,EAAE,aAAa,EAC3B,MAAM,EAAE,mBAAmB,GACzB,OAAO,CAAC,MAAM,CAAC,CAiDjB"}
@@ -16,4 +16,4 @@ function getQueryString(queryParams) {
16
16
  return queryString;
17
17
  }
18
18
  exports.getQueryString = getQueryString;
19
- //# sourceMappingURL=getQueryString.js.map
19
+ //# sourceMappingURL=getQueryString.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getQueryString.cjs","sourceRoot":"","sources":["../src/getQueryString.ts"],"names":[],"mappings":";;;AAMA;;;GAGG;AACH,SAAgB,cAAc,CAC7B,WAAkE;IAElE,IAAI,WAAW,GAAG,EAAE,CAAC;IACrB,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE;QAC3C,IAAI,WAAW,CAAC,GAAG,CAAC,KAAK,SAAS,EAAE;YACnC,MAAM,SAAS,GAAG,WAAW,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;YACjD,WAAW,IAAI,GAAG,SAAS,GAAG,GAAG,IAAI,kBAAkB,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;SAC5E;KACD;IAED,OAAO,WAAW,CAAC;AACpB,CAAC;AAZD,wCAYC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { ISnapshotOptions } from \"@fluidframework/odsp-driver-definitions\";\n\n/**\n * Generates query string from the given query parameters.\n * @param queryParams - Query parameters from which to create a query.\n */\nexport function getQueryString(\n\tqueryParams: { [key: string]: string | number } | ISnapshotOptions,\n): string {\n\tlet queryString = \"\";\n\tfor (const key of Object.keys(queryParams)) {\n\t\tif (queryParams[key] !== undefined) {\n\t\t\tconst startChar = queryString === \"\" ? \"?\" : \"&\";\n\t\t\tqueryString += `${startChar}${key}=${encodeURIComponent(queryParams[key])}`;\n\t\t}\n\t}\n\n\treturn queryString;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"getQueryString.d.ts","sourceRoot":"","sources":["../src/getQueryString.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAE3E;;;GAGG;AACH,wBAAgB,cAAc,CAAC,WAAW,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;CAAE,GAAG,gBAAgB,GAAG,MAAM,CAU1G"}
1
+ {"version":3,"file":"getQueryString.d.ts","sourceRoot":"","sources":["../src/getQueryString.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAE3E;;;GAGG;AACH,wBAAgB,cAAc,CAC7B,WAAW,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAA;CAAE,GAAG,gBAAgB,GAChE,MAAM,CAUR"}
@@ -5,7 +5,9 @@
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.getUrlAndHeadersWithAuth = void 0;
8
- function getUrlAndHeadersWithAuth(url, token, forceAccessTokenViaAuthorizationHeader) {
8
+ function getUrlAndHeadersWithAuth(url,
9
+ // eslint-disable-next-line @rushstack/no-new-null
10
+ token, forceAccessTokenViaAuthorizationHeader) {
9
11
  if (!token || token.length === 0) {
10
12
  return { url, headers: {} };
11
13
  }
@@ -37,4 +39,4 @@ function getUrlAndHeadersWithAuth(url, token, forceAccessTokenViaAuthorizationHe
37
39
  };
38
40
  }
39
41
  exports.getUrlAndHeadersWithAuth = getUrlAndHeadersWithAuth;
40
- //# sourceMappingURL=getUrlAndHeadersWithAuth.js.map
42
+ //# sourceMappingURL=getUrlAndHeadersWithAuth.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getUrlAndHeadersWithAuth.cjs","sourceRoot":"","sources":["../src/getUrlAndHeadersWithAuth.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,SAAgB,wBAAwB,CACvC,GAAW;AACX,kDAAkD;AAClD,KAAoB,EACpB,sCAA+C;IAE/C,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;QACjC,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;KAC5B;IAED,IAAI,CAAC,sCAAsC,EAAE;QAC5C,4FAA4F;QAC5F,6DAA6D;QAC7D,MAAM,+BAA+B,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;QACrD,4FAA4F;QAC5F,qCAAqC;QACrC,+BAA+B,CAAC,YAAY,CAAC,GAAG,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;QACxE,mFAAmF;QACnF,wGAAwG;QACxG,4EAA4E;QAC5E,2GAA2G;QAC3G,0GAA0G;QAC1G,gBAAgB;QAChB,IAAI,+BAA+B,CAAC,MAAM,CAAC,MAAM,IAAI,IAAI,EAAE;YAC1D,OAAO;gBACN,OAAO,EAAE,EAAE;gBACX,GAAG,EAAE,+BAA+B,CAAC,IAAI;aACzC,CAAC;SACF;KACD;IAED,OAAO;QACN,OAAO,EAAE;YACR,aAAa,EAAE,UAAU,KAAK,EAAE;SAChC;QACD,GAAG;KACH,CAAC;AACH,CAAC;AArCD,4DAqCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport function getUrlAndHeadersWithAuth(\n\turl: string,\n\t// eslint-disable-next-line @rushstack/no-new-null\n\ttoken: string | null,\n\tforceAccessTokenViaAuthorizationHeader: boolean,\n): { url: string; headers: { [index: string]: string } } {\n\tif (!token || token.length === 0) {\n\t\treturn { url, headers: {} };\n\t}\n\n\tif (!forceAccessTokenViaAuthorizationHeader) {\n\t\t// Pass access token via query string: this will make request be treated as 'simple' request\n\t\t// which does not require OPTIONS call as part of CORS check.\n\t\tconst urlWithAccessTokenInQueryString = new URL(url);\n\t\t// IMPORTANT: Do not apply encodeURIComponent to token, param value is automatically encoded\n\t\t// when set via URLSearchParams class\n\t\turlWithAccessTokenInQueryString.searchParams.set(\"access_token\", token);\n\t\t// ODSP APIs have a limitation that the query string cannot exceed 2048 characters.\n\t\t// If the query string exceeds 2048, we have to fall back to sending the access token as a header, which\n\t\t// has a negative performance implication as it adds a performance overhead.\n\t\t// NOTE: URL.search.length value includes '?' symbol and it is unclear whether backend logic which enforces\n\t\t// query length limit accounts for it. This logic errs on side of caution and includes that key in overall\n\t\t// query length.\n\t\tif (urlWithAccessTokenInQueryString.search.length <= 2048) {\n\t\t\treturn {\n\t\t\t\theaders: {},\n\t\t\t\turl: urlWithAccessTokenInQueryString.href,\n\t\t\t};\n\t\t}\n\t}\n\n\treturn {\n\t\theaders: {\n\t\t\tAuthorization: `Bearer ${token}`,\n\t\t},\n\t\turl,\n\t};\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"getUrlAndHeadersWithAuth.d.ts","sourceRoot":"","sources":["../src/getUrlAndHeadersWithAuth.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,wBAAgB,wBAAwB,CACpC,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,GAAG,IAAI,EACpB,sCAAsC,EAAE,OAAO,GAChD;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE;QAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;KAAE,CAAC;CAAE,CAgCzD"}
1
+ {"version":3,"file":"getUrlAndHeadersWithAuth.d.ts","sourceRoot":"","sources":["../src/getUrlAndHeadersWithAuth.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,wBAAgB,wBAAwB,CACvC,GAAG,EAAE,MAAM,EAEX,KAAK,EAAE,MAAM,GAAG,IAAI,EACpB,sCAAsC,EAAE,OAAO,GAC7C;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE;QAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAA;CAAE,CAgCvD"}
package/dist/index.cjs ADDED
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ /*!
3
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
+ * Licensed under the MIT License.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.parseCompactSnapshotResponse = exports.SnapshotFormatSupportType = exports.isOdspResolvedUrl = exports.storeLocatorInOdspUrl = exports.locatorQueryParamName = exports.getLocatorFromOdspUrl = exports.encodeOdspFluidDataStoreLocator = exports.OdspDriverUrlResolverForShareLink = exports.OdspDriverUrlResolver = exports.createOdspCreateContainerRequest = exports.OdspDocumentServiceFactoryWithCodeSplit = exports.OdspDocumentServiceFactoryCore = exports.OdspDocumentServiceFactory = exports.createLocalOdspDocumentServiceFactory = exports.prefetchLatestSnapshot = exports.isSpoUrl = exports.isOdcUrl = exports.isOdcOrigin = exports.getOdspUrlParts = exports.getApiRoot = exports.getHashedDocumentId = exports.createOdspUrl = exports.checkUrl = exports.SharingLinkHeader = exports.ClpCompliantAppHeader = exports.OdcFileSiteOrigin = exports.OdcApiSiteOrigin = void 0;
8
+ // Constants
9
+ var constants_1 = require("./constants.cjs");
10
+ Object.defineProperty(exports, "OdcApiSiteOrigin", { enumerable: true, get: function () { return constants_1.OdcApiSiteOrigin; } });
11
+ Object.defineProperty(exports, "OdcFileSiteOrigin", { enumerable: true, get: function () { return constants_1.OdcFileSiteOrigin; } });
12
+ var contractsPublic_1 = require("./contractsPublic.cjs");
13
+ Object.defineProperty(exports, "ClpCompliantAppHeader", { enumerable: true, get: function () { return contractsPublic_1.ClpCompliantAppHeader; } });
14
+ Object.defineProperty(exports, "SharingLinkHeader", { enumerable: true, get: function () { return contractsPublic_1.SharingLinkHeader; } });
15
+ // public utils
16
+ var checkUrl_1 = require("./checkUrl.cjs");
17
+ Object.defineProperty(exports, "checkUrl", { enumerable: true, get: function () { return checkUrl_1.checkUrl; } });
18
+ var createOdspUrl_1 = require("./createOdspUrl.cjs");
19
+ Object.defineProperty(exports, "createOdspUrl", { enumerable: true, get: function () { return createOdspUrl_1.createOdspUrl; } });
20
+ var odspPublicUtils_1 = require("./odspPublicUtils.cjs");
21
+ Object.defineProperty(exports, "getHashedDocumentId", { enumerable: true, get: function () { return odspPublicUtils_1.getHashedDocumentId; } });
22
+ var odspUrlHelper_1 = require("./odspUrlHelper.cjs");
23
+ Object.defineProperty(exports, "getApiRoot", { enumerable: true, get: function () { return odspUrlHelper_1.getApiRoot; } });
24
+ Object.defineProperty(exports, "getOdspUrlParts", { enumerable: true, get: function () { return odspUrlHelper_1.getOdspUrlParts; } });
25
+ Object.defineProperty(exports, "isOdcOrigin", { enumerable: true, get: function () { return odspUrlHelper_1.isOdcOrigin; } });
26
+ Object.defineProperty(exports, "isOdcUrl", { enumerable: true, get: function () { return odspUrlHelper_1.isOdcUrl; } });
27
+ Object.defineProperty(exports, "isSpoUrl", { enumerable: true, get: function () { return odspUrlHelper_1.isSpoUrl; } });
28
+ // prefetch latest snapshot before container load
29
+ var prefetchLatestSnapshot_1 = require("./prefetchLatestSnapshot.cjs");
30
+ Object.defineProperty(exports, "prefetchLatestSnapshot", { enumerable: true, get: function () { return prefetchLatestSnapshot_1.prefetchLatestSnapshot; } });
31
+ // Factory
32
+ var odspDocumentServiceFactory_1 = require("./odspDocumentServiceFactory.cjs");
33
+ Object.defineProperty(exports, "createLocalOdspDocumentServiceFactory", { enumerable: true, get: function () { return odspDocumentServiceFactory_1.createLocalOdspDocumentServiceFactory; } });
34
+ Object.defineProperty(exports, "OdspDocumentServiceFactory", { enumerable: true, get: function () { return odspDocumentServiceFactory_1.OdspDocumentServiceFactory; } });
35
+ var odspDocumentServiceFactoryCore_1 = require("./odspDocumentServiceFactoryCore.cjs");
36
+ Object.defineProperty(exports, "OdspDocumentServiceFactoryCore", { enumerable: true, get: function () { return odspDocumentServiceFactoryCore_1.OdspDocumentServiceFactoryCore; } });
37
+ var odspDocumentServiceFactoryWithCodeSplit_1 = require("./odspDocumentServiceFactoryWithCodeSplit.cjs");
38
+ Object.defineProperty(exports, "OdspDocumentServiceFactoryWithCodeSplit", { enumerable: true, get: function () { return odspDocumentServiceFactoryWithCodeSplit_1.OdspDocumentServiceFactoryWithCodeSplit; } });
39
+ // File creation
40
+ var createOdspCreateContainerRequest_1 = require("./createOdspCreateContainerRequest.cjs");
41
+ Object.defineProperty(exports, "createOdspCreateContainerRequest", { enumerable: true, get: function () { return createOdspCreateContainerRequest_1.createOdspCreateContainerRequest; } });
42
+ // URI Resolver functionality, URI management
43
+ var odspDriverUrlResolver_1 = require("./odspDriverUrlResolver.cjs");
44
+ Object.defineProperty(exports, "OdspDriverUrlResolver", { enumerable: true, get: function () { return odspDriverUrlResolver_1.OdspDriverUrlResolver; } });
45
+ var odspDriverUrlResolverForShareLink_1 = require("./odspDriverUrlResolverForShareLink.cjs");
46
+ Object.defineProperty(exports, "OdspDriverUrlResolverForShareLink", { enumerable: true, get: function () { return odspDriverUrlResolverForShareLink_1.OdspDriverUrlResolverForShareLink; } });
47
+ // It's used by URL resolve code, but also has some public functions
48
+ var odspFluidFileLink_1 = require("./odspFluidFileLink.cjs");
49
+ Object.defineProperty(exports, "encodeOdspFluidDataStoreLocator", { enumerable: true, get: function () { return odspFluidFileLink_1.encodeOdspFluidDataStoreLocator; } });
50
+ Object.defineProperty(exports, "getLocatorFromOdspUrl", { enumerable: true, get: function () { return odspFluidFileLink_1.getLocatorFromOdspUrl; } });
51
+ Object.defineProperty(exports, "locatorQueryParamName", { enumerable: true, get: function () { return odspFluidFileLink_1.locatorQueryParamName; } });
52
+ Object.defineProperty(exports, "storeLocatorInOdspUrl", { enumerable: true, get: function () { return odspFluidFileLink_1.storeLocatorInOdspUrl; } });
53
+ var odspUtils_1 = require("./odspUtils.cjs");
54
+ Object.defineProperty(exports, "isOdspResolvedUrl", { enumerable: true, get: function () { return odspUtils_1.isOdspResolvedUrl; } });
55
+ var fetchSnapshot_1 = require("./fetchSnapshot.cjs");
56
+ Object.defineProperty(exports, "SnapshotFormatSupportType", { enumerable: true, get: function () { return fetchSnapshot_1.SnapshotFormatSupportType; } });
57
+ var compactSnapshotParser_1 = require("./compactSnapshotParser.cjs");
58
+ Object.defineProperty(exports, "parseCompactSnapshotResponse", { enumerable: true, get: function () { return compactSnapshotParser_1.parseCompactSnapshotResponse; } });
59
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,YAAY;AACZ,6CAAkE;AAAzD,6GAAA,gBAAgB,OAAA;AAAE,8GAAA,iBAAiB,OAAA;AAE5C,yDAM2B;AAL1B,wHAAA,qBAAqB,OAAA;AAIrB,oHAAA,iBAAiB,OAAA;AAGlB,eAAe;AACf,2CAAsC;AAA7B,oGAAA,QAAQ,OAAA;AACjB,qDAAgD;AAAvC,8GAAA,aAAa,OAAA;AACtB,yDAA2E;AAAlE,sHAAA,mBAAmB,OAAA;AAC5B,qDAA+F;AAAtF,2GAAA,UAAU,OAAA;AAAE,gHAAA,eAAe,OAAA;AAAE,4GAAA,WAAW,OAAA;AAAE,yGAAA,QAAQ,OAAA;AAAE,yGAAA,QAAQ,OAAA;AAErE,iDAAiD;AACjD,uEAAkE;AAAzD,gIAAA,sBAAsB,OAAA;AAE/B,UAAU;AACV,+EAGsC;AAFrC,mJAAA,qCAAqC,OAAA;AACrC,wIAAA,0BAA0B,OAAA;AAE3B,uFAAkF;AAAzE,gJAAA,8BAA8B,OAAA;AACvC,yGAAoG;AAA3F,kKAAA,uCAAuC,OAAA;AAEhD,gBAAgB;AAChB,2FAAsF;AAA7E,oJAAA,gCAAgC,OAAA;AAEzC,6CAA6C;AAC7C,qEAAgE;AAAvD,8HAAA,qBAAqB,OAAA;AAC9B,6FAG6C;AAF5C,sJAAA,iCAAiC,OAAA;AAIlC,oEAAoE;AACpE,6DAK6B;AAJ5B,oIAAA,+BAA+B,OAAA;AAC/B,0HAAA,qBAAqB,OAAA;AACrB,0HAAA,qBAAqB,OAAA;AACrB,0HAAA,qBAAqB,OAAA;AAUtB,6CAA+D;AAAvC,8GAAA,iBAAiB,OAAA;AACzC,qDAA4D;AAAnD,0HAAA,yBAAyB,OAAA;AAClC,qEAAmG;AAA9D,qIAAA,4BAA4B,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// Constants\nexport { OdcApiSiteOrigin, OdcFileSiteOrigin } from \"./constants\";\n\nexport {\n\tClpCompliantAppHeader,\n\tIClpCompliantAppHeader,\n\tISharingLinkHeader,\n\tOdspFluidDataStoreLocator,\n\tSharingLinkHeader,\n} from \"./contractsPublic\";\n\n// public utils\nexport { checkUrl } from \"./checkUrl\";\nexport { createOdspUrl } from \"./createOdspUrl\";\nexport { getHashedDocumentId, ISnapshotContents } from \"./odspPublicUtils\";\nexport { getApiRoot, getOdspUrlParts, isOdcOrigin, isOdcUrl, isSpoUrl } from \"./odspUrlHelper\";\n\n// prefetch latest snapshot before container load\nexport { prefetchLatestSnapshot } from \"./prefetchLatestSnapshot\";\n\n// Factory\nexport {\n\tcreateLocalOdspDocumentServiceFactory,\n\tOdspDocumentServiceFactory,\n} from \"./odspDocumentServiceFactory\";\nexport { OdspDocumentServiceFactoryCore } from \"./odspDocumentServiceFactoryCore\";\nexport { OdspDocumentServiceFactoryWithCodeSplit } from \"./odspDocumentServiceFactoryWithCodeSplit\";\n\n// File creation\nexport { createOdspCreateContainerRequest } from \"./createOdspCreateContainerRequest\";\n\n// URI Resolver functionality, URI management\nexport { OdspDriverUrlResolver } from \"./odspDriverUrlResolver\";\nexport {\n\tOdspDriverUrlResolverForShareLink,\n\tShareLinkFetcherProps,\n} from \"./odspDriverUrlResolverForShareLink\";\n\n// It's used by URL resolve code, but also has some public functions\nexport {\n\tencodeOdspFluidDataStoreLocator,\n\tgetLocatorFromOdspUrl,\n\tlocatorQueryParamName,\n\tstoreLocatorInOdspUrl,\n} from \"./odspFluidFileLink\";\n\nexport {\n\tIOdspCache,\n\tIPersistedFileCache,\n\tINonPersistentCache,\n\tIPrefetchSnapshotContents,\n} from \"./odspCache\";\nexport { ICacheAndTracker, type EpochTracker, FetchType, FetchTypeInternal } from \"./epochTracker\";\nexport { IOdspResponse, isOdspResolvedUrl } from \"./odspUtils\";\nexport { SnapshotFormatSupportType } from \"./fetchSnapshot\";\nexport { ISnapshotContentsWithProps, parseCompactSnapshotResponse } from \"./compactSnapshotParser\";\n"]}
package/dist/index.d.ts CHANGED
@@ -2,20 +2,23 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export * from "./constants";
6
- export * from "./contractsPublic";
7
- export * from "./odspPublicUtils";
8
- export * from "./odspUrlHelper";
9
- export * from "./createOdspUrl";
10
- export * from "./checkUrl";
11
- export * from "./prefetchLatestSnapshot";
12
- export * from "./odspDocumentServiceFactoryCore";
13
- export * from "./odspDocumentServiceFactory";
14
- export * from "./odspDocumentServiceFactoryWithCodeSplit";
15
- export * from "./createOdspCreateContainerRequest";
16
- export * from "./odspDriverUrlResolverForShareLink";
17
- export * from "./odspDriverUrlResolver";
18
- export * from "./odspFluidFileLink";
19
- export * from "./compactSnapshotParser";
20
- export * from "./ReadBufferUtils";
5
+ export { OdcApiSiteOrigin, OdcFileSiteOrigin } from "./constants";
6
+ export { ClpCompliantAppHeader, IClpCompliantAppHeader, ISharingLinkHeader, OdspFluidDataStoreLocator, SharingLinkHeader, } from "./contractsPublic";
7
+ export { checkUrl } from "./checkUrl";
8
+ export { createOdspUrl } from "./createOdspUrl";
9
+ export { getHashedDocumentId, ISnapshotContents } from "./odspPublicUtils";
10
+ export { getApiRoot, getOdspUrlParts, isOdcOrigin, isOdcUrl, isSpoUrl } from "./odspUrlHelper";
11
+ export { prefetchLatestSnapshot } from "./prefetchLatestSnapshot";
12
+ export { createLocalOdspDocumentServiceFactory, OdspDocumentServiceFactory, } from "./odspDocumentServiceFactory";
13
+ export { OdspDocumentServiceFactoryCore } from "./odspDocumentServiceFactoryCore";
14
+ export { OdspDocumentServiceFactoryWithCodeSplit } from "./odspDocumentServiceFactoryWithCodeSplit";
15
+ export { createOdspCreateContainerRequest } from "./createOdspCreateContainerRequest";
16
+ export { OdspDriverUrlResolver } from "./odspDriverUrlResolver";
17
+ export { OdspDriverUrlResolverForShareLink, ShareLinkFetcherProps, } from "./odspDriverUrlResolverForShareLink";
18
+ export { encodeOdspFluidDataStoreLocator, getLocatorFromOdspUrl, locatorQueryParamName, storeLocatorInOdspUrl, } from "./odspFluidFileLink";
19
+ export { IOdspCache, IPersistedFileCache, INonPersistentCache, IPrefetchSnapshotContents, } from "./odspCache";
20
+ export { ICacheAndTracker, type EpochTracker, FetchType, FetchTypeInternal } from "./epochTracker";
21
+ export { IOdspResponse, isOdspResolvedUrl } from "./odspUtils";
22
+ export { SnapshotFormatSupportType } from "./fetchSnapshot";
23
+ export { ISnapshotContentsWithProps, parseCompactSnapshotResponse } from "./compactSnapshotParser";
21
24
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,cAAc,aAAa,CAAC;AAE5B,cAAc,mBAAmB,CAAC;AAGlC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAG3B,cAAc,0BAA0B,CAAC;AAGzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2CAA2C,CAAC;AAG1D,cAAc,oCAAoC,CAAC;AAGnD,cAAc,qCAAqC,CAAC;AACpD,cAAc,yBAAyB,CAAC;AAGxC,cAAc,qBAAqB,CAAC;AAGpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAElE,OAAO,EACN,qBAAqB,EACrB,sBAAsB,EACtB,kBAAkB,EAClB,yBAAyB,EACzB,iBAAiB,GACjB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAG/F,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAGlE,OAAO,EACN,qCAAqC,EACrC,0BAA0B,GAC1B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,8BAA8B,EAAE,MAA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