@fluidframework/odsp-driver 2.0.0-dev-rc.1.0.0.232845 → 2.0.0-dev-rc.2.0.0.246488

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 (617) hide show
  1. package/.eslintrc.cjs +18 -3
  2. package/{.mocharc.js → .mocharc.cjs} +1 -1
  3. package/CHANGELOG.md +44 -0
  4. package/{api-extractor-esm.json → api-extractor-cjs.json} +5 -1
  5. package/api-extractor-lint.json +1 -1
  6. package/api-extractor.json +1 -1
  7. package/api-report/odsp-driver.api.md +11 -12
  8. package/dist/ReadBufferUtils.d.ts.map +1 -1
  9. package/dist/ReadBufferUtils.js.map +1 -1
  10. package/dist/WriteBufferUtils.d.ts +1 -1
  11. package/dist/WriteBufferUtils.d.ts.map +1 -1
  12. package/dist/WriteBufferUtils.js +12 -12
  13. package/dist/WriteBufferUtils.js.map +1 -1
  14. package/dist/checkUrl.d.ts.map +1 -1
  15. package/dist/checkUrl.js +5 -3
  16. package/dist/checkUrl.js.map +1 -1
  17. package/dist/compactSnapshotParser.d.ts.map +1 -1
  18. package/dist/compactSnapshotParser.js +87 -69
  19. package/dist/compactSnapshotParser.js.map +1 -1
  20. package/dist/compactSnapshotWriter.d.ts.map +1 -1
  21. package/dist/compactSnapshotWriter.js +25 -19
  22. package/dist/compactSnapshotWriter.js.map +1 -1
  23. package/dist/contracts.d.ts +10 -4
  24. package/dist/contracts.d.ts.map +1 -1
  25. package/dist/contracts.js.map +1 -1
  26. package/dist/createFile.d.ts +3 -3
  27. package/dist/createFile.d.ts.map +1 -1
  28. package/dist/createFile.js +30 -27
  29. package/dist/createFile.js.map +1 -1
  30. package/dist/createNewContainerOnExistingFile.d.ts +2 -2
  31. package/dist/createNewContainerOnExistingFile.d.ts.map +1 -1
  32. package/dist/createNewContainerOnExistingFile.js +14 -14
  33. package/dist/createNewContainerOnExistingFile.js.map +1 -1
  34. package/dist/createNewModule.d.ts +2 -2
  35. package/dist/createNewModule.d.ts.map +1 -1
  36. package/dist/createNewModule.js +4 -4
  37. package/dist/createNewModule.js.map +1 -1
  38. package/dist/createNewUtils.d.ts +2 -2
  39. package/dist/createNewUtils.d.ts.map +1 -1
  40. package/dist/createNewUtils.js +12 -8
  41. package/dist/createNewUtils.js.map +1 -1
  42. package/dist/createOdspCreateContainerRequest.d.ts.map +1 -1
  43. package/dist/createOdspCreateContainerRequest.js +6 -2
  44. package/dist/createOdspCreateContainerRequest.js.map +1 -1
  45. package/dist/createOdspUrl.d.ts +1 -1
  46. package/dist/createOdspUrl.d.ts.map +1 -1
  47. package/dist/createOdspUrl.js.map +1 -1
  48. package/dist/epochTracker.d.ts +10 -9
  49. package/dist/epochTracker.d.ts.map +1 -1
  50. package/dist/epochTracker.js +66 -43
  51. package/dist/epochTracker.js.map +1 -1
  52. package/dist/fetchSnapshot.d.ts +11 -8
  53. package/dist/fetchSnapshot.d.ts.map +1 -1
  54. package/dist/fetchSnapshot.js +79 -58
  55. package/dist/fetchSnapshot.js.map +1 -1
  56. package/dist/getFileLink.d.ts.map +1 -1
  57. package/dist/getFileLink.js +24 -17
  58. package/dist/getFileLink.js.map +1 -1
  59. package/dist/getQueryString.d.ts.map +1 -1
  60. package/dist/getQueryString.js +6 -0
  61. package/dist/getQueryString.js.map +1 -1
  62. package/dist/index.d.ts +19 -19
  63. package/dist/index.d.ts.map +1 -1
  64. package/dist/index.js +44 -44
  65. package/dist/index.js.map +1 -1
  66. package/dist/localOdspDriver/localOdspDocumentService.d.ts +1 -1
  67. package/dist/localOdspDriver/localOdspDocumentService.d.ts.map +1 -1
  68. package/dist/localOdspDriver/localOdspDocumentService.js +5 -5
  69. package/dist/localOdspDriver/localOdspDocumentService.js.map +1 -1
  70. package/dist/localOdspDriver/localOdspDocumentServiceFactory.d.ts +8 -6
  71. package/dist/localOdspDriver/localOdspDocumentServiceFactory.d.ts.map +1 -1
  72. package/dist/localOdspDriver/localOdspDocumentServiceFactory.js +10 -9
  73. package/dist/localOdspDriver/localOdspDocumentServiceFactory.js.map +1 -1
  74. package/dist/localOdspDriver/localOdspDocumentStorageManager.d.ts +1 -1
  75. package/dist/localOdspDriver/localOdspDocumentStorageManager.d.ts.map +1 -1
  76. package/dist/localOdspDriver/localOdspDocumentStorageManager.js +6 -6
  77. package/dist/localOdspDriver/localOdspDocumentStorageManager.js.map +1 -1
  78. package/dist/odsp-driver-alpha.d.ts +27 -12
  79. package/dist/odsp-driver-beta.d.ts +1 -2
  80. package/dist/odsp-driver-public.d.ts +1 -2
  81. package/dist/odsp-driver-untrimmed.d.ts +29 -12
  82. package/dist/odspCache.d.ts +3 -3
  83. package/dist/odspCache.d.ts.map +1 -1
  84. package/dist/odspCache.js +3 -4
  85. package/dist/odspCache.js.map +1 -1
  86. package/dist/odspDelayLoadedDeltaStream.d.ts +7 -5
  87. package/dist/odspDelayLoadedDeltaStream.d.ts.map +1 -1
  88. package/dist/odspDelayLoadedDeltaStream.js +41 -28
  89. package/dist/odspDelayLoadedDeltaStream.js.map +1 -1
  90. package/dist/odspDeltaStorageService.d.ts +7 -7
  91. package/dist/odspDeltaStorageService.d.ts.map +1 -1
  92. package/dist/odspDeltaStorageService.js +5 -5
  93. package/dist/odspDeltaStorageService.js.map +1 -1
  94. package/dist/odspDocumentDeltaConnection.d.ts +1 -1
  95. package/dist/odspDocumentDeltaConnection.d.ts.map +1 -1
  96. package/dist/odspDocumentDeltaConnection.js +41 -23
  97. package/dist/odspDocumentDeltaConnection.js.map +1 -1
  98. package/dist/odspDocumentService.d.ts +6 -4
  99. package/dist/odspDocumentService.d.ts.map +1 -1
  100. package/dist/odspDocumentService.js +19 -16
  101. package/dist/odspDocumentService.js.map +1 -1
  102. package/dist/odspDocumentServiceFactory.d.ts +6 -1
  103. package/dist/odspDocumentServiceFactory.d.ts.map +1 -1
  104. package/dist/odspDocumentServiceFactory.js +9 -4
  105. package/dist/odspDocumentServiceFactory.js.map +1 -1
  106. package/dist/odspDocumentServiceFactoryCore.d.ts +4 -4
  107. package/dist/odspDocumentServiceFactoryCore.d.ts.map +1 -1
  108. package/dist/odspDocumentServiceFactoryCore.js +26 -22
  109. package/dist/odspDocumentServiceFactoryCore.js.map +1 -1
  110. package/dist/odspDocumentServiceFactoryWithCodeSplit.d.ts +1 -1
  111. package/dist/odspDocumentServiceFactoryWithCodeSplit.d.ts.map +1 -1
  112. package/dist/odspDocumentServiceFactoryWithCodeSplit.js +2 -2
  113. package/dist/odspDocumentServiceFactoryWithCodeSplit.js.map +1 -1
  114. package/dist/odspDocumentStorageManager.d.ts +15 -9
  115. package/dist/odspDocumentStorageManager.d.ts.map +1 -1
  116. package/dist/odspDocumentStorageManager.js +219 -181
  117. package/dist/odspDocumentStorageManager.js.map +1 -1
  118. package/dist/odspDocumentStorageServiceBase.d.ts +2 -4
  119. package/dist/odspDocumentStorageServiceBase.d.ts.map +1 -1
  120. package/dist/odspDocumentStorageServiceBase.js +32 -29
  121. package/dist/odspDocumentStorageServiceBase.js.map +1 -1
  122. package/dist/odspDriverUrlResolver.d.ts +5 -1
  123. package/dist/odspDriverUrlResolver.d.ts.map +1 -1
  124. package/dist/odspDriverUrlResolver.js +27 -24
  125. package/dist/odspDriverUrlResolver.js.map +1 -1
  126. package/dist/odspDriverUrlResolverForShareLink.d.ts +17 -6
  127. package/dist/odspDriverUrlResolverForShareLink.d.ts.map +1 -1
  128. package/dist/odspDriverUrlResolverForShareLink.js +49 -39
  129. package/dist/odspDriverUrlResolverForShareLink.js.map +1 -1
  130. package/dist/odspError.d.ts +1 -1
  131. package/dist/odspError.d.ts.map +1 -1
  132. package/dist/odspError.js +5 -5
  133. package/dist/odspError.js.map +1 -1
  134. package/dist/odspFluidFileLink.d.ts +1 -1
  135. package/dist/odspFluidFileLink.d.ts.map +1 -1
  136. package/dist/odspFluidFileLink.js +2 -2
  137. package/dist/odspFluidFileLink.js.map +1 -1
  138. package/dist/odspLocationRedirection.js +2 -2
  139. package/dist/odspLocationRedirection.js.map +1 -1
  140. package/dist/odspPublicUtils.d.ts +3 -0
  141. package/dist/odspPublicUtils.d.ts.map +1 -1
  142. package/dist/odspPublicUtils.js +3 -0
  143. package/dist/odspPublicUtils.js.map +1 -1
  144. package/dist/odspSnapshotParser.d.ts +1 -1
  145. package/dist/odspSnapshotParser.d.ts.map +1 -1
  146. package/dist/odspSnapshotParser.js +3 -2
  147. package/dist/odspSnapshotParser.js.map +1 -1
  148. package/dist/odspSummaryUploadManager.d.ts +1 -1
  149. package/dist/odspSummaryUploadManager.d.ts.map +1 -1
  150. package/dist/odspSummaryUploadManager.js +9 -6
  151. package/dist/odspSummaryUploadManager.js.map +1 -1
  152. package/dist/odspUrlHelper.d.ts.map +1 -1
  153. package/dist/odspUrlHelper.js +1 -2
  154. package/dist/odspUrlHelper.js.map +1 -1
  155. package/dist/odspUtils.d.ts +19 -7
  156. package/dist/odspUtils.d.ts.map +1 -1
  157. package/dist/odspUtils.js +61 -31
  158. package/dist/odspUtils.js.map +1 -1
  159. package/dist/opsCaching.d.ts +1 -1
  160. package/dist/opsCaching.d.ts.map +1 -1
  161. package/dist/opsCaching.js +2 -1
  162. package/dist/opsCaching.js.map +1 -1
  163. package/dist/package.json +3 -0
  164. package/dist/packageVersion.d.ts +1 -1
  165. package/dist/packageVersion.js +1 -1
  166. package/dist/packageVersion.js.map +1 -1
  167. package/dist/prefetchLatestSnapshot.d.ts +2 -2
  168. package/dist/prefetchLatestSnapshot.d.ts.map +1 -1
  169. package/dist/prefetchLatestSnapshot.js +17 -12
  170. package/dist/prefetchLatestSnapshot.js.map +1 -1
  171. package/dist/retryErrorsStorageAdapter.d.ts +0 -1
  172. package/dist/retryErrorsStorageAdapter.d.ts.map +1 -1
  173. package/dist/retryErrorsStorageAdapter.js +2 -5
  174. package/dist/retryErrorsStorageAdapter.js.map +1 -1
  175. package/dist/retryUtils.d.ts.map +1 -1
  176. package/dist/retryUtils.js +6 -2
  177. package/dist/retryUtils.js.map +1 -1
  178. package/dist/socketModule.d.ts.map +1 -1
  179. package/dist/socketModule.js +2 -0
  180. package/dist/socketModule.js.map +1 -1
  181. package/dist/tsdoc-metadata.json +1 -1
  182. package/dist/vroom.d.ts +2 -2
  183. package/dist/vroom.d.ts.map +1 -1
  184. package/dist/vroom.js +5 -5
  185. package/dist/vroom.js.map +1 -1
  186. package/dist/zipItDataRepresentationUtils.d.ts +1 -1
  187. package/dist/zipItDataRepresentationUtils.d.ts.map +1 -1
  188. package/dist/zipItDataRepresentationUtils.js +15 -11
  189. package/dist/zipItDataRepresentationUtils.js.map +1 -1
  190. package/lib/{ReadBufferUtils.d.mts → ReadBufferUtils.d.ts} +1 -1
  191. package/lib/ReadBufferUtils.d.ts.map +1 -0
  192. package/lib/{ReadBufferUtils.mjs → ReadBufferUtils.js} +1 -1
  193. package/lib/ReadBufferUtils.js.map +1 -0
  194. package/lib/{WriteBufferUtils.d.mts → WriteBufferUtils.d.ts} +2 -2
  195. package/lib/WriteBufferUtils.d.ts.map +1 -0
  196. package/lib/{WriteBufferUtils.mjs → WriteBufferUtils.js} +2 -2
  197. package/lib/WriteBufferUtils.js.map +1 -0
  198. package/lib/{checkUrl.d.mts → checkUrl.d.ts} +1 -1
  199. package/lib/checkUrl.d.ts.map +1 -0
  200. package/lib/{checkUrl.mjs → checkUrl.js} +5 -3
  201. package/lib/checkUrl.js.map +1 -0
  202. package/lib/{compactSnapshotParser.d.mts → compactSnapshotParser.d.ts} +1 -1
  203. package/lib/compactSnapshotParser.d.ts.map +1 -0
  204. package/lib/{compactSnapshotParser.mjs → compactSnapshotParser.js} +61 -43
  205. package/lib/compactSnapshotParser.js.map +1 -0
  206. package/lib/{compactSnapshotWriter.d.mts → compactSnapshotWriter.d.ts} +1 -1
  207. package/lib/compactSnapshotWriter.d.ts.map +1 -0
  208. package/lib/{compactSnapshotWriter.mjs → compactSnapshotWriter.js} +13 -7
  209. package/lib/compactSnapshotWriter.js.map +1 -0
  210. package/lib/{constants.d.mts → constants.d.ts} +1 -1
  211. package/lib/constants.d.ts.map +1 -0
  212. package/lib/{constants.mjs → constants.js} +1 -1
  213. package/lib/constants.js.map +1 -0
  214. package/lib/{contracts.d.mts → contracts.d.ts} +11 -5
  215. package/lib/contracts.d.ts.map +1 -0
  216. package/lib/{contracts.mjs → contracts.js} +1 -1
  217. package/lib/contracts.js.map +1 -0
  218. package/lib/{contractsPublic.d.mts → contractsPublic.d.ts} +1 -1
  219. package/lib/contractsPublic.d.ts.map +1 -0
  220. package/lib/{contractsPublic.mjs → contractsPublic.js} +1 -1
  221. package/lib/contractsPublic.js.map +1 -0
  222. package/lib/{createFile.d.mts → createFile.d.ts} +4 -4
  223. package/lib/createFile.d.ts.map +1 -0
  224. package/lib/{createFile.mjs → createFile.js} +15 -12
  225. package/lib/createFile.js.map +1 -0
  226. package/lib/{createNewContainerOnExistingFile.d.mts → createNewContainerOnExistingFile.d.ts} +3 -3
  227. package/lib/createNewContainerOnExistingFile.d.ts.map +1 -0
  228. package/lib/{createNewContainerOnExistingFile.mjs → createNewContainerOnExistingFile.js} +7 -7
  229. package/lib/createNewContainerOnExistingFile.js.map +1 -0
  230. package/lib/{createNewModule.mjs → createNewModule.d.ts} +3 -3
  231. package/lib/createNewModule.d.ts.map +1 -0
  232. package/lib/{createNewModule.d.mts → createNewModule.js} +3 -3
  233. package/lib/createNewModule.js.map +1 -0
  234. package/lib/{createNewUtils.d.mts → createNewUtils.d.ts} +3 -3
  235. package/lib/createNewUtils.d.ts.map +1 -0
  236. package/lib/{createNewUtils.mjs → createNewUtils.js} +9 -5
  237. package/lib/createNewUtils.js.map +1 -0
  238. package/lib/{createOdspCreateContainerRequest.d.mts → createOdspCreateContainerRequest.d.ts} +5 -1
  239. package/lib/createOdspCreateContainerRequest.d.ts.map +1 -0
  240. package/lib/{createOdspCreateContainerRequest.mjs → createOdspCreateContainerRequest.js} +6 -2
  241. package/lib/createOdspCreateContainerRequest.js.map +1 -0
  242. package/lib/{createOdspUrl.d.mts → createOdspUrl.d.ts} +2 -2
  243. package/lib/createOdspUrl.d.ts.map +1 -0
  244. package/lib/{createOdspUrl.mjs → createOdspUrl.js} +1 -1
  245. package/lib/createOdspUrl.js.map +1 -0
  246. package/lib/{epochTracker.d.mts → epochTracker.d.ts} +11 -10
  247. package/lib/epochTracker.d.ts.map +1 -0
  248. package/lib/{epochTracker.mjs → epochTracker.js} +56 -33
  249. package/lib/epochTracker.js.map +1 -0
  250. package/lib/{fetch.d.mts → fetch.d.ts} +1 -1
  251. package/lib/fetch.d.ts.map +1 -0
  252. package/lib/{fetch.mjs → fetch.js} +1 -1
  253. package/lib/fetch.js.map +1 -0
  254. package/lib/{fetchSnapshot.d.mts → fetchSnapshot.d.ts} +12 -9
  255. package/lib/fetchSnapshot.d.ts.map +1 -0
  256. package/lib/{fetchSnapshot.mjs → fetchSnapshot.js} +61 -40
  257. package/lib/fetchSnapshot.js.map +1 -0
  258. package/lib/{getFileLink.d.mts → getFileLink.d.ts} +1 -1
  259. package/lib/getFileLink.d.ts.map +1 -0
  260. package/lib/{getFileLink.mjs → getFileLink.js} +14 -7
  261. package/lib/getFileLink.js.map +1 -0
  262. package/lib/{getQueryString.d.mts → getQueryString.d.ts} +5 -1
  263. package/lib/getQueryString.d.ts.map +1 -0
  264. package/lib/{getQueryString.mjs → getQueryString.js} +7 -1
  265. package/lib/getQueryString.js.map +1 -0
  266. package/lib/{getUrlAndHeadersWithAuth.d.mts → getUrlAndHeadersWithAuth.d.ts} +1 -1
  267. package/lib/getUrlAndHeadersWithAuth.d.ts.map +1 -0
  268. package/lib/{getUrlAndHeadersWithAuth.mjs → getUrlAndHeadersWithAuth.js} +1 -1
  269. package/lib/getUrlAndHeadersWithAuth.js.map +1 -0
  270. package/lib/{index.d.mts → index.d.ts} +20 -20
  271. package/lib/index.d.ts.map +1 -0
  272. package/lib/index.js +29 -0
  273. package/lib/index.js.map +1 -0
  274. package/lib/localOdspDriver/{localOdspDeltaStorageService.d.mts → localOdspDeltaStorageService.d.ts} +1 -1
  275. package/lib/localOdspDriver/localOdspDeltaStorageService.d.ts.map +1 -0
  276. package/lib/localOdspDriver/{localOdspDeltaStorageService.mjs → localOdspDeltaStorageService.js} +1 -1
  277. package/lib/localOdspDriver/localOdspDeltaStorageService.js.map +1 -0
  278. package/lib/localOdspDriver/{localOdspDocumentService.d.mts → localOdspDocumentService.d.ts} +2 -2
  279. package/lib/localOdspDriver/localOdspDocumentService.d.ts.map +1 -0
  280. package/lib/localOdspDriver/{localOdspDocumentService.mjs → localOdspDocumentService.js} +4 -4
  281. package/lib/localOdspDriver/localOdspDocumentService.js.map +1 -0
  282. package/lib/localOdspDriver/{localOdspDocumentServiceFactory.d.mts → localOdspDocumentServiceFactory.d.ts} +9 -7
  283. package/lib/localOdspDriver/localOdspDocumentServiceFactory.d.ts.map +1 -0
  284. package/lib/localOdspDriver/{localOdspDocumentServiceFactory.mjs → localOdspDocumentServiceFactory.js} +9 -8
  285. package/lib/localOdspDriver/localOdspDocumentServiceFactory.js.map +1 -0
  286. package/lib/localOdspDriver/{localOdspDocumentStorageManager.d.mts → localOdspDocumentStorageManager.d.ts} +2 -2
  287. package/lib/localOdspDriver/localOdspDocumentStorageManager.d.ts.map +1 -0
  288. package/lib/localOdspDriver/{localOdspDocumentStorageManager.mjs → localOdspDocumentStorageManager.js} +4 -4
  289. package/lib/localOdspDriver/localOdspDocumentStorageManager.js.map +1 -0
  290. package/lib/{odsp-driver-alpha.d.mts → odsp-driver-alpha.d.ts} +27 -12
  291. package/lib/{odsp-driver-public.d.mts → odsp-driver-beta.d.ts} +1 -2
  292. package/lib/{odsp-driver-beta.d.mts → odsp-driver-public.d.ts} +1 -2
  293. package/lib/{odsp-driver-untrimmed.d.mts → odsp-driver-untrimmed.d.ts} +29 -12
  294. package/lib/{odspCache.d.mts → odspCache.d.ts} +8 -4
  295. package/lib/odspCache.d.ts.map +1 -0
  296. package/lib/{odspCache.mjs → odspCache.js} +6 -3
  297. package/lib/odspCache.js.map +1 -0
  298. package/lib/{odspDelayLoadedDeltaStream.d.mts → odspDelayLoadedDeltaStream.d.ts} +8 -6
  299. package/lib/odspDelayLoadedDeltaStream.d.ts.map +1 -0
  300. package/lib/{odspDelayLoadedDeltaStream.mjs → odspDelayLoadedDeltaStream.js} +33 -20
  301. package/lib/odspDelayLoadedDeltaStream.js.map +1 -0
  302. package/lib/{odspDeltaStorageService.d.mts → odspDeltaStorageService.d.ts} +8 -8
  303. package/lib/odspDeltaStorageService.d.ts.map +1 -0
  304. package/lib/{odspDeltaStorageService.mjs → odspDeltaStorageService.js} +5 -5
  305. package/lib/odspDeltaStorageService.js.map +1 -0
  306. package/lib/{odspDocumentDeltaConnection.d.mts → odspDocumentDeltaConnection.d.ts} +2 -2
  307. package/lib/odspDocumentDeltaConnection.d.ts.map +1 -0
  308. package/lib/{odspDocumentDeltaConnection.mjs → odspDocumentDeltaConnection.js} +34 -16
  309. package/lib/odspDocumentDeltaConnection.js.map +1 -0
  310. package/lib/{odspDocumentService.d.mts → odspDocumentService.d.ts} +7 -5
  311. package/lib/odspDocumentService.d.ts.map +1 -0
  312. package/lib/{odspDocumentService.mjs → odspDocumentService.js} +16 -11
  313. package/lib/odspDocumentService.js.map +1 -0
  314. package/lib/{odspDocumentServiceFactory.d.mts → odspDocumentServiceFactory.d.ts} +7 -2
  315. package/lib/odspDocumentServiceFactory.d.ts.map +1 -0
  316. package/lib/{odspDocumentServiceFactory.mjs → odspDocumentServiceFactory.js} +9 -3
  317. package/lib/odspDocumentServiceFactory.js.map +1 -0
  318. package/lib/{odspDocumentServiceFactoryCore.d.mts → odspDocumentServiceFactoryCore.d.ts} +5 -5
  319. package/lib/odspDocumentServiceFactoryCore.d.ts.map +1 -0
  320. package/lib/{odspDocumentServiceFactoryCore.mjs → odspDocumentServiceFactoryCore.js} +23 -17
  321. package/lib/odspDocumentServiceFactoryCore.js.map +1 -0
  322. package/lib/{odspDocumentServiceFactoryWithCodeSplit.d.mts → odspDocumentServiceFactoryWithCodeSplit.d.ts} +2 -2
  323. package/lib/odspDocumentServiceFactoryWithCodeSplit.d.ts.map +1 -0
  324. package/lib/{odspDocumentServiceFactoryWithCodeSplit.mjs → odspDocumentServiceFactoryWithCodeSplit.js} +2 -2
  325. package/lib/odspDocumentServiceFactoryWithCodeSplit.js.map +1 -0
  326. package/lib/{odspDocumentStorageManager.d.mts → odspDocumentStorageManager.d.ts} +16 -10
  327. package/lib/odspDocumentStorageManager.d.ts.map +1 -0
  328. package/lib/{odspDocumentStorageManager.mjs → odspDocumentStorageManager.js} +207 -167
  329. package/lib/odspDocumentStorageManager.js.map +1 -0
  330. package/lib/{odspDocumentStorageServiceBase.d.mts → odspDocumentStorageServiceBase.d.ts} +3 -5
  331. package/lib/odspDocumentStorageServiceBase.d.ts.map +1 -0
  332. package/lib/{odspDocumentStorageServiceBase.mjs → odspDocumentStorageServiceBase.js} +32 -29
  333. package/lib/odspDocumentStorageServiceBase.js.map +1 -0
  334. package/lib/{odspDriverUrlResolver.d.mts → odspDriverUrlResolver.d.ts} +6 -2
  335. package/lib/odspDriverUrlResolver.d.ts.map +1 -0
  336. package/lib/{odspDriverUrlResolver.mjs → odspDriverUrlResolver.js} +24 -17
  337. package/lib/odspDriverUrlResolver.js.map +1 -0
  338. package/lib/{odspDriverUrlResolverForShareLink.d.mts → odspDriverUrlResolverForShareLink.d.ts} +18 -7
  339. package/lib/odspDriverUrlResolverForShareLink.d.ts.map +1 -0
  340. package/lib/{odspDriverUrlResolverForShareLink.mjs → odspDriverUrlResolverForShareLink.js} +41 -27
  341. package/lib/odspDriverUrlResolverForShareLink.js.map +1 -0
  342. package/lib/{odspError.d.mts → odspError.d.ts} +2 -2
  343. package/lib/odspError.d.ts.map +1 -0
  344. package/lib/{odspError.mjs → odspError.js} +4 -4
  345. package/lib/odspError.js.map +1 -0
  346. package/lib/{odspFluidFileLink.d.mts → odspFluidFileLink.d.ts} +2 -2
  347. package/lib/odspFluidFileLink.d.ts.map +1 -0
  348. package/lib/{odspFluidFileLink.mjs → odspFluidFileLink.js} +2 -2
  349. package/lib/odspFluidFileLink.js.map +1 -0
  350. package/lib/{odspLocationRedirection.d.mts → odspLocationRedirection.d.ts} +1 -1
  351. package/lib/odspLocationRedirection.d.ts.map +1 -0
  352. package/lib/{odspLocationRedirection.mjs → odspLocationRedirection.js} +2 -2
  353. package/lib/odspLocationRedirection.js.map +1 -0
  354. package/lib/{odspPublicUtils.d.mts → odspPublicUtils.d.ts} +4 -1
  355. package/lib/odspPublicUtils.d.ts.map +1 -0
  356. package/lib/{odspPublicUtils.mjs → odspPublicUtils.js} +4 -1
  357. package/lib/odspPublicUtils.js.map +1 -0
  358. package/lib/{odspSnapshotParser.d.mts → odspSnapshotParser.d.ts} +2 -2
  359. package/lib/odspSnapshotParser.d.ts.map +1 -0
  360. package/lib/{odspSnapshotParser.mjs → odspSnapshotParser.js} +4 -3
  361. package/lib/odspSnapshotParser.js.map +1 -0
  362. package/lib/{odspSummaryUploadManager.d.mts → odspSummaryUploadManager.d.ts} +2 -2
  363. package/lib/odspSummaryUploadManager.d.ts.map +1 -0
  364. package/lib/{odspSummaryUploadManager.mjs → odspSummaryUploadManager.js} +8 -5
  365. package/lib/odspSummaryUploadManager.js.map +1 -0
  366. package/lib/{odspUrlHelper.d.mts → odspUrlHelper.d.ts} +1 -1
  367. package/lib/odspUrlHelper.d.ts.map +1 -0
  368. package/lib/{odspUrlHelper.mjs → odspUrlHelper.js} +2 -3
  369. package/lib/odspUrlHelper.js.map +1 -0
  370. package/lib/{odspUtils.d.mts → odspUtils.d.ts} +20 -8
  371. package/lib/odspUtils.d.ts.map +1 -0
  372. package/lib/{odspUtils.mjs → odspUtils.js} +45 -17
  373. package/lib/odspUtils.js.map +1 -0
  374. package/lib/{opsCaching.d.mts → opsCaching.d.ts} +2 -2
  375. package/lib/opsCaching.d.ts.map +1 -0
  376. package/lib/{opsCaching.mjs → opsCaching.js} +3 -2
  377. package/lib/opsCaching.js.map +1 -0
  378. package/lib/{packageVersion.d.mts → packageVersion.d.ts} +2 -2
  379. package/lib/packageVersion.d.ts.map +1 -0
  380. package/lib/{packageVersion.mjs → packageVersion.js} +2 -2
  381. package/lib/packageVersion.js.map +1 -0
  382. package/lib/{prefetchLatestSnapshot.d.mts → prefetchLatestSnapshot.d.ts} +3 -3
  383. package/lib/prefetchLatestSnapshot.d.ts.map +1 -0
  384. package/lib/{prefetchLatestSnapshot.mjs → prefetchLatestSnapshot.js} +16 -11
  385. package/lib/prefetchLatestSnapshot.js.map +1 -0
  386. package/lib/{retryErrorsStorageAdapter.d.mts → retryErrorsStorageAdapter.d.ts} +1 -2
  387. package/lib/retryErrorsStorageAdapter.d.ts.map +1 -0
  388. package/lib/{retryErrorsStorageAdapter.mjs → retryErrorsStorageAdapter.js} +2 -5
  389. package/lib/retryErrorsStorageAdapter.js.map +1 -0
  390. package/lib/{retryUtils.d.mts → retryUtils.d.ts} +1 -1
  391. package/lib/retryUtils.d.ts.map +1 -0
  392. package/lib/{retryUtils.mjs → retryUtils.js} +6 -2
  393. package/lib/retryUtils.js.map +1 -0
  394. package/lib/{socketModule.d.mts → socketModule.d.ts} +1 -1
  395. package/lib/socketModule.d.ts.map +1 -0
  396. package/lib/{socketModule.mjs → socketModule.js} +3 -1
  397. package/lib/socketModule.js.map +1 -0
  398. package/lib/test/buildOdspShareLinkReqParams.spec.js +25 -0
  399. package/lib/test/buildOdspShareLinkReqParams.spec.js.map +1 -0
  400. package/lib/test/createNewUtilsTests.spec.js +221 -0
  401. package/lib/test/createNewUtilsTests.spec.js.map +1 -0
  402. package/lib/test/deltaStorageService.spec.js +176 -0
  403. package/lib/test/deltaStorageService.spec.js.map +1 -0
  404. package/lib/test/epochTests.spec.js +340 -0
  405. package/lib/test/epochTests.spec.js.map +1 -0
  406. package/lib/test/epochTestsWithRedemption.spec.js +119 -0
  407. package/lib/test/epochTestsWithRedemption.spec.js.map +1 -0
  408. package/lib/test/fetchSnapshot.spec.js +412 -0
  409. package/lib/test/fetchSnapshot.spec.js.map +1 -0
  410. package/lib/test/getFileLink.spec.js +62 -0
  411. package/lib/test/getFileLink.spec.js.map +1 -0
  412. package/lib/test/getUrlAndHeadersWithAuth.spec.js +66 -0
  413. package/lib/test/getUrlAndHeadersWithAuth.spec.js.map +1 -0
  414. package/lib/test/getVersions.spec.js +284 -0
  415. package/lib/test/getVersions.spec.js.map +1 -0
  416. package/lib/test/joinSessionCacheTests.spec.js +53 -0
  417. package/lib/test/joinSessionCacheTests.spec.js.map +1 -0
  418. package/lib/test/joinSessionPeriodicCall.spec.js +158 -0
  419. package/lib/test/joinSessionPeriodicCall.spec.js.map +1 -0
  420. package/lib/test/jsonSnapshotFormatTests.spec.js +107 -0
  421. package/lib/test/jsonSnapshotFormatTests.spec.js.map +1 -0
  422. package/lib/test/localOdspDriver.spec.js +177 -0
  423. package/lib/test/localOdspDriver.spec.js.map +1 -0
  424. package/lib/test/mockFetch.js +61 -0
  425. package/lib/test/mockFetch.js.map +1 -0
  426. package/lib/test/odspCreateContainer.spec.js +116 -0
  427. package/lib/test/odspCreateContainer.spec.js.map +1 -0
  428. package/lib/test/odspDriverResolverTest.spec.js +289 -0
  429. package/lib/test/odspDriverResolverTest.spec.js.map +1 -0
  430. package/lib/test/odspDriverUrlResolverForShareLink.spec.js +287 -0
  431. package/lib/test/odspDriverUrlResolverForShareLink.spec.js.map +1 -0
  432. package/lib/test/odspError.spec.js +299 -0
  433. package/lib/test/odspError.spec.js.map +1 -0
  434. package/lib/test/opsCaching.spec.js +357 -0
  435. package/lib/test/opsCaching.spec.js.map +1 -0
  436. package/lib/test/prefetchSnapshotTests.spec.js +420 -0
  437. package/lib/test/prefetchSnapshotTests.spec.js.map +1 -0
  438. package/lib/test/snapshotFormatTests.spec.js +218 -0
  439. package/lib/test/snapshotFormatTests.spec.js.map +1 -0
  440. package/lib/test/socketTests/deltaConnectionUpdateTests.spec.js +152 -0
  441. package/lib/test/socketTests/deltaConnectionUpdateTests.spec.js.map +1 -0
  442. package/lib/test/socketTests/socketMock.js +109 -0
  443. package/lib/test/socketTests/socketMock.js.map +1 -0
  444. package/lib/test/socketTests/socketTests.spec.js +256 -0
  445. package/lib/test/socketTests/socketTests.spec.js.map +1 -0
  446. package/lib/test/tokenFetch.spec.js +39 -0
  447. package/lib/test/tokenFetch.spec.js.map +1 -0
  448. package/lib/test/types/validateOdspDriverPrevious.generated.js +96 -0
  449. package/lib/test/types/validateOdspDriverPrevious.generated.js.map +1 -0
  450. package/lib/test/zipItDataRepresentationTests.spec.js +207 -0
  451. package/lib/test/zipItDataRepresentationTests.spec.js.map +1 -0
  452. package/lib/{vroom.d.mts → vroom.d.ts} +3 -3
  453. package/lib/vroom.d.ts.map +1 -0
  454. package/lib/{vroom.mjs → vroom.js} +4 -4
  455. package/lib/vroom.js.map +1 -0
  456. package/lib/{zipItDataRepresentationUtils.d.mts → zipItDataRepresentationUtils.d.ts} +2 -2
  457. package/lib/zipItDataRepresentationUtils.d.ts.map +1 -0
  458. package/lib/{zipItDataRepresentationUtils.mjs → zipItDataRepresentationUtils.js} +17 -9
  459. package/lib/zipItDataRepresentationUtils.js.map +1 -0
  460. package/package.json +90 -31
  461. package/src/ReadBufferUtils.ts +7 -7
  462. package/src/WriteBufferUtils.ts +13 -9
  463. package/src/checkUrl.ts +4 -2
  464. package/src/compactSnapshotParser.ts +87 -52
  465. package/src/compactSnapshotWriter.ts +19 -12
  466. package/src/contracts.ts +16 -4
  467. package/src/createFile.ts +16 -13
  468. package/src/createNewContainerOnExistingFile.ts +8 -8
  469. package/src/createNewModule.ts +2 -2
  470. package/src/createNewUtils.ts +19 -9
  471. package/src/createOdspCreateContainerRequest.ts +2 -1
  472. package/src/createOdspUrl.ts +1 -1
  473. package/src/epochTracker.ts +90 -55
  474. package/src/fetchSnapshot.ts +104 -47
  475. package/src/getFileLink.ts +21 -13
  476. package/src/getQueryString.ts +3 -0
  477. package/src/index.ts +27 -19
  478. package/src/localOdspDriver/localOdspDocumentService.ts +3 -3
  479. package/src/localOdspDriver/localOdspDocumentServiceFactory.ts +12 -11
  480. package/src/localOdspDriver/localOdspDocumentStorageManager.ts +5 -5
  481. package/src/odspCache.ts +13 -9
  482. package/src/odspDelayLoadedDeltaStream.ts +54 -33
  483. package/src/odspDeltaStorageService.ts +17 -16
  484. package/src/odspDocumentDeltaConnection.ts +52 -34
  485. package/src/odspDocumentService.ts +23 -20
  486. package/src/odspDocumentServiceFactory.ts +7 -2
  487. package/src/odspDocumentServiceFactoryCore.ts +25 -18
  488. package/src/odspDocumentServiceFactoryWithCodeSplit.ts +1 -1
  489. package/src/odspDocumentStorageManager.ts +276 -216
  490. package/src/odspDocumentStorageServiceBase.ts +45 -43
  491. package/src/odspDriverUrlResolver.ts +39 -24
  492. package/src/odspDriverUrlResolverForShareLink.ts +51 -31
  493. package/src/odspError.ts +4 -4
  494. package/src/odspFluidFileLink.ts +3 -3
  495. package/src/odspLocationRedirection.ts +1 -1
  496. package/src/odspPublicUtils.ts +3 -0
  497. package/src/odspSnapshotParser.ts +4 -3
  498. package/src/odspSummaryUploadManager.ts +21 -9
  499. package/src/odspUrlHelper.ts +2 -3
  500. package/src/odspUtils.ts +73 -30
  501. package/src/opsCaching.ts +13 -12
  502. package/src/packageVersion.ts +1 -1
  503. package/src/prefetchLatestSnapshot.ts +24 -15
  504. package/src/retryErrorsStorageAdapter.ts +4 -8
  505. package/src/retryUtils.ts +6 -2
  506. package/src/socketModule.ts +2 -0
  507. package/src/vroom.ts +6 -6
  508. package/src/zipItDataRepresentationUtils.ts +63 -35
  509. package/tsconfig.cjs.json +7 -0
  510. package/tsconfig.json +2 -5
  511. package/lib/ReadBufferUtils.d.mts.map +0 -1
  512. package/lib/ReadBufferUtils.mjs.map +0 -1
  513. package/lib/WriteBufferUtils.d.mts.map +0 -1
  514. package/lib/WriteBufferUtils.mjs.map +0 -1
  515. package/lib/checkUrl.d.mts.map +0 -1
  516. package/lib/checkUrl.mjs.map +0 -1
  517. package/lib/compactSnapshotParser.d.mts.map +0 -1
  518. package/lib/compactSnapshotParser.mjs.map +0 -1
  519. package/lib/compactSnapshotWriter.d.mts.map +0 -1
  520. package/lib/compactSnapshotWriter.mjs.map +0 -1
  521. package/lib/constants.d.mts.map +0 -1
  522. package/lib/constants.mjs.map +0 -1
  523. package/lib/contracts.d.mts.map +0 -1
  524. package/lib/contracts.mjs.map +0 -1
  525. package/lib/contractsPublic.d.mts.map +0 -1
  526. package/lib/contractsPublic.mjs.map +0 -1
  527. package/lib/createFile.d.mts.map +0 -1
  528. package/lib/createFile.mjs.map +0 -1
  529. package/lib/createNewContainerOnExistingFile.d.mts.map +0 -1
  530. package/lib/createNewContainerOnExistingFile.mjs.map +0 -1
  531. package/lib/createNewModule.d.mts.map +0 -1
  532. package/lib/createNewModule.mjs.map +0 -1
  533. package/lib/createNewUtils.d.mts.map +0 -1
  534. package/lib/createNewUtils.mjs.map +0 -1
  535. package/lib/createOdspCreateContainerRequest.d.mts.map +0 -1
  536. package/lib/createOdspCreateContainerRequest.mjs.map +0 -1
  537. package/lib/createOdspUrl.d.mts.map +0 -1
  538. package/lib/createOdspUrl.mjs.map +0 -1
  539. package/lib/epochTracker.d.mts.map +0 -1
  540. package/lib/epochTracker.mjs.map +0 -1
  541. package/lib/fetch.d.mts.map +0 -1
  542. package/lib/fetch.mjs.map +0 -1
  543. package/lib/fetchSnapshot.d.mts.map +0 -1
  544. package/lib/fetchSnapshot.mjs.map +0 -1
  545. package/lib/getFileLink.d.mts.map +0 -1
  546. package/lib/getFileLink.mjs.map +0 -1
  547. package/lib/getQueryString.d.mts.map +0 -1
  548. package/lib/getQueryString.mjs.map +0 -1
  549. package/lib/getUrlAndHeadersWithAuth.d.mts.map +0 -1
  550. package/lib/getUrlAndHeadersWithAuth.mjs.map +0 -1
  551. package/lib/index.d.mts.map +0 -1
  552. package/lib/index.mjs +0 -22
  553. package/lib/index.mjs.map +0 -1
  554. package/lib/localOdspDriver/localOdspDeltaStorageService.d.mts.map +0 -1
  555. package/lib/localOdspDriver/localOdspDeltaStorageService.mjs.map +0 -1
  556. package/lib/localOdspDriver/localOdspDocumentService.d.mts.map +0 -1
  557. package/lib/localOdspDriver/localOdspDocumentService.mjs.map +0 -1
  558. package/lib/localOdspDriver/localOdspDocumentServiceFactory.d.mts.map +0 -1
  559. package/lib/localOdspDriver/localOdspDocumentServiceFactory.mjs.map +0 -1
  560. package/lib/localOdspDriver/localOdspDocumentStorageManager.d.mts.map +0 -1
  561. package/lib/localOdspDriver/localOdspDocumentStorageManager.mjs.map +0 -1
  562. package/lib/odspCache.d.mts.map +0 -1
  563. package/lib/odspCache.mjs.map +0 -1
  564. package/lib/odspDelayLoadedDeltaStream.d.mts.map +0 -1
  565. package/lib/odspDelayLoadedDeltaStream.mjs.map +0 -1
  566. package/lib/odspDeltaStorageService.d.mts.map +0 -1
  567. package/lib/odspDeltaStorageService.mjs.map +0 -1
  568. package/lib/odspDocumentDeltaConnection.d.mts.map +0 -1
  569. package/lib/odspDocumentDeltaConnection.mjs.map +0 -1
  570. package/lib/odspDocumentService.d.mts.map +0 -1
  571. package/lib/odspDocumentService.mjs.map +0 -1
  572. package/lib/odspDocumentServiceFactory.d.mts.map +0 -1
  573. package/lib/odspDocumentServiceFactory.mjs.map +0 -1
  574. package/lib/odspDocumentServiceFactoryCore.d.mts.map +0 -1
  575. package/lib/odspDocumentServiceFactoryCore.mjs.map +0 -1
  576. package/lib/odspDocumentServiceFactoryWithCodeSplit.d.mts.map +0 -1
  577. package/lib/odspDocumentServiceFactoryWithCodeSplit.mjs.map +0 -1
  578. package/lib/odspDocumentStorageManager.d.mts.map +0 -1
  579. package/lib/odspDocumentStorageManager.mjs.map +0 -1
  580. package/lib/odspDocumentStorageServiceBase.d.mts.map +0 -1
  581. package/lib/odspDocumentStorageServiceBase.mjs.map +0 -1
  582. package/lib/odspDriverUrlResolver.d.mts.map +0 -1
  583. package/lib/odspDriverUrlResolver.mjs.map +0 -1
  584. package/lib/odspDriverUrlResolverForShareLink.d.mts.map +0 -1
  585. package/lib/odspDriverUrlResolverForShareLink.mjs.map +0 -1
  586. package/lib/odspError.d.mts.map +0 -1
  587. package/lib/odspError.mjs.map +0 -1
  588. package/lib/odspFluidFileLink.d.mts.map +0 -1
  589. package/lib/odspFluidFileLink.mjs.map +0 -1
  590. package/lib/odspLocationRedirection.d.mts.map +0 -1
  591. package/lib/odspLocationRedirection.mjs.map +0 -1
  592. package/lib/odspPublicUtils.d.mts.map +0 -1
  593. package/lib/odspPublicUtils.mjs.map +0 -1
  594. package/lib/odspSnapshotParser.d.mts.map +0 -1
  595. package/lib/odspSnapshotParser.mjs.map +0 -1
  596. package/lib/odspSummaryUploadManager.d.mts.map +0 -1
  597. package/lib/odspSummaryUploadManager.mjs.map +0 -1
  598. package/lib/odspUrlHelper.d.mts.map +0 -1
  599. package/lib/odspUrlHelper.mjs.map +0 -1
  600. package/lib/odspUtils.d.mts.map +0 -1
  601. package/lib/odspUtils.mjs.map +0 -1
  602. package/lib/opsCaching.d.mts.map +0 -1
  603. package/lib/opsCaching.mjs.map +0 -1
  604. package/lib/packageVersion.d.mts.map +0 -1
  605. package/lib/packageVersion.mjs.map +0 -1
  606. package/lib/prefetchLatestSnapshot.d.mts.map +0 -1
  607. package/lib/prefetchLatestSnapshot.mjs.map +0 -1
  608. package/lib/retryErrorsStorageAdapter.d.mts.map +0 -1
  609. package/lib/retryErrorsStorageAdapter.mjs.map +0 -1
  610. package/lib/retryUtils.d.mts.map +0 -1
  611. package/lib/retryUtils.mjs.map +0 -1
  612. package/lib/socketModule.d.mts.map +0 -1
  613. package/lib/socketModule.mjs.map +0 -1
  614. package/lib/vroom.d.mts.map +0 -1
  615. package/lib/vroom.mjs.map +0 -1
  616. package/lib/zipItDataRepresentationUtils.d.mts.map +0 -1
  617. package/lib/zipItDataRepresentationUtils.mjs.map +0 -1
@@ -34,28 +34,33 @@ import {
34
34
  IDocumentStorageGetVersionsResponse,
35
35
  HostStoragePolicyInternal,
36
36
  IVersionedValueWithEpoch,
37
+ // eslint-disable-next-line import/no-deprecated
37
38
  ISnapshotCachedEntry,
38
39
  ISnapshotCachedEntry2,
39
- } from "./contracts";
40
+ } from "./contracts.js";
40
41
  import {
41
42
  downloadSnapshot,
42
43
  evalBlobsAndTrees,
43
44
  fetchSnapshot,
44
45
  fetchSnapshotWithRedeem,
46
+ ISnapshotRequestAndResponseOptions,
45
47
  SnapshotFormatSupportType,
46
- } from "./fetchSnapshot";
47
- import { getUrlAndHeadersWithAuth } from "./getUrlAndHeadersWithAuth";
48
- import { IOdspCache, IPrefetchSnapshotContents } from "./odspCache";
48
+ } from "./fetchSnapshot.js";
49
+ import { getUrlAndHeadersWithAuth } from "./getUrlAndHeadersWithAuth.js";
50
+ import { IOdspCache, IPrefetchSnapshotContents } from "./odspCache.js";
49
51
  import {
50
52
  createCacheSnapshotKey,
51
53
  getWithRetryForTokenRefresh,
54
+ IOdspResponse,
52
55
  isInstanceOfISnapshot,
53
- } from "./odspUtils";
54
- import { EpochTracker } from "./epochTracker";
55
- import type { OdspSummaryUploadManager } from "./odspSummaryUploadManager";
56
- import { FlushResult } from "./odspDocumentDeltaConnection";
57
- import { pkgVersion as driverVersion } from "./packageVersion";
58
- import { OdspDocumentStorageServiceBase } from "./odspDocumentStorageServiceBase";
56
+ isSnapshotFetchForLoadingGroup,
57
+ useLegacyFlowWithoutGroupsForSnapshotFetch,
58
+ } from "./odspUtils.js";
59
+ import { EpochTracker } from "./epochTracker.js";
60
+ import type { OdspSummaryUploadManager } from "./odspSummaryUploadManager.js";
61
+ import { FlushResult } from "./odspDocumentDeltaConnection.js";
62
+ import { pkgVersion as driverVersion } from "./packageVersion.js";
63
+ import { OdspDocumentStorageServiceBase } from "./odspDocumentStorageServiceBase.js";
59
64
 
60
65
  export const defaultSummarizerCacheExpiryTimeout: number = 60 * 1000; // 60 seconds.
61
66
 
@@ -69,7 +74,7 @@ export class OdspDocumentStorageService extends OdspDocumentStorageServiceBase {
69
74
  private summaryModuleP: Promise<OdspSummaryUploadManager> | undefined;
70
75
  private odspSummaryUploadManager: OdspSummaryUploadManager | undefined;
71
76
 
72
- private firstVersionCall = true;
77
+ private firstSnapshotFetchCall = true;
73
78
  private _isFirstSnapshotFromNetwork: boolean | undefined;
74
79
  private readonly documentId: string;
75
80
  private readonly snapshotUrl: string | undefined;
@@ -107,7 +112,7 @@ export class OdspDocumentStorageService extends OdspDocumentStorageServiceBase {
107
112
  this.attachmentGETUrl = this.odspResolvedUrl.endpoints.attachmentGETStorageUrl;
108
113
  }
109
114
 
110
- public get isFirstSnapshotFromNetwork() {
115
+ public get isFirstSnapshotFromNetwork(): boolean | undefined {
111
116
  return this._isFirstSnapshotFromNetwork;
112
117
  }
113
118
 
@@ -172,7 +177,7 @@ export class OdspDocumentStorageService extends OdspDocumentStorageServiceBase {
172
177
  eventName: "readDataBlob",
173
178
  blobId,
174
179
  evicted,
175
- headers: Object.keys(headers).length !== 0 ? true : undefined,
180
+ headers: Object.keys(headers).length > 0 ? true : undefined,
176
181
  waitQueueLength: this.epochTracker.rateLimiter.waitQueueLength,
177
182
  },
178
183
  async (event) => {
@@ -208,18 +213,231 @@ export class OdspDocumentStorageService extends OdspDocumentStorageServiceBase {
208
213
  // eslint-disable-next-line @rushstack/no-new-null
209
214
  ): Promise<api.ISnapshotTree | null> {
210
215
  if (!this.snapshotUrl) {
216
+ // eslint-disable-next-line unicorn/no-null
211
217
  return null;
212
218
  }
213
219
  return super.getSnapshotTree(version, scenarioName);
214
220
  }
215
221
 
222
+ /**
223
+ * Fetches and returns the snapshot. If no loadingGroupIds or empty loadingGroupIds is provided, then snapshot for all
224
+ * ungrouped data will be provided.
225
+ * @param snapshotFetchOptions - fetch options for snapshot.
226
+ */
216
227
  public async getSnapshot(snapshotFetchOptions?: ISnapshotFetchOptions): Promise<ISnapshot> {
217
- assert(this.hostPolicy.supportGetSnapshotApi !== true, "api should not be called yet");
218
- // This is just temporary as this api is not yet enabled in service policies.
219
- return this.fetchSnapshot(
220
- this.hostPolicy.snapshotOptions,
221
- snapshotFetchOptions?.scenarioName,
228
+ // Don't consult cache if request is not for a particular loading group.
229
+ const { snapshot } = await this.fetchSnapshot({
230
+ ...snapshotFetchOptions,
231
+ fetchSource: isSnapshotFetchForLoadingGroup(snapshotFetchOptions?.loadingGroupIds)
232
+ ? FetchSource.noCache
233
+ : snapshotFetchOptions?.fetchSource,
234
+ loadingGroupIds: snapshotFetchOptions?.loadingGroupIds ?? [],
235
+ });
236
+
237
+ return {
238
+ ...snapshot,
239
+ snapshotTree: this.combineProtocolAndAppSnapshotTree(snapshot.snapshotTree),
240
+ };
241
+ }
242
+
243
+ private async fetchSnapshot(
244
+ snapshotFetchOptions: ISnapshotFetchOptions,
245
+ ): Promise<{ snapshot: ISnapshot; id: string | undefined }> {
246
+ const hostSnapshotOptions = this.hostPolicy.snapshotOptions;
247
+ const odspSnapshotCacheValue: ISnapshot = await PerformanceEvent.timedExecAsync(
248
+ this.logger,
249
+ {
250
+ eventName: isSnapshotFetchForLoadingGroup(snapshotFetchOptions.loadingGroupIds)
251
+ ? "ObtainSnapshotForGroup"
252
+ : "ObtainSnapshot",
253
+ fetchSource: snapshotFetchOptions?.fetchSource,
254
+ },
255
+ async (event: PerformanceEvent) => {
256
+ const props: GetVersionsTelemetryProps = {};
257
+ let cacheLookupTimeInSerialFetch = 0;
258
+ let retrievedSnapshot: ISnapshot | IPrefetchSnapshotContents | undefined;
259
+
260
+ let method: string;
261
+ let prefetchWaitStartTime: number = performance.now();
262
+ if (snapshotFetchOptions.fetchSource === FetchSource.noCache) {
263
+ retrievedSnapshot = await this.fetchSnapshotFromNetwork(
264
+ hostSnapshotOptions,
265
+ snapshotFetchOptions.loadingGroupIds,
266
+ snapshotFetchOptions.scenarioName,
267
+ );
268
+ method = "networkOnly";
269
+ } else {
270
+ // Here's the logic to grab the persistent cache snapshot implemented by the host
271
+ // Epoch tracker is responsible for communicating with the persistent cache, handling epochs and cache versions
272
+ const cachedSnapshotP: Promise<ISnapshot | undefined> = this.epochTracker
273
+ .get(createCacheSnapshotKey(this.odspResolvedUrl))
274
+ .then(
275
+ async (
276
+ // eslint-disable-next-line import/no-deprecated
277
+ snapshotCachedEntry: ISnapshotCachedEntry | ISnapshotCachedEntry2,
278
+ ) => {
279
+ if (snapshotCachedEntry !== undefined) {
280
+ // If the cached entry does not contain the entry time, then assign it a default of 30 days old.
281
+ const age =
282
+ Date.now() -
283
+ (snapshotCachedEntry.cacheEntryTime ??
284
+ Date.now() - 30 * 24 * 60 * 60 * 1000);
285
+
286
+ // In order to decrease the number of times we have to execute a snapshot refresh,
287
+ // if this is the summarizer and we have a cache entry but it is past the defaultSummarizerCacheExpiryTimeout,
288
+ // force the network retrieval instead as there might be a more recent snapshot available.
289
+ // See: https://github.com/microsoft/FluidFramework/issues/8995 for additional information.
290
+ if (this.hostPolicy.summarizerClient) {
291
+ if (age > defaultSummarizerCacheExpiryTimeout) {
292
+ props.cacheSummarizerExpired = true;
293
+ return undefined;
294
+ } else {
295
+ props.cacheSummarizerExpired = false;
296
+ }
297
+ }
298
+
299
+ // Record the cache age
300
+ props.cacheEntryAge = age;
301
+ // Snapshot from cache could be in older format, so transform that before returning.
302
+ if (isInstanceOfISnapshot(snapshotCachedEntry)) {
303
+ return snapshotCachedEntry;
304
+ } else {
305
+ const snapshot: ISnapshot = {
306
+ snapshotTree: snapshotCachedEntry.snapshotTree,
307
+ blobContents: snapshotCachedEntry.blobs,
308
+ ops: snapshotCachedEntry.ops,
309
+ latestSequenceNumber:
310
+ snapshotCachedEntry.latestSequenceNumber,
311
+ sequenceNumber: snapshotCachedEntry.sequenceNumber,
312
+ snapshotFormatV: 1,
313
+ };
314
+ return snapshot;
315
+ }
316
+ }
317
+ },
318
+ );
319
+ // Based on the concurrentSnapshotFetch policy:
320
+ // Either retrieve both the network and cache snapshots concurrently and pick the first to return,
321
+ // or grab the cache value and then the network value if the cache value returns undefined.
322
+ // For summarizer which could call this during refreshing of summary parent, always use the cache
323
+ // first. Also for other clients, if it is not critical path which is determined by firstSnapshotFetchCall,
324
+ // then also check the cache first.
325
+ if (
326
+ this.firstSnapshotFetchCall &&
327
+ this.hostPolicy.concurrentSnapshotFetch &&
328
+ !this.hostPolicy.summarizerClient
329
+ ) {
330
+ const networkSnapshotP = this.fetchSnapshotFromNetwork(
331
+ hostSnapshotOptions,
332
+ snapshotFetchOptions.loadingGroupIds,
333
+ snapshotFetchOptions.scenarioName,
334
+ );
335
+
336
+ // Ensure that failures on both paths are ignored initially.
337
+ // I.e. if cache fails for some reason, we will proceed with network result.
338
+ // And vice versa - if (for example) client is offline and network request fails first, we
339
+ // do want to attempt to succeed with cached data!
340
+ const promiseRaceWinner = await promiseRaceWithWinner([
341
+ cachedSnapshotP.catch(() => undefined),
342
+ networkSnapshotP.catch(() => undefined),
343
+ ]);
344
+ retrievedSnapshot = promiseRaceWinner.value;
345
+ method = promiseRaceWinner.index === 0 ? "cache" : "network";
346
+
347
+ if (retrievedSnapshot === undefined) {
348
+ // if network failed -> wait for cache ( then return network failure)
349
+ // If cache returned empty or failed -> wait for network (success of failure)
350
+ try {
351
+ if (promiseRaceWinner.index === 1) {
352
+ retrievedSnapshot = await cachedSnapshotP;
353
+ method = "cache";
354
+ }
355
+ if (retrievedSnapshot === undefined) {
356
+ retrievedSnapshot = await networkSnapshotP;
357
+ method = "network";
358
+ }
359
+ } catch (error: unknown) {
360
+ // The call stacks of any errors thrown by cached snapshot or network snapshot aren't very useful:
361
+ // they get truncated at this stack frame due to the promise race and how v8 tracks async stack traces--
362
+ // see https://v8.dev/docs/stack-trace-api#async-stack-traces and the "zero-cost async stack traces" document
363
+ // linked there. https://v8.dev/blog/fast-async#await-under-the-hood may also be helpful for context on internals.
364
+ // Regenerating the stack at this level provides more information for logged errors.
365
+ // Once FF uses an ES2021 target, we could convert the above promise race to use `Promise.any` + AggregateError and
366
+ // get similar quality stacks with less hand-crafted code.
367
+ const innerStack = (error as Error).stack;
368
+ const normalizedError = normalizeError(error);
369
+ normalizedError.addTelemetryProperties({ innerStack });
370
+
371
+ const newStack = `<<STACK TRUNCATED: see innerStack property>> \n${generateStack()}`;
372
+ overwriteStack(normalizedError, newStack);
373
+
374
+ throw normalizedError;
375
+ }
376
+ }
377
+ } else {
378
+ // Note: There's a race condition here - another caller may come past the undefined check
379
+ // while the first caller is awaiting later async code in this block.
380
+ const startTime = performance.now();
381
+ retrievedSnapshot = await cachedSnapshotP;
382
+ cacheLookupTimeInSerialFetch = performance.now() - startTime;
383
+ method = retrievedSnapshot === undefined ? "network" : "cache";
384
+
385
+ if (retrievedSnapshot === undefined) {
386
+ prefetchWaitStartTime = performance.now();
387
+ retrievedSnapshot = await this.fetchSnapshotFromNetwork(
388
+ hostSnapshotOptions,
389
+ snapshotFetchOptions.loadingGroupIds,
390
+ snapshotFetchOptions.scenarioName,
391
+ );
392
+ }
393
+ }
394
+ }
395
+ if (method === "network") {
396
+ props.cacheEntryAge = undefined;
397
+ }
398
+ if (this.firstSnapshotFetchCall) {
399
+ this._isFirstSnapshotFromNetwork = method === "cache" ? false : true;
400
+ }
401
+ const prefetchStartTime: number | undefined = (
402
+ retrievedSnapshot as IPrefetchSnapshotContents
403
+ ).prefetchStartTime;
404
+ event.end({
405
+ ...props,
406
+ method,
407
+ fetchSnapshotForInitialLoad: this.firstSnapshotFetchCall,
408
+ useLegacyFlowWithoutGroups: useLegacyFlowWithoutGroupsForSnapshotFetch(
409
+ snapshotFetchOptions.loadingGroupIds,
410
+ ),
411
+ avoidPrefetchSnapshotCache: this.hostPolicy.avoidPrefetchSnapshotCache,
412
+ ...evalBlobsAndTrees(retrievedSnapshot),
413
+ cacheLookupTimeInSerialFetch,
414
+ prefetchSavedDuration:
415
+ prefetchStartTime !== undefined && method !== "cache"
416
+ ? prefetchWaitStartTime - prefetchStartTime
417
+ : undefined,
418
+ });
419
+ return retrievedSnapshot;
420
+ },
421
+ );
422
+
423
+ const stTime = performance.now();
424
+ // Don't override ops which were fetched during initial load, since we could still need them.
425
+ const id = this.initializeFromSnapshot(
426
+ odspSnapshotCacheValue,
427
+ this.firstSnapshotFetchCall,
428
+ snapshotFetchOptions?.cacheSnapshot ?? this.firstSnapshotFetchCall,
222
429
  );
430
+ this.logger.sendTelemetryEvent(
431
+ {
432
+ eventName: "SnapshotInitializeTime",
433
+ duration: performance.now() - stTime,
434
+ },
435
+ undefined,
436
+ LogLevel.verbose,
437
+ );
438
+ this.firstSnapshotFetchCall = false;
439
+
440
+ return { snapshot: odspSnapshotCacheValue, id };
223
441
  }
224
442
 
225
443
  public async getVersions(
@@ -250,185 +468,12 @@ export class OdspDocumentStorageService extends OdspDocumentStorageServiceBase {
250
468
 
251
469
  // If count is one, we can use the trees/latest API, which returns the latest version and trees in a single request for better performance
252
470
  if (count === 1 && (blobid === null || blobid === this.documentId)) {
253
- const hostSnapshotOptions = this.hostPolicy.snapshotOptions;
254
- const odspSnapshotCacheValue: ISnapshot = await PerformanceEvent.timedExecAsync(
255
- this.logger,
256
- { eventName: "ObtainSnapshot", fetchSource },
257
- async (event: PerformanceEvent) => {
258
- const props: GetVersionsTelemetryProps = {};
259
- let cacheLookupTimeInSerialFetch = 0;
260
- let retrievedSnapshot: ISnapshot | IPrefetchSnapshotContents | undefined;
261
-
262
- let method: string;
263
- let prefetchWaitStartTime: number = performance.now();
264
- if (fetchSource === FetchSource.noCache) {
265
- retrievedSnapshot = await this.fetchSnapshot(
266
- hostSnapshotOptions,
267
- scenarioName,
268
- );
269
- method = "networkOnly";
270
- } else {
271
- // Here's the logic to grab the persistent cache snapshot implemented by the host
272
- // Epoch tracker is responsible for communicating with the persistent cache, handling epochs and cache versions
273
- const cachedSnapshotP: Promise<ISnapshot | undefined> = this.epochTracker
274
- .get(createCacheSnapshotKey(this.odspResolvedUrl))
275
- .then(
276
- async (
277
- snapshotCachedEntry:
278
- | ISnapshotCachedEntry
279
- | ISnapshotCachedEntry2,
280
- ) => {
281
- if (snapshotCachedEntry !== undefined) {
282
- // If the cached entry does not contain the entry time, then assign it a default of 30 days old.
283
- const age =
284
- Date.now() -
285
- (snapshotCachedEntry.cacheEntryTime ??
286
- Date.now() - 30 * 24 * 60 * 60 * 1000);
287
-
288
- // In order to decrease the number of times we have to execute a snapshot refresh,
289
- // if this is the summarizer and we have a cache entry but it is past the defaultSummarizerCacheExpiryTimeout,
290
- // force the network retrieval instead as there might be a more recent snapshot available.
291
- // See: https://github.com/microsoft/FluidFramework/issues/8995 for additional information.
292
- if (this.hostPolicy.summarizerClient) {
293
- if (age > defaultSummarizerCacheExpiryTimeout) {
294
- props.cacheSummarizerExpired = true;
295
- return undefined;
296
- } else {
297
- props.cacheSummarizerExpired = false;
298
- }
299
- }
300
-
301
- // Record the cache age
302
- props.cacheEntryAge = age;
303
- // Snapshot from cache could be in older format, so transform that before returning.
304
- if (isInstanceOfISnapshot(snapshotCachedEntry)) {
305
- return snapshotCachedEntry;
306
- } else {
307
- const snapshot: ISnapshot = {
308
- snapshotTree: snapshotCachedEntry.snapshotTree,
309
- blobContents: snapshotCachedEntry.blobs,
310
- ops: snapshotCachedEntry.ops,
311
- latestSequenceNumber:
312
- snapshotCachedEntry.latestSequenceNumber,
313
- sequenceNumber: snapshotCachedEntry.sequenceNumber,
314
- snapshotFormatV: 1,
315
- };
316
- return snapshot;
317
- }
318
- }
319
- },
320
- );
321
- // Based on the concurrentSnapshotFetch policy:
322
- // Either retrieve both the network and cache snapshots concurrently and pick the first to return,
323
- // or grab the cache value and then the network value if the cache value returns undefined.
324
- // For summarizer which could call this during refreshing of summary parent, always use the cache
325
- // first. Also for other clients, if it is not critical path which is determined by firstVersionCall,
326
- // then also check the cache first.
327
- if (
328
- this.firstVersionCall &&
329
- this.hostPolicy.concurrentSnapshotFetch &&
330
- !this.hostPolicy.summarizerClient
331
- ) {
332
- const networkSnapshotP = this.fetchSnapshot(
333
- hostSnapshotOptions,
334
- scenarioName,
335
- );
336
-
337
- // Ensure that failures on both paths are ignored initially.
338
- // I.e. if cache fails for some reason, we will proceed with network result.
339
- // And vice versa - if (for example) client is offline and network request fails first, we
340
- // do want to attempt to succeed with cached data!
341
- const promiseRaceWinner = await promiseRaceWithWinner([
342
- cachedSnapshotP.catch(() => undefined),
343
- networkSnapshotP.catch(() => undefined),
344
- ]);
345
- retrievedSnapshot = promiseRaceWinner.value;
346
- method = promiseRaceWinner.index === 0 ? "cache" : "network";
347
-
348
- if (retrievedSnapshot === undefined) {
349
- // if network failed -> wait for cache ( then return network failure)
350
- // If cache returned empty or failed -> wait for network (success of failure)
351
- try {
352
- if (promiseRaceWinner.index === 1) {
353
- retrievedSnapshot = await cachedSnapshotP;
354
- method = "cache";
355
- }
356
- if (retrievedSnapshot === undefined) {
357
- retrievedSnapshot = await networkSnapshotP;
358
- method = "network";
359
- }
360
- } catch (err: unknown) {
361
- // The call stacks of any errors thrown by cached snapshot or network snapshot aren't very useful:
362
- // they get truncated at this stack frame due to the promise race and how v8 tracks async stack traces--
363
- // see https://v8.dev/docs/stack-trace-api#async-stack-traces and the "zero-cost async stack traces" document
364
- // linked there. https://v8.dev/blog/fast-async#await-under-the-hood may also be helpful for context on internals.
365
- // Regenerating the stack at this level provides more information for logged errors.
366
- // Once FF uses an ES2021 target, we could convert the above promise race to use `Promise.any` + AggregateError and
367
- // get similar quality stacks with less hand-crafted code.
368
- const innerStack = (err as Error).stack;
369
- const normalizedError = normalizeError(err);
370
- normalizedError.addTelemetryProperties({ innerStack });
371
-
372
- const newStack = `<<STACK TRUNCATED: see innerStack property>> \n${generateStack()}`;
373
- overwriteStack(normalizedError, newStack);
374
-
375
- throw normalizedError;
376
- }
377
- }
378
- } else {
379
- // Note: There's a race condition here - another caller may come past the undefined check
380
- // while the first caller is awaiting later async code in this block.
381
- const startTime = performance.now();
382
- retrievedSnapshot = await cachedSnapshotP;
383
- cacheLookupTimeInSerialFetch = performance.now() - startTime;
384
- method = retrievedSnapshot !== undefined ? "cache" : "network";
385
-
386
- if (retrievedSnapshot === undefined) {
387
- prefetchWaitStartTime = performance.now();
388
- retrievedSnapshot = await this.fetchSnapshot(
389
- hostSnapshotOptions,
390
- scenarioName,
391
- );
392
- }
393
- }
394
- }
395
- if (method === "network") {
396
- props.cacheEntryAge = undefined;
397
- }
398
- if (this.firstVersionCall) {
399
- this._isFirstSnapshotFromNetwork = method === "cache" ? false : true;
400
- }
401
- const prefetchStartTime: number | undefined = (
402
- retrievedSnapshot as IPrefetchSnapshotContents
403
- ).prefetchStartTime;
404
- event.end({
405
- ...props,
406
- method,
407
- avoidPrefetchSnapshotCache: this.hostPolicy.avoidPrefetchSnapshotCache,
408
- ...evalBlobsAndTrees(retrievedSnapshot),
409
- cacheLookupTimeInSerialFetch,
410
- prefetchSavedDuration:
411
- prefetchStartTime !== undefined && method !== "cache"
412
- ? prefetchWaitStartTime - prefetchStartTime
413
- : undefined,
414
- });
415
- return retrievedSnapshot;
416
- },
417
- );
418
-
419
- const stTime = performance.now();
420
- // Don't override ops which were fetched during initial load, since we could still need them.
421
- const id = this.initializeFromSnapshot(odspSnapshotCacheValue, this.firstVersionCall);
422
- this.logger.sendTelemetryEvent(
423
- {
424
- eventName: "SnapshotInitializeTime",
425
- duration: performance.now() - stTime,
426
- },
427
- undefined,
428
- LogLevel.verbose,
429
- );
430
- this.firstVersionCall = false;
431
-
471
+ const { id } = await this.fetchSnapshot({
472
+ cacheSnapshot: true,
473
+ scenarioName,
474
+ versionId: blobid ?? undefined,
475
+ fetchSource,
476
+ });
432
477
  return id ? [{ id, treeId: undefined! }] : [];
433
478
  }
434
479
 
@@ -445,7 +490,7 @@ export class OdspDocumentStorageService extends OdspDocumentStorageServiceBase {
445
490
  this.logger,
446
491
  {
447
492
  eventName: "getVersions",
448
- headers: Object.keys(headers).length !== 0 ? true : undefined,
493
+ headers: Object.keys(headers).length > 0 ? true : undefined,
449
494
  },
450
495
  async () =>
451
496
  this.epochTracker.fetchAndParseAsJSON<IDocumentStorageGetVersionsResponse>(
@@ -480,29 +525,37 @@ export class OdspDocumentStorageService extends OdspDocumentStorageServiceBase {
480
525
  });
481
526
  }
482
527
 
483
- private async fetchSnapshot(
528
+ private async fetchSnapshotFromNetwork(
484
529
  hostSnapshotOptions: ISnapshotOptions | undefined,
530
+ loadingGroupIds: string[] | undefined,
485
531
  scenarioName?: string,
486
- ) {
487
- return this.fetchSnapshotCore(hostSnapshotOptions, scenarioName).catch((error) => {
532
+ ): Promise<ISnapshot | IPrefetchSnapshotContents> {
533
+ return this.fetchSnapshotFromNetworkCore(
534
+ hostSnapshotOptions,
535
+ loadingGroupIds,
536
+ scenarioName,
537
+ ).catch((error) => {
488
538
  // Issue #5895:
489
539
  // If we are offline, this error is retryable. But that means that RetriableDocumentStorageService
490
540
  // will run in circles calling getSnapshotTree, which would result in OdspDocumentStorageService class
491
541
  // going getVersions / individual blob download path. This path is very slow, and will not work with
492
542
  // delay-loaded data stores and ODSP storage deleting old snapshots and blobs.
493
543
  if (typeof error === "object" && error !== null) {
544
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
494
545
  error.canRetry = false;
495
546
  }
496
547
  throw error;
497
548
  });
498
549
  }
499
550
 
500
- private async fetchSnapshotCore(
551
+ private async fetchSnapshotFromNetworkCore(
501
552
  hostSnapshotOptions: ISnapshotOptions | undefined,
553
+ loadingGroupIds: string[] | undefined,
502
554
  scenarioName?: string,
503
555
  ): Promise<ISnapshot | IPrefetchSnapshotContents> {
504
- // Don't look into cache, if the host specifically tells us so.
505
- if (!this.hostPolicy.avoidPrefetchSnapshotCache) {
556
+ // Don't look into cache, if the host specifically tells us so. Also, if request is
557
+ // for initial snapshot, don't consult the prefetch cache.
558
+ if (!this.hostPolicy.avoidPrefetchSnapshotCache && this.firstSnapshotFetchCall) {
506
559
  const prefetchCacheKey = getKeyForCacheEntry(
507
560
  createCacheSnapshotKey(this.odspResolvedUrl),
508
561
  );
@@ -515,13 +568,13 @@ export class OdspDocumentStorageService extends OdspDocumentStorageServiceBase {
515
568
  await this.epochTracker.validateEpoch(response.fluidEpoch, "treesLatest");
516
569
  return response;
517
570
  })
518
- .catch(async (err) => {
571
+ .catch(async (error) => {
519
572
  this.logger.sendTelemetryEvent(
520
573
  {
521
574
  eventName: "PrefetchSnapshotError",
522
575
  concurrentSnapshotFetch: this.hostPolicy.concurrentSnapshotFetch,
523
576
  },
524
- err,
577
+ error,
525
578
  );
526
579
  return undefined;
527
580
  });
@@ -548,13 +601,14 @@ export class OdspDocumentStorageService extends OdspDocumentStorageServiceBase {
548
601
  const snapshotDownloader = async (
549
602
  finalOdspResolvedUrl: IOdspResolvedUrl,
550
603
  storageToken: string,
604
+ loadingGroupId: string[] | undefined,
551
605
  options: ISnapshotOptions | undefined,
552
606
  controller?: AbortController,
553
- ) => {
607
+ ): Promise<ISnapshotRequestAndResponseOptions> => {
554
608
  return downloadSnapshot(
555
609
  finalOdspResolvedUrl,
556
610
  storageToken,
557
- this.logger,
611
+ loadingGroupId,
558
612
  options,
559
613
  this.snapshotFormatFetchType,
560
614
  controller,
@@ -562,14 +616,14 @@ export class OdspDocumentStorageService extends OdspDocumentStorageServiceBase {
562
616
  scenarioName,
563
617
  );
564
618
  };
565
- const putInCache = async (valueWithEpoch: IVersionedValueWithEpoch) => {
619
+ const putInCache = async (valueWithEpoch: IVersionedValueWithEpoch): Promise<void> => {
566
620
  return this.cache.persistedCache.put(
567
621
  createCacheSnapshotKey(this.odspResolvedUrl),
568
622
  // Epoch tracker will add the epoch and version to the value here. So just send value to cache.
569
623
  valueWithEpoch.value,
570
624
  );
571
625
  };
572
- const removeEntries = async () => this.cache.persistedCache.removeEntries();
626
+ const removeEntries = async (): Promise<void> => this.cache.persistedCache.removeEntries();
573
627
  try {
574
628
  const odspSnapshot = await fetchSnapshotWithRedeem(
575
629
  this.odspResolvedUrl,
@@ -580,10 +634,13 @@ export class OdspDocumentStorageService extends OdspDocumentStorageServiceBase {
580
634
  snapshotDownloader,
581
635
  putInCache,
582
636
  removeEntries,
637
+ loadingGroupIds,
583
638
  this.hostPolicy.enableRedeemFallback,
584
639
  );
585
640
  return odspSnapshot;
641
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
586
642
  } catch (error: any) {
643
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
587
644
  const errorType = error.errorType;
588
645
  // If the snapshot size is too big and the host specified the size limitation(specified in hostSnapshotOptions), then don't try to fetch the snapshot again.
589
646
  if (
@@ -601,6 +658,7 @@ export class OdspDocumentStorageService extends OdspDocumentStorageServiceBase {
601
658
  ) {
602
659
  this.logger.sendErrorEvent({
603
660
  eventName: "TreeLatest_SecondCall",
661
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
604
662
  errorType,
605
663
  });
606
664
  const snapshotOptionsWithoutBlobs: ISnapshotOptions = {
@@ -618,6 +676,7 @@ export class OdspDocumentStorageService extends OdspDocumentStorageServiceBase {
618
676
  snapshotDownloader,
619
677
  putInCache,
620
678
  removeEntries,
679
+ loadingGroupIds,
621
680
  this.hostPolicy.enableRedeemFallback,
622
681
  );
623
682
  return odspSnapshot;
@@ -689,7 +748,7 @@ export class OdspDocumentStorageService extends OdspDocumentStorageServiceBase {
689
748
  return id;
690
749
  }
691
750
 
692
- private async getDelayLoadedSummaryManager() {
751
+ private async getDelayLoadedSummaryManager(): Promise<OdspSummaryUploadManager> {
693
752
  assert(this.odspSummaryModuleLoaded === false, 0x56f /* Should be loaded only once */);
694
753
  const module = await import(
695
754
  /* webpackChunkName: "summaryModule" */ "./odspSummaryUploadManager.js"
@@ -713,7 +772,7 @@ export class OdspDocumentStorageService extends OdspDocumentStorageServiceBase {
713
772
  return this.odspSummaryUploadManager;
714
773
  }
715
774
 
716
- private checkSnapshotUrl() {
775
+ private checkSnapshotUrl(): void {
717
776
  if (!this.snapshotUrl) {
718
777
  throw new NonRetryableError(
719
778
  "Method failed because no snapshot url was available",
@@ -723,7 +782,7 @@ export class OdspDocumentStorageService extends OdspDocumentStorageServiceBase {
723
782
  }
724
783
  }
725
784
 
726
- private checkAttachmentPOSTUrl() {
785
+ private checkAttachmentPOSTUrl(): void {
727
786
  if (!this.attachmentPOSTUrl) {
728
787
  throw new NonRetryableError(
729
788
  "Method failed because no attachment POST url was available",
@@ -733,7 +792,7 @@ export class OdspDocumentStorageService extends OdspDocumentStorageServiceBase {
733
792
  }
734
793
  }
735
794
 
736
- private checkAttachmentGETUrl() {
795
+ private checkAttachmentGETUrl(): void {
737
796
  if (!this.attachmentGETUrl) {
738
797
  throw new NonRetryableError(
739
798
  "Method failed because no attachment GET url was available",
@@ -751,8 +810,9 @@ export class OdspDocumentStorageService extends OdspDocumentStorageServiceBase {
751
810
  const storageToken = await this.getStorageToken(options, "ReadCommit");
752
811
  const snapshotDownloader = async (
753
812
  url: string,
754
- fetchOptions: { [index: string]: any },
755
- ) => {
813
+ fetchOptions: RequestInit,
814
+ // eslint-disable-next-line unicorn/consistent-function-scoping
815
+ ): Promise<IOdspResponse<unknown>> => {
756
816
  return this.epochTracker.fetchAndParseAsJSON(
757
817
  url,
758
818
  fetchOptions,