@fluidframework/odsp-driver 2.0.0-dev-rc.1.0.0.228517 → 2.0.0-dev-rc.2.0.0.245554
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.
- package/.eslintrc.cjs +33 -0
- package/{.mocharc.js → .mocharc.cjs} +1 -1
- package/CHANGELOG.md +44 -0
- package/{api-extractor-esm.json → api-extractor-cjs.json} +5 -1
- package/api-extractor-lint.json +1 -1
- package/api-extractor.json +1 -1
- package/api-report/odsp-driver.api.md +16 -17
- package/dist/ReadBufferUtils.d.ts.map +1 -1
- package/dist/ReadBufferUtils.js.map +1 -1
- package/dist/WriteBufferUtils.d.ts +1 -1
- package/dist/WriteBufferUtils.d.ts.map +1 -1
- package/dist/WriteBufferUtils.js +12 -12
- package/dist/WriteBufferUtils.js.map +1 -1
- package/dist/checkUrl.d.ts.map +1 -1
- package/dist/checkUrl.js +5 -3
- package/dist/checkUrl.js.map +1 -1
- package/dist/compactSnapshotParser.d.ts +2 -2
- package/dist/compactSnapshotParser.d.ts.map +1 -1
- package/dist/compactSnapshotParser.js +94 -75
- package/dist/compactSnapshotParser.js.map +1 -1
- package/dist/compactSnapshotWriter.d.ts +2 -2
- package/dist/compactSnapshotWriter.d.ts.map +1 -1
- package/dist/compactSnapshotWriter.js +26 -20
- package/dist/compactSnapshotWriter.js.map +1 -1
- package/dist/contracts.d.ts +24 -4
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js +5 -1
- package/dist/contracts.js.map +1 -1
- package/dist/createFile.d.ts +4 -4
- package/dist/createFile.d.ts.map +1 -1
- package/dist/createFile.js +36 -52
- package/dist/createFile.js.map +1 -1
- package/dist/createNewContainerOnExistingFile.d.ts +2 -2
- package/dist/createNewContainerOnExistingFile.d.ts.map +1 -1
- package/dist/createNewContainerOnExistingFile.js +14 -14
- package/dist/createNewContainerOnExistingFile.js.map +1 -1
- package/dist/createNewModule.d.ts +2 -2
- package/dist/createNewModule.d.ts.map +1 -1
- package/dist/createNewModule.js +4 -4
- package/dist/createNewModule.js.map +1 -1
- package/dist/createNewUtils.d.ts +4 -4
- package/dist/createNewUtils.d.ts.map +1 -1
- package/dist/createNewUtils.js +16 -11
- package/dist/createNewUtils.js.map +1 -1
- package/dist/createOdspCreateContainerRequest.d.ts +2 -2
- package/dist/createOdspCreateContainerRequest.d.ts.map +1 -1
- package/dist/createOdspCreateContainerRequest.js +2 -2
- package/dist/createOdspCreateContainerRequest.js.map +1 -1
- package/dist/createOdspUrl.d.ts +1 -1
- package/dist/createOdspUrl.d.ts.map +1 -1
- package/dist/createOdspUrl.js.map +1 -1
- package/dist/epochTracker.d.ts +10 -9
- package/dist/epochTracker.d.ts.map +1 -1
- package/dist/epochTracker.js +67 -45
- package/dist/epochTracker.js.map +1 -1
- package/dist/fetchSnapshot.d.ts +14 -11
- package/dist/fetchSnapshot.d.ts.map +1 -1
- package/dist/fetchSnapshot.js +91 -71
- package/dist/fetchSnapshot.js.map +1 -1
- package/dist/getFileLink.d.ts.map +1 -1
- package/dist/getFileLink.js +25 -18
- package/dist/getFileLink.js.map +1 -1
- package/dist/getQueryString.d.ts.map +1 -1
- package/dist/getQueryString.js +2 -0
- package/dist/getQueryString.js.map +1 -1
- package/dist/index.d.ts +19 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +44 -44
- package/dist/index.js.map +1 -1
- package/dist/localOdspDriver/localOdspDocumentService.d.ts +4 -3
- package/dist/localOdspDriver/localOdspDocumentService.d.ts.map +1 -1
- package/dist/localOdspDriver/localOdspDocumentService.js +8 -6
- package/dist/localOdspDriver/localOdspDocumentService.js.map +1 -1
- package/dist/localOdspDriver/localOdspDocumentServiceFactory.d.ts +8 -6
- package/dist/localOdspDriver/localOdspDocumentServiceFactory.d.ts.map +1 -1
- package/dist/localOdspDriver/localOdspDocumentServiceFactory.js +10 -9
- package/dist/localOdspDriver/localOdspDocumentServiceFactory.js.map +1 -1
- package/dist/localOdspDriver/localOdspDocumentStorageManager.d.ts +3 -2
- package/dist/localOdspDriver/localOdspDocumentStorageManager.d.ts.map +1 -1
- package/dist/localOdspDriver/localOdspDocumentStorageManager.js +9 -6
- package/dist/localOdspDriver/localOdspDocumentStorageManager.js.map +1 -1
- package/dist/odsp-driver-alpha.d.ts +31 -15
- package/dist/odsp-driver-beta.d.ts +4 -5
- package/dist/odsp-driver-public.d.ts +4 -5
- package/dist/odsp-driver-untrimmed.d.ts +34 -16
- package/dist/odspCache.d.ts +5 -5
- package/dist/odspCache.d.ts.map +1 -1
- package/dist/odspCache.js +1 -2
- package/dist/odspCache.js.map +1 -1
- package/dist/odspDelayLoadedDeltaStream.d.ts +12 -6
- package/dist/odspDelayLoadedDeltaStream.d.ts.map +1 -1
- package/dist/odspDelayLoadedDeltaStream.js +89 -25
- package/dist/odspDelayLoadedDeltaStream.js.map +1 -1
- package/dist/odspDeltaStorageService.d.ts +7 -7
- package/dist/odspDeltaStorageService.d.ts.map +1 -1
- package/dist/odspDeltaStorageService.js +5 -5
- package/dist/odspDeltaStorageService.js.map +1 -1
- package/dist/odspDocumentDeltaConnection.d.ts +1 -1
- package/dist/odspDocumentDeltaConnection.d.ts.map +1 -1
- package/dist/odspDocumentDeltaConnection.js +41 -23
- package/dist/odspDocumentDeltaConnection.js.map +1 -1
- package/dist/odspDocumentService.d.ts +9 -6
- package/dist/odspDocumentService.d.ts.map +1 -1
- package/dist/odspDocumentService.js +25 -19
- package/dist/odspDocumentService.js.map +1 -1
- package/dist/odspDocumentServiceFactory.d.ts +6 -1
- package/dist/odspDocumentServiceFactory.d.ts.map +1 -1
- package/dist/odspDocumentServiceFactory.js +9 -4
- package/dist/odspDocumentServiceFactory.js.map +1 -1
- package/dist/odspDocumentServiceFactoryCore.d.ts +4 -4
- package/dist/odspDocumentServiceFactoryCore.d.ts.map +1 -1
- package/dist/odspDocumentServiceFactoryCore.js +27 -30
- package/dist/odspDocumentServiceFactoryCore.js.map +1 -1
- package/dist/odspDocumentServiceFactoryWithCodeSplit.d.ts +1 -1
- package/dist/odspDocumentServiceFactoryWithCodeSplit.d.ts.map +1 -1
- package/dist/odspDocumentServiceFactoryWithCodeSplit.js +2 -2
- package/dist/odspDocumentServiceFactoryWithCodeSplit.js.map +1 -1
- package/dist/odspDocumentStorageManager.d.ts +17 -10
- package/dist/odspDocumentStorageManager.d.ts.map +1 -1
- package/dist/odspDocumentStorageManager.js +226 -169
- package/dist/odspDocumentStorageManager.js.map +1 -1
- package/dist/odspDocumentStorageServiceBase.d.ts +4 -6
- package/dist/odspDocumentStorageServiceBase.d.ts.map +1 -1
- package/dist/odspDocumentStorageServiceBase.js +34 -31
- package/dist/odspDocumentStorageServiceBase.js.map +1 -1
- package/dist/odspDriverUrlResolver.d.ts +1 -1
- package/dist/odspDriverUrlResolver.d.ts.map +1 -1
- package/dist/odspDriverUrlResolver.js +26 -32
- package/dist/odspDriverUrlResolver.js.map +1 -1
- package/dist/odspDriverUrlResolverForShareLink.d.ts +13 -6
- package/dist/odspDriverUrlResolverForShareLink.d.ts.map +1 -1
- package/dist/odspDriverUrlResolverForShareLink.js +47 -37
- package/dist/odspDriverUrlResolverForShareLink.js.map +1 -1
- package/dist/odspError.d.ts +1 -1
- package/dist/odspError.d.ts.map +1 -1
- package/dist/odspError.js +6 -6
- package/dist/odspError.js.map +1 -1
- package/dist/odspFluidFileLink.d.ts +1 -1
- package/dist/odspFluidFileLink.d.ts.map +1 -1
- package/dist/odspFluidFileLink.js +2 -2
- package/dist/odspFluidFileLink.js.map +1 -1
- package/dist/odspLocationRedirection.js +2 -2
- package/dist/odspLocationRedirection.js.map +1 -1
- package/dist/odspPublicUtils.d.ts +4 -0
- package/dist/odspPublicUtils.d.ts.map +1 -1
- package/dist/odspPublicUtils.js +3 -0
- package/dist/odspPublicUtils.js.map +1 -1
- package/dist/odspSnapshotParser.d.ts +3 -3
- package/dist/odspSnapshotParser.d.ts.map +1 -1
- package/dist/odspSnapshotParser.js +5 -3
- package/dist/odspSnapshotParser.js.map +1 -1
- package/dist/odspSummaryUploadManager.d.ts +1 -1
- package/dist/odspSummaryUploadManager.d.ts.map +1 -1
- package/dist/odspSummaryUploadManager.js +9 -6
- package/dist/odspSummaryUploadManager.js.map +1 -1
- package/dist/odspUrlHelper.d.ts.map +1 -1
- package/dist/odspUrlHelper.js +1 -2
- package/dist/odspUrlHelper.js.map +1 -1
- package/dist/odspUtils.d.ts +29 -13
- package/dist/odspUtils.d.ts.map +1 -1
- package/dist/odspUtils.js +75 -41
- package/dist/odspUtils.js.map +1 -1
- package/dist/opsCaching.d.ts +1 -1
- package/dist/opsCaching.d.ts.map +1 -1
- package/dist/opsCaching.js +2 -1
- package/dist/opsCaching.js.map +1 -1
- package/dist/package.json +3 -0
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/prefetchLatestSnapshot.d.ts +2 -2
- package/dist/prefetchLatestSnapshot.d.ts.map +1 -1
- package/dist/prefetchLatestSnapshot.js +17 -12
- package/dist/prefetchLatestSnapshot.js.map +1 -1
- package/dist/retryErrorsStorageAdapter.d.ts +2 -2
- package/dist/retryErrorsStorageAdapter.d.ts.map +1 -1
- package/dist/retryErrorsStorageAdapter.js +10 -5
- package/dist/retryErrorsStorageAdapter.js.map +1 -1
- package/dist/retryUtils.d.ts.map +1 -1
- package/dist/retryUtils.js +7 -3
- package/dist/retryUtils.js.map +1 -1
- package/dist/socketModule.d.ts.map +1 -1
- package/dist/socketModule.js +2 -0
- package/dist/socketModule.js.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/dist/vroom.d.ts +2 -2
- package/dist/vroom.d.ts.map +1 -1
- package/dist/vroom.js +5 -5
- package/dist/vroom.js.map +1 -1
- package/dist/zipItDataRepresentationUtils.d.ts +1 -1
- package/dist/zipItDataRepresentationUtils.d.ts.map +1 -1
- package/dist/zipItDataRepresentationUtils.js +17 -13
- package/dist/zipItDataRepresentationUtils.js.map +1 -1
- package/lib/{ReadBufferUtils.d.mts → ReadBufferUtils.d.ts} +1 -1
- package/lib/ReadBufferUtils.d.ts.map +1 -0
- package/lib/{ReadBufferUtils.mjs → ReadBufferUtils.js} +1 -1
- package/lib/ReadBufferUtils.js.map +1 -0
- package/lib/{WriteBufferUtils.d.mts → WriteBufferUtils.d.ts} +2 -2
- package/lib/WriteBufferUtils.d.ts.map +1 -0
- package/lib/{WriteBufferUtils.mjs → WriteBufferUtils.js} +2 -2
- package/lib/WriteBufferUtils.js.map +1 -0
- package/lib/{checkUrl.d.mts → checkUrl.d.ts} +1 -1
- package/lib/checkUrl.d.ts.map +1 -0
- package/lib/{checkUrl.mjs → checkUrl.js} +5 -3
- package/lib/checkUrl.js.map +1 -0
- package/lib/{compactSnapshotParser.d.mts → compactSnapshotParser.d.ts} +3 -3
- package/lib/compactSnapshotParser.d.ts.map +1 -0
- package/lib/{compactSnapshotParser.mjs → compactSnapshotParser.js} +69 -50
- package/lib/compactSnapshotParser.js.map +1 -0
- package/lib/{compactSnapshotWriter.d.mts → compactSnapshotWriter.d.ts} +3 -3
- package/lib/compactSnapshotWriter.d.ts.map +1 -0
- package/lib/{compactSnapshotWriter.mjs → compactSnapshotWriter.js} +14 -8
- package/lib/compactSnapshotWriter.js.map +1 -0
- package/lib/{constants.d.mts → constants.d.ts} +1 -1
- package/lib/constants.d.ts.map +1 -0
- package/lib/{constants.mjs → constants.js} +1 -1
- package/lib/constants.js.map +1 -0
- package/lib/{contracts.d.mts → contracts.d.ts} +25 -5
- package/lib/contracts.d.ts.map +1 -0
- package/lib/contracts.js +10 -0
- package/lib/contracts.js.map +1 -0
- package/lib/{contractsPublic.d.mts → contractsPublic.d.ts} +1 -1
- package/lib/contractsPublic.d.ts.map +1 -0
- package/lib/{contractsPublic.mjs → contractsPublic.js} +1 -1
- package/lib/contractsPublic.js.map +1 -0
- package/lib/{createFile.d.mts → createFile.d.ts} +5 -5
- package/lib/createFile.d.ts.map +1 -0
- package/lib/{createFile.mjs → createFile.js} +25 -41
- package/lib/createFile.js.map +1 -0
- package/lib/{createNewContainerOnExistingFile.d.mts → createNewContainerOnExistingFile.d.ts} +3 -3
- package/lib/createNewContainerOnExistingFile.d.ts.map +1 -0
- package/lib/{createNewContainerOnExistingFile.mjs → createNewContainerOnExistingFile.js} +7 -7
- package/lib/createNewContainerOnExistingFile.js.map +1 -0
- package/lib/{createNewModule.mjs → createNewModule.d.ts} +3 -3
- package/lib/createNewModule.d.ts.map +1 -0
- package/lib/{createNewModule.d.mts → createNewModule.js} +3 -3
- package/lib/createNewModule.js.map +1 -0
- package/lib/{createNewUtils.d.mts → createNewUtils.d.ts} +5 -5
- package/lib/createNewUtils.d.ts.map +1 -0
- package/lib/{createNewUtils.mjs → createNewUtils.js} +13 -8
- package/lib/createNewUtils.js.map +1 -0
- package/lib/{createOdspCreateContainerRequest.d.mts → createOdspCreateContainerRequest.d.ts} +7 -3
- package/lib/createOdspCreateContainerRequest.d.ts.map +1 -0
- package/lib/{createOdspCreateContainerRequest.mjs → createOdspCreateContainerRequest.js} +2 -2
- package/lib/createOdspCreateContainerRequest.js.map +1 -0
- package/lib/{createOdspUrl.d.mts → createOdspUrl.d.ts} +2 -2
- package/lib/createOdspUrl.d.ts.map +1 -0
- package/lib/{createOdspUrl.mjs → createOdspUrl.js} +1 -1
- package/lib/createOdspUrl.js.map +1 -0
- package/lib/{epochTracker.d.mts → epochTracker.d.ts} +11 -10
- package/lib/epochTracker.d.ts.map +1 -0
- package/lib/{epochTracker.mjs → epochTracker.js} +58 -36
- package/lib/epochTracker.js.map +1 -0
- package/lib/{fetch.d.mts → fetch.d.ts} +1 -1
- package/lib/fetch.d.ts.map +1 -0
- package/lib/{fetch.mjs → fetch.js} +1 -1
- package/lib/fetch.js.map +1 -0
- package/lib/{fetchSnapshot.d.mts → fetchSnapshot.d.ts} +15 -12
- package/lib/fetchSnapshot.d.ts.map +1 -0
- package/lib/{fetchSnapshot.mjs → fetchSnapshot.js} +74 -54
- package/lib/fetchSnapshot.js.map +1 -0
- package/lib/{getFileLink.d.mts → getFileLink.d.ts} +1 -1
- package/lib/getFileLink.d.ts.map +1 -0
- package/lib/{getFileLink.mjs → getFileLink.js} +17 -10
- package/lib/getFileLink.js.map +1 -0
- package/lib/{getQueryString.d.mts → getQueryString.d.ts} +5 -1
- package/lib/getQueryString.d.ts.map +1 -0
- package/lib/{getQueryString.mjs → getQueryString.js} +3 -1
- package/lib/getQueryString.js.map +1 -0
- package/lib/{getUrlAndHeadersWithAuth.d.mts → getUrlAndHeadersWithAuth.d.ts} +1 -1
- package/lib/getUrlAndHeadersWithAuth.d.ts.map +1 -0
- package/lib/{getUrlAndHeadersWithAuth.mjs → getUrlAndHeadersWithAuth.js} +1 -1
- package/lib/getUrlAndHeadersWithAuth.js.map +1 -0
- package/lib/{index.d.mts → index.d.ts} +20 -20
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +29 -0
- package/lib/index.js.map +1 -0
- package/lib/localOdspDriver/{localOdspDeltaStorageService.d.mts → localOdspDeltaStorageService.d.ts} +1 -1
- package/lib/localOdspDriver/localOdspDeltaStorageService.d.ts.map +1 -0
- package/lib/localOdspDriver/{localOdspDeltaStorageService.mjs → localOdspDeltaStorageService.js} +1 -1
- package/lib/localOdspDriver/localOdspDeltaStorageService.js.map +1 -0
- package/lib/localOdspDriver/{localOdspDocumentService.d.mts → localOdspDocumentService.d.ts} +5 -4
- package/lib/localOdspDriver/localOdspDocumentService.d.ts.map +1 -0
- package/lib/localOdspDriver/{localOdspDocumentService.mjs → localOdspDocumentService.js} +7 -5
- package/lib/localOdspDriver/localOdspDocumentService.js.map +1 -0
- package/lib/localOdspDriver/{localOdspDocumentServiceFactory.d.mts → localOdspDocumentServiceFactory.d.ts} +9 -7
- package/lib/localOdspDriver/localOdspDocumentServiceFactory.d.ts.map +1 -0
- package/lib/localOdspDriver/{localOdspDocumentServiceFactory.mjs → localOdspDocumentServiceFactory.js} +9 -8
- package/lib/localOdspDriver/localOdspDocumentServiceFactory.js.map +1 -0
- package/lib/localOdspDriver/{localOdspDocumentStorageManager.d.mts → localOdspDocumentStorageManager.d.ts} +4 -3
- package/lib/localOdspDriver/localOdspDocumentStorageManager.d.ts.map +1 -0
- package/lib/localOdspDriver/{localOdspDocumentStorageManager.mjs → localOdspDocumentStorageManager.js} +7 -4
- package/lib/localOdspDriver/localOdspDocumentStorageManager.js.map +1 -0
- package/lib/{odsp-driver-alpha.d.mts → odsp-driver-alpha.d.ts} +31 -15
- package/lib/{odsp-driver-beta.d.mts → odsp-driver-beta.d.ts} +4 -5
- package/lib/{odsp-driver-public.d.mts → odsp-driver-public.d.ts} +4 -5
- package/lib/{odsp-driver-untrimmed.d.mts → odsp-driver-untrimmed.d.ts} +34 -16
- package/lib/{odspCache.d.mts → odspCache.d.ts} +10 -6
- package/lib/odspCache.d.ts.map +1 -0
- package/lib/{odspCache.mjs → odspCache.js} +6 -3
- package/lib/odspCache.js.map +1 -0
- package/lib/{odspDelayLoadedDeltaStream.d.mts → odspDelayLoadedDeltaStream.d.ts} +13 -7
- package/lib/odspDelayLoadedDeltaStream.d.ts.map +1 -0
- package/lib/{odspDelayLoadedDeltaStream.mjs → odspDelayLoadedDeltaStream.js} +84 -20
- package/lib/odspDelayLoadedDeltaStream.js.map +1 -0
- package/lib/{odspDeltaStorageService.d.mts → odspDeltaStorageService.d.ts} +8 -8
- package/lib/odspDeltaStorageService.d.ts.map +1 -0
- package/lib/{odspDeltaStorageService.mjs → odspDeltaStorageService.js} +5 -5
- package/lib/odspDeltaStorageService.js.map +1 -0
- package/lib/{odspDocumentDeltaConnection.d.mts → odspDocumentDeltaConnection.d.ts} +2 -2
- package/lib/odspDocumentDeltaConnection.d.ts.map +1 -0
- package/lib/{odspDocumentDeltaConnection.mjs → odspDocumentDeltaConnection.js} +34 -16
- package/lib/odspDocumentDeltaConnection.js.map +1 -0
- package/lib/{odspDocumentService.d.mts → odspDocumentService.d.ts} +10 -7
- package/lib/odspDocumentService.d.ts.map +1 -0
- package/lib/{odspDocumentService.mjs → odspDocumentService.js} +22 -14
- package/lib/odspDocumentService.js.map +1 -0
- package/lib/{odspDocumentServiceFactory.d.mts → odspDocumentServiceFactory.d.ts} +7 -2
- package/lib/odspDocumentServiceFactory.d.ts.map +1 -0
- package/lib/{odspDocumentServiceFactory.mjs → odspDocumentServiceFactory.js} +9 -3
- package/lib/odspDocumentServiceFactory.js.map +1 -0
- package/lib/{odspDocumentServiceFactoryCore.d.mts → odspDocumentServiceFactoryCore.d.ts} +5 -5
- package/lib/odspDocumentServiceFactoryCore.d.ts.map +1 -0
- package/lib/{odspDocumentServiceFactoryCore.mjs → odspDocumentServiceFactoryCore.js} +25 -26
- package/lib/odspDocumentServiceFactoryCore.js.map +1 -0
- package/lib/{odspDocumentServiceFactoryWithCodeSplit.d.mts → odspDocumentServiceFactoryWithCodeSplit.d.ts} +2 -2
- package/lib/odspDocumentServiceFactoryWithCodeSplit.d.ts.map +1 -0
- package/lib/{odspDocumentServiceFactoryWithCodeSplit.mjs → odspDocumentServiceFactoryWithCodeSplit.js} +2 -2
- package/lib/odspDocumentServiceFactoryWithCodeSplit.js.map +1 -0
- package/lib/{odspDocumentStorageManager.d.mts → odspDocumentStorageManager.d.ts} +18 -11
- package/lib/odspDocumentStorageManager.d.ts.map +1 -0
- package/lib/{odspDocumentStorageManager.mjs → odspDocumentStorageManager.js} +221 -162
- package/lib/odspDocumentStorageManager.js.map +1 -0
- package/lib/{odspDocumentStorageServiceBase.d.mts → odspDocumentStorageServiceBase.d.ts} +5 -7
- package/lib/odspDocumentStorageServiceBase.d.ts.map +1 -0
- package/lib/{odspDocumentStorageServiceBase.mjs → odspDocumentStorageServiceBase.js} +34 -31
- package/lib/odspDocumentStorageServiceBase.js.map +1 -0
- package/lib/{odspDriverUrlResolver.d.mts → odspDriverUrlResolver.d.ts} +2 -2
- package/lib/odspDriverUrlResolver.d.ts.map +1 -0
- package/lib/{odspDriverUrlResolver.mjs → odspDriverUrlResolver.js} +27 -29
- package/lib/odspDriverUrlResolver.js.map +1 -0
- package/lib/{odspDriverUrlResolverForShareLink.d.mts → odspDriverUrlResolverForShareLink.d.ts} +14 -7
- package/lib/odspDriverUrlResolverForShareLink.d.ts.map +1 -0
- package/lib/{odspDriverUrlResolverForShareLink.mjs → odspDriverUrlResolverForShareLink.js} +41 -27
- package/lib/odspDriverUrlResolverForShareLink.js.map +1 -0
- package/lib/{odspError.d.mts → odspError.d.ts} +2 -2
- package/lib/odspError.d.ts.map +1 -0
- package/lib/{odspError.mjs → odspError.js} +6 -6
- package/lib/odspError.js.map +1 -0
- package/lib/{odspFluidFileLink.d.mts → odspFluidFileLink.d.ts} +2 -2
- package/lib/odspFluidFileLink.d.ts.map +1 -0
- package/lib/{odspFluidFileLink.mjs → odspFluidFileLink.js} +2 -2
- package/lib/odspFluidFileLink.js.map +1 -0
- package/lib/{odspLocationRedirection.d.mts → odspLocationRedirection.d.ts} +1 -1
- package/lib/odspLocationRedirection.d.ts.map +1 -0
- package/lib/{odspLocationRedirection.mjs → odspLocationRedirection.js} +2 -2
- package/lib/odspLocationRedirection.js.map +1 -0
- package/lib/{odspPublicUtils.d.mts → odspPublicUtils.d.ts} +5 -1
- package/lib/odspPublicUtils.d.ts.map +1 -0
- package/lib/{odspPublicUtils.mjs → odspPublicUtils.js} +4 -1
- package/lib/odspPublicUtils.js.map +1 -0
- package/lib/{odspSnapshotParser.d.mts → odspSnapshotParser.d.ts} +4 -4
- package/lib/odspSnapshotParser.d.ts.map +1 -0
- package/lib/{odspSnapshotParser.mjs → odspSnapshotParser.js} +6 -4
- package/lib/odspSnapshotParser.js.map +1 -0
- package/lib/{odspSummaryUploadManager.d.mts → odspSummaryUploadManager.d.ts} +2 -2
- package/lib/odspSummaryUploadManager.d.ts.map +1 -0
- package/lib/{odspSummaryUploadManager.mjs → odspSummaryUploadManager.js} +8 -5
- package/lib/odspSummaryUploadManager.js.map +1 -0
- package/lib/{odspUrlHelper.d.mts → odspUrlHelper.d.ts} +1 -1
- package/lib/odspUrlHelper.d.ts.map +1 -0
- package/lib/{odspUrlHelper.mjs → odspUrlHelper.js} +2 -3
- package/lib/odspUrlHelper.js.map +1 -0
- package/lib/{odspUtils.d.mts → odspUtils.d.ts} +30 -14
- package/lib/odspUtils.d.ts.map +1 -0
- package/lib/{odspUtils.mjs → odspUtils.js} +61 -30
- package/lib/odspUtils.js.map +1 -0
- package/lib/{opsCaching.d.mts → opsCaching.d.ts} +2 -2
- package/lib/opsCaching.d.ts.map +1 -0
- package/lib/{opsCaching.mjs → opsCaching.js} +3 -2
- package/lib/opsCaching.js.map +1 -0
- package/lib/{packageVersion.d.mts → packageVersion.d.ts} +2 -2
- package/lib/packageVersion.d.ts.map +1 -0
- package/lib/{packageVersion.mjs → packageVersion.js} +2 -2
- package/lib/packageVersion.js.map +1 -0
- package/lib/{prefetchLatestSnapshot.d.mts → prefetchLatestSnapshot.d.ts} +3 -3
- package/lib/prefetchLatestSnapshot.d.ts.map +1 -0
- package/lib/{prefetchLatestSnapshot.mjs → prefetchLatestSnapshot.js} +16 -11
- package/lib/prefetchLatestSnapshot.js.map +1 -0
- package/lib/{retryErrorsStorageAdapter.d.mts → retryErrorsStorageAdapter.d.ts} +3 -3
- package/lib/retryErrorsStorageAdapter.d.ts.map +1 -0
- package/lib/{retryErrorsStorageAdapter.mjs → retryErrorsStorageAdapter.js} +11 -6
- package/lib/retryErrorsStorageAdapter.js.map +1 -0
- package/lib/{retryUtils.d.mts → retryUtils.d.ts} +1 -1
- package/lib/retryUtils.d.ts.map +1 -0
- package/lib/{retryUtils.mjs → retryUtils.js} +8 -4
- package/lib/retryUtils.js.map +1 -0
- package/lib/{socketModule.d.mts → socketModule.d.ts} +1 -1
- package/lib/socketModule.d.ts.map +1 -0
- package/lib/{socketModule.mjs → socketModule.js} +3 -1
- package/lib/socketModule.js.map +1 -0
- package/lib/test/buildOdspShareLinkReqParams.spec.js +25 -0
- package/lib/test/buildOdspShareLinkReqParams.spec.js.map +1 -0
- package/lib/test/createNewUtilsTests.spec.js +221 -0
- package/lib/test/createNewUtilsTests.spec.js.map +1 -0
- package/lib/test/deltaStorageService.spec.js +176 -0
- package/lib/test/deltaStorageService.spec.js.map +1 -0
- package/lib/test/epochTests.spec.js +340 -0
- package/lib/test/epochTests.spec.js.map +1 -0
- package/lib/test/epochTestsWithRedemption.spec.js +119 -0
- package/lib/test/epochTestsWithRedemption.spec.js.map +1 -0
- package/lib/test/fetchSnapshot.spec.js +412 -0
- package/lib/test/fetchSnapshot.spec.js.map +1 -0
- package/lib/test/getFileLink.spec.js +62 -0
- package/lib/test/getFileLink.spec.js.map +1 -0
- package/lib/test/getUrlAndHeadersWithAuth.spec.js +66 -0
- package/lib/test/getUrlAndHeadersWithAuth.spec.js.map +1 -0
- package/lib/test/getVersions.spec.js +284 -0
- package/lib/test/getVersions.spec.js.map +1 -0
- package/lib/test/joinSessionCacheTests.spec.js +53 -0
- package/lib/test/joinSessionCacheTests.spec.js.map +1 -0
- package/lib/test/joinSessionPeriodicCall.spec.js +158 -0
- package/lib/test/joinSessionPeriodicCall.spec.js.map +1 -0
- package/lib/test/jsonSnapshotFormatTests.spec.js +107 -0
- package/lib/test/jsonSnapshotFormatTests.spec.js.map +1 -0
- package/lib/test/localOdspDriver.spec.js +177 -0
- package/lib/test/localOdspDriver.spec.js.map +1 -0
- package/lib/test/mockFetch.js +61 -0
- package/lib/test/mockFetch.js.map +1 -0
- package/lib/test/odspCreateContainer.spec.js +116 -0
- package/lib/test/odspCreateContainer.spec.js.map +1 -0
- package/lib/test/odspDriverResolverTest.spec.js +289 -0
- package/lib/test/odspDriverResolverTest.spec.js.map +1 -0
- package/lib/test/odspDriverUrlResolverForShareLink.spec.js +287 -0
- package/lib/test/odspDriverUrlResolverForShareLink.spec.js.map +1 -0
- package/lib/test/odspError.spec.js +299 -0
- package/lib/test/odspError.spec.js.map +1 -0
- package/lib/test/opsCaching.spec.js +357 -0
- package/lib/test/opsCaching.spec.js.map +1 -0
- package/lib/test/prefetchSnapshotTests.spec.js +420 -0
- package/lib/test/prefetchSnapshotTests.spec.js.map +1 -0
- package/lib/test/snapshotFormatTests.spec.js +218 -0
- package/lib/test/snapshotFormatTests.spec.js.map +1 -0
- package/lib/test/socketTests/deltaConnectionUpdateTests.spec.js +152 -0
- package/lib/test/socketTests/deltaConnectionUpdateTests.spec.js.map +1 -0
- package/lib/test/socketTests/socketMock.js +109 -0
- package/lib/test/socketTests/socketMock.js.map +1 -0
- package/lib/test/socketTests/socketTests.spec.js +256 -0
- package/lib/test/socketTests/socketTests.spec.js.map +1 -0
- package/lib/test/tokenFetch.spec.js +39 -0
- package/lib/test/tokenFetch.spec.js.map +1 -0
- package/lib/test/types/validateOdspDriverPrevious.generated.js +96 -0
- package/lib/test/types/validateOdspDriverPrevious.generated.js.map +1 -0
- package/lib/test/zipItDataRepresentationTests.spec.js +207 -0
- package/lib/test/zipItDataRepresentationTests.spec.js.map +1 -0
- package/lib/{vroom.d.mts → vroom.d.ts} +3 -3
- package/lib/vroom.d.ts.map +1 -0
- package/lib/{vroom.mjs → vroom.js} +4 -4
- package/lib/vroom.js.map +1 -0
- package/lib/{zipItDataRepresentationUtils.d.mts → zipItDataRepresentationUtils.d.ts} +2 -2
- package/lib/zipItDataRepresentationUtils.d.ts.map +1 -0
- package/lib/{zipItDataRepresentationUtils.mjs → zipItDataRepresentationUtils.js} +19 -11
- package/lib/zipItDataRepresentationUtils.js.map +1 -0
- package/package.json +100 -32
- package/src/ReadBufferUtils.ts +7 -7
- package/src/WriteBufferUtils.ts +13 -9
- package/src/checkUrl.ts +4 -2
- package/src/compactSnapshotParser.ts +97 -61
- package/src/compactSnapshotWriter.ts +22 -15
- package/src/contracts.ts +33 -4
- package/src/createFile.ts +26 -51
- package/src/createNewContainerOnExistingFile.ts +10 -10
- package/src/createNewModule.ts +2 -2
- package/src/createNewUtils.ts +26 -15
- package/src/createOdspCreateContainerRequest.ts +3 -3
- package/src/createOdspUrl.ts +1 -1
- package/src/epochTracker.ts +93 -58
- package/src/fetchSnapshot.ts +122 -66
- package/src/getFileLink.ts +24 -16
- package/src/getQueryString.ts +2 -0
- package/src/index.ts +27 -19
- package/src/localOdspDriver/localOdspDocumentService.ts +12 -5
- package/src/localOdspDriver/localOdspDocumentServiceFactory.ts +12 -11
- package/src/localOdspDriver/localOdspDocumentStorageManager.ts +15 -8
- package/src/odspCache.ts +14 -11
- package/src/odspDelayLoadedDeltaStream.ts +113 -31
- package/src/odspDeltaStorageService.ts +17 -16
- package/src/odspDocumentDeltaConnection.ts +52 -34
- package/src/odspDocumentService.ts +33 -22
- package/src/odspDocumentServiceFactory.ts +7 -2
- package/src/odspDocumentServiceFactoryCore.ts +28 -29
- package/src/odspDocumentServiceFactoryWithCodeSplit.ts +1 -1
- package/src/odspDocumentStorageManager.ts +303 -210
- package/src/odspDocumentStorageServiceBase.ts +52 -47
- package/src/odspDriverUrlResolver.ts +41 -41
- package/src/odspDriverUrlResolverForShareLink.ts +50 -31
- package/src/odspError.ts +6 -7
- package/src/odspFluidFileLink.ts +3 -3
- package/src/odspLocationRedirection.ts +1 -1
- package/src/odspPublicUtils.ts +4 -0
- package/src/odspSnapshotParser.ts +9 -9
- package/src/odspSummaryUploadManager.ts +21 -9
- package/src/odspUrlHelper.ts +2 -3
- package/src/odspUtils.ts +102 -53
- package/src/opsCaching.ts +13 -12
- package/src/packageVersion.ts +1 -1
- package/src/prefetchLatestSnapshot.ts +24 -15
- package/src/retryErrorsStorageAdapter.ts +16 -9
- package/src/retryUtils.ts +8 -4
- package/src/socketModule.ts +2 -0
- package/src/vroom.ts +6 -6
- package/src/zipItDataRepresentationUtils.ts +65 -37
- package/tsconfig.cjs.json +7 -0
- package/tsconfig.json +2 -5
- package/.eslintrc.js +0 -18
- package/lib/ReadBufferUtils.d.mts.map +0 -1
- package/lib/ReadBufferUtils.mjs.map +0 -1
- package/lib/WriteBufferUtils.d.mts.map +0 -1
- package/lib/WriteBufferUtils.mjs.map +0 -1
- package/lib/checkUrl.d.mts.map +0 -1
- package/lib/checkUrl.mjs.map +0 -1
- package/lib/compactSnapshotParser.d.mts.map +0 -1
- package/lib/compactSnapshotParser.mjs.map +0 -1
- package/lib/compactSnapshotWriter.d.mts.map +0 -1
- package/lib/compactSnapshotWriter.mjs.map +0 -1
- package/lib/constants.d.mts.map +0 -1
- package/lib/constants.mjs.map +0 -1
- package/lib/contracts.d.mts.map +0 -1
- package/lib/contracts.mjs +0 -6
- package/lib/contracts.mjs.map +0 -1
- package/lib/contractsPublic.d.mts.map +0 -1
- package/lib/contractsPublic.mjs.map +0 -1
- package/lib/createFile.d.mts.map +0 -1
- package/lib/createFile.mjs.map +0 -1
- package/lib/createNewContainerOnExistingFile.d.mts.map +0 -1
- package/lib/createNewContainerOnExistingFile.mjs.map +0 -1
- package/lib/createNewModule.d.mts.map +0 -1
- package/lib/createNewModule.mjs.map +0 -1
- package/lib/createNewUtils.d.mts.map +0 -1
- package/lib/createNewUtils.mjs.map +0 -1
- package/lib/createOdspCreateContainerRequest.d.mts.map +0 -1
- package/lib/createOdspCreateContainerRequest.mjs.map +0 -1
- package/lib/createOdspUrl.d.mts.map +0 -1
- package/lib/createOdspUrl.mjs.map +0 -1
- package/lib/epochTracker.d.mts.map +0 -1
- package/lib/epochTracker.mjs.map +0 -1
- package/lib/fetch.d.mts.map +0 -1
- package/lib/fetch.mjs.map +0 -1
- package/lib/fetchSnapshot.d.mts.map +0 -1
- package/lib/fetchSnapshot.mjs.map +0 -1
- package/lib/getFileLink.d.mts.map +0 -1
- package/lib/getFileLink.mjs.map +0 -1
- package/lib/getQueryString.d.mts.map +0 -1
- package/lib/getQueryString.mjs.map +0 -1
- package/lib/getUrlAndHeadersWithAuth.d.mts.map +0 -1
- package/lib/getUrlAndHeadersWithAuth.mjs.map +0 -1
- package/lib/index.d.mts.map +0 -1
- package/lib/index.mjs +0 -22
- package/lib/index.mjs.map +0 -1
- package/lib/localOdspDriver/localOdspDeltaStorageService.d.mts.map +0 -1
- package/lib/localOdspDriver/localOdspDeltaStorageService.mjs.map +0 -1
- package/lib/localOdspDriver/localOdspDocumentService.d.mts.map +0 -1
- package/lib/localOdspDriver/localOdspDocumentService.mjs.map +0 -1
- package/lib/localOdspDriver/localOdspDocumentServiceFactory.d.mts.map +0 -1
- package/lib/localOdspDriver/localOdspDocumentServiceFactory.mjs.map +0 -1
- package/lib/localOdspDriver/localOdspDocumentStorageManager.d.mts.map +0 -1
- package/lib/localOdspDriver/localOdspDocumentStorageManager.mjs.map +0 -1
- package/lib/odspCache.d.mts.map +0 -1
- package/lib/odspCache.mjs.map +0 -1
- package/lib/odspDelayLoadedDeltaStream.d.mts.map +0 -1
- package/lib/odspDelayLoadedDeltaStream.mjs.map +0 -1
- package/lib/odspDeltaStorageService.d.mts.map +0 -1
- package/lib/odspDeltaStorageService.mjs.map +0 -1
- package/lib/odspDocumentDeltaConnection.d.mts.map +0 -1
- package/lib/odspDocumentDeltaConnection.mjs.map +0 -1
- package/lib/odspDocumentService.d.mts.map +0 -1
- package/lib/odspDocumentService.mjs.map +0 -1
- package/lib/odspDocumentServiceFactory.d.mts.map +0 -1
- package/lib/odspDocumentServiceFactory.mjs.map +0 -1
- package/lib/odspDocumentServiceFactoryCore.d.mts.map +0 -1
- package/lib/odspDocumentServiceFactoryCore.mjs.map +0 -1
- package/lib/odspDocumentServiceFactoryWithCodeSplit.d.mts.map +0 -1
- package/lib/odspDocumentServiceFactoryWithCodeSplit.mjs.map +0 -1
- package/lib/odspDocumentStorageManager.d.mts.map +0 -1
- package/lib/odspDocumentStorageManager.mjs.map +0 -1
- package/lib/odspDocumentStorageServiceBase.d.mts.map +0 -1
- package/lib/odspDocumentStorageServiceBase.mjs.map +0 -1
- package/lib/odspDriverUrlResolver.d.mts.map +0 -1
- package/lib/odspDriverUrlResolver.mjs.map +0 -1
- package/lib/odspDriverUrlResolverForShareLink.d.mts.map +0 -1
- package/lib/odspDriverUrlResolverForShareLink.mjs.map +0 -1
- package/lib/odspError.d.mts.map +0 -1
- package/lib/odspError.mjs.map +0 -1
- package/lib/odspFluidFileLink.d.mts.map +0 -1
- package/lib/odspFluidFileLink.mjs.map +0 -1
- package/lib/odspLocationRedirection.d.mts.map +0 -1
- package/lib/odspLocationRedirection.mjs.map +0 -1
- package/lib/odspPublicUtils.d.mts.map +0 -1
- package/lib/odspPublicUtils.mjs.map +0 -1
- package/lib/odspSnapshotParser.d.mts.map +0 -1
- package/lib/odspSnapshotParser.mjs.map +0 -1
- package/lib/odspSummaryUploadManager.d.mts.map +0 -1
- package/lib/odspSummaryUploadManager.mjs.map +0 -1
- package/lib/odspUrlHelper.d.mts.map +0 -1
- package/lib/odspUrlHelper.mjs.map +0 -1
- package/lib/odspUtils.d.mts.map +0 -1
- package/lib/odspUtils.mjs.map +0 -1
- package/lib/opsCaching.d.mts.map +0 -1
- package/lib/opsCaching.mjs.map +0 -1
- package/lib/packageVersion.d.mts.map +0 -1
- package/lib/packageVersion.mjs.map +0 -1
- package/lib/prefetchLatestSnapshot.d.mts.map +0 -1
- package/lib/prefetchLatestSnapshot.mjs.map +0 -1
- package/lib/retryErrorsStorageAdapter.d.mts.map +0 -1
- package/lib/retryErrorsStorageAdapter.mjs.map +0 -1
- package/lib/retryUtils.d.mts.map +0 -1
- package/lib/retryUtils.mjs.map +0 -1
- package/lib/socketModule.d.mts.map +0 -1
- package/lib/socketModule.mjs.map +0 -1
- package/lib/vroom.d.mts.map +0 -1
- package/lib/vroom.mjs.map +0 -1
- package/lib/zipItDataRepresentationUtils.d.mts.map +0 -1
- package/lib/zipItDataRepresentationUtils.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"odspDocumentServiceFactoryWithCodeSplit.d.ts","sourceRoot":"","sources":["../src/odspDocumentServiceFactoryWithCodeSplit.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EACN,6BAA6B,EAC7B,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AAErF;;;;GAIG;AACH,qBAAa,uCACZ,SAAQ,8BACR,YAAW,uBAAuB;gBAGjC,eAAe,EAAE,YAAY,CAAC,6BAA6B,CAAC,EAC5D,iBAAiB,EAAE,YAAY,CAAC,6BAA6B,CAAC,GAAG,SAAS,EAC1E,cAAc,CAAC,EAAE,eAAe,EAChC,UAAU,CAAC,EAAE,iBAAiB;CAI/B"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { OdspDocumentServiceFactoryCore } from "./odspDocumentServiceFactoryCore.
|
|
5
|
+
import { OdspDocumentServiceFactoryCore } from "./odspDocumentServiceFactoryCore.js";
|
|
6
6
|
/**
|
|
7
7
|
* @deprecated This is deprecated in favour of OdspDocumentServiceFactory as the socket io is now loaded inside the
|
|
8
8
|
* other dynamically imported module.
|
|
@@ -13,4 +13,4 @@ export class OdspDocumentServiceFactoryWithCodeSplit extends OdspDocumentService
|
|
|
13
13
|
super(getStorageToken, getWebsocketToken, persistedCache, hostPolicy);
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
-
//# sourceMappingURL=odspDocumentServiceFactoryWithCodeSplit.
|
|
16
|
+
//# sourceMappingURL=odspDocumentServiceFactoryWithCodeSplit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"odspDocumentServiceFactoryWithCodeSplit.js","sourceRoot":"","sources":["../src/odspDocumentServiceFactoryWithCodeSplit.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AAErF;;;;GAIG;AACH,MAAM,OAAO,uCACZ,SAAQ,8BAA8B;IAGtC,YACC,eAA4D,EAC5D,iBAA0E,EAC1E,cAAgC,EAChC,UAA8B;QAE9B,KAAK,CAAC,eAAe,EAAE,iBAAiB,EAAE,cAAc,EAAE,UAAU,CAAC,CAAC;IACvE,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IDocumentServiceFactory } from \"@fluidframework/driver-definitions\";\nimport {\n\tOdspResourceTokenFetchOptions,\n\tTokenFetcher,\n\tIPersistedCache,\n\tHostStoragePolicy,\n} from \"@fluidframework/odsp-driver-definitions\";\nimport { OdspDocumentServiceFactoryCore } from \"./odspDocumentServiceFactoryCore.js\";\n\n/**\n * @deprecated This is deprecated in favour of OdspDocumentServiceFactory as the socket io is now loaded inside the\n * other dynamically imported module.\n * @internal\n */\nexport class OdspDocumentServiceFactoryWithCodeSplit\n\textends OdspDocumentServiceFactoryCore\n\timplements IDocumentServiceFactory\n{\n\tconstructor(\n\t\tgetStorageToken: TokenFetcher<OdspResourceTokenFetchOptions>,\n\t\tgetWebsocketToken: TokenFetcher<OdspResourceTokenFetchOptions> | undefined,\n\t\tpersistedCache?: IPersistedCache,\n\t\thostPolicy?: HostStoragePolicy,\n\t) {\n\t\tsuper(getStorageToken, getWebsocketToken, persistedCache, hostPolicy);\n\t}\n}\n"]}
|
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
|
|
6
6
|
import * as api from "@fluidframework/protocol-definitions";
|
|
7
|
-
import { ISummaryContext, FetchSource } from "@fluidframework/driver-definitions";
|
|
7
|
+
import { ISummaryContext, FetchSource, ISnapshot, ISnapshotFetchOptions } from "@fluidframework/driver-definitions";
|
|
8
8
|
import { IOdspResolvedUrl, InstrumentedStorageTokenFetcher } from "@fluidframework/odsp-driver-definitions";
|
|
9
|
-
import { HostStoragePolicyInternal } from "./contracts.
|
|
10
|
-
import { SnapshotFormatSupportType } from "./fetchSnapshot.
|
|
11
|
-
import { IOdspCache } from "./odspCache.
|
|
12
|
-
import { EpochTracker } from "./epochTracker.
|
|
13
|
-
import { FlushResult } from "./odspDocumentDeltaConnection.
|
|
14
|
-
import { OdspDocumentStorageServiceBase } from "./odspDocumentStorageServiceBase.
|
|
9
|
+
import { HostStoragePolicyInternal } from "./contracts.js";
|
|
10
|
+
import { SnapshotFormatSupportType } from "./fetchSnapshot.js";
|
|
11
|
+
import { IOdspCache } from "./odspCache.js";
|
|
12
|
+
import { EpochTracker } from "./epochTracker.js";
|
|
13
|
+
import { FlushResult } from "./odspDocumentDeltaConnection.js";
|
|
14
|
+
import { OdspDocumentStorageServiceBase } from "./odspDocumentStorageServiceBase.js";
|
|
15
15
|
export declare const defaultSummarizerCacheExpiryTimeout: number;
|
|
16
16
|
export declare class OdspDocumentStorageService extends OdspDocumentStorageServiceBase {
|
|
17
17
|
private readonly odspResolvedUrl;
|
|
@@ -27,7 +27,7 @@ export declare class OdspDocumentStorageService extends OdspDocumentStorageServi
|
|
|
27
27
|
private odspSummaryModuleLoaded;
|
|
28
28
|
private summaryModuleP;
|
|
29
29
|
private odspSummaryUploadManager;
|
|
30
|
-
private
|
|
30
|
+
private firstSnapshotFetchCall;
|
|
31
31
|
private _isFirstSnapshotFromNetwork;
|
|
32
32
|
private readonly documentId;
|
|
33
33
|
private readonly snapshotUrl;
|
|
@@ -46,9 +46,16 @@ export declare class OdspDocumentStorageService extends OdspDocumentStorageServi
|
|
|
46
46
|
createBlob(file: ArrayBufferLike): Promise<api.ICreateBlobResponse>;
|
|
47
47
|
protected fetchBlobFromStorage(blobId: string, evicted: boolean): Promise<ArrayBuffer>;
|
|
48
48
|
getSnapshotTree(version?: api.IVersion, scenarioName?: string): Promise<api.ISnapshotTree | null>;
|
|
49
|
-
|
|
49
|
+
/**
|
|
50
|
+
* Fetches and returns the snapshot. If no loadingGroupIds or empty loadingGroupIds is provided, then snapshot for all
|
|
51
|
+
* ungrouped data will be provided.
|
|
52
|
+
* @param snapshotFetchOptions - fetch options for snapshot.
|
|
53
|
+
*/
|
|
54
|
+
getSnapshot(snapshotFetchOptions?: ISnapshotFetchOptions): Promise<ISnapshot>;
|
|
50
55
|
private fetchSnapshot;
|
|
51
|
-
|
|
56
|
+
getVersions(blobid: string | null, count: number, scenarioName?: string, fetchSource?: FetchSource): Promise<api.IVersion[]>;
|
|
57
|
+
private fetchSnapshotFromNetwork;
|
|
58
|
+
private fetchSnapshotFromNetworkCore;
|
|
52
59
|
uploadSummaryWithContext(summary: api.ISummaryTree, context: ISummaryContext): Promise<string>;
|
|
53
60
|
private getDelayLoadedSummaryManager;
|
|
54
61
|
private checkSnapshotUrl;
|
|
@@ -56,4 +63,4 @@ export declare class OdspDocumentStorageService extends OdspDocumentStorageServi
|
|
|
56
63
|
private checkAttachmentGETUrl;
|
|
57
64
|
protected fetchTreeFromSnapshot(id: string, scenarioName?: string): Promise<api.ISnapshotTree | undefined>;
|
|
58
65
|
}
|
|
59
|
-
//# sourceMappingURL=odspDocumentStorageManager.d.
|
|
66
|
+
//# sourceMappingURL=odspDocumentStorageManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"odspDocumentStorageManager.d.ts","sourceRoot":"","sources":["../src/odspDocumentStorageManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEN,mBAAmB,EAKnB,MAAM,iCAAiC,CAAC;AAIzC,OAAO,KAAK,GAAG,MAAM,sCAAsC,CAAC;AAE5D,OAAO,EACN,eAAe,EACf,WAAW,EACX,SAAS,EACT,qBAAqB,EACrB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EACN,gBAAgB,EAGhB,+BAA+B,EAE/B,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAEN,yBAAyB,EAKzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAMN,yBAAyB,EACzB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,UAAU,EAA6B,MAAM,gBAAgB,CAAC;AASvE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAE/D,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AAErF,eAAO,MAAM,mCAAmC,EAAE,MAAkB,CAAC;AAOrE,qBAAa,0BAA2B,SAAQ,8BAA8B;IAwB5E,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAClC,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,8BAA8B;IAC/C,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAAC;IAhC1C,OAAO,CAAC,uBAAuB,CAAkB;IACjD,OAAO,CAAC,cAAc,CAAgD;IACtE,OAAO,CAAC,wBAAwB,CAAuC;IAEvE,OAAO,CAAC,sBAAsB,CAAQ;IACtC,OAAO,CAAC,2BAA2B,CAAsB;IACzD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAqB;IACjD,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAqB;IACvD,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAqB;IAEtD;;;;OAIG;IACH,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAa;IAClD,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAAU;IAGlD,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAsB;gBAG1C,eAAe,EAAE,gBAAgB,EACjC,eAAe,EAAE,+BAA+B,EAChD,MAAM,EAAE,mBAAmB,EAC3B,iBAAiB,EAAE,OAAO,EAC1B,KAAK,EAAE,UAAU,EACjB,UAAU,EAAE,yBAAyB,EACrC,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,EACzC,8BAA8B,EAAE,MAAM,MAAM,GAAG,SAAS,EACxD,uBAAuB,CAAC,uCAA2B;IAUrE,IAAW,0BAA0B,IAAI,OAAO,GAAG,SAAS,CAE3D;IAEY,UAAU,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC;cA2ChE,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC;IAgD/E,eAAe,CAC3B,OAAO,CAAC,EAAE,GAAG,CAAC,QAAQ,EACtB,YAAY,CAAC,EAAE,MAAM,GAEnB,OAAO,CAAC,GAAG,CAAC,aAAa,GAAG,IAAI,CAAC;IAQpC;;;;OAIG;IACU,WAAW,CAAC,oBAAoB,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,SAAS,CAAC;YAgB5E,aAAa;IAwMd,WAAW,CAEvB,MAAM,EAAE,MAAM,GAAG,IAAI,EACrB,KAAK,EAAE,MAAM,EACb,YAAY,CAAC,EAAE,MAAM,EACrB,WAAW,CAAC,EAAE,WAAW,GACvB,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;YA+EZ,wBAAwB;YAuBxB,4BAA4B;IAyI7B,wBAAwB,CACpC,OAAO,EAAE,GAAG,CAAC,YAAY,EACzB,OAAO,EAAE,eAAe,GACtB,OAAO,CAAC,MAAM,CAAC;YA4DJ,4BAA4B;IAwB1C,OAAO,CAAC,gBAAgB;IAUxB,OAAO,CAAC,sBAAsB;IAU9B,OAAO,CAAC,qBAAqB;cAUb,qBAAqB,CACpC,EAAE,EAAE,MAAM,EACV,YAAY,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,GAAG,CAAC,aAAa,GAAG,SAAS,CAAC;CA0CzC"}
|
|
@@ -7,14 +7,14 @@ import { performance } from "@fluid-internal/client-utils";
|
|
|
7
7
|
import { assert, delay } from "@fluidframework/core-utils";
|
|
8
8
|
import { LogLevel } from "@fluidframework/core-interfaces";
|
|
9
9
|
import { promiseRaceWithWinner } from "@fluidframework/driver-base";
|
|
10
|
-
import {
|
|
10
|
+
import { FetchSource, } from "@fluidframework/driver-definitions";
|
|
11
11
|
import { RateLimiter, NonRetryableError } from "@fluidframework/driver-utils";
|
|
12
|
-
import {
|
|
13
|
-
import { downloadSnapshot, evalBlobsAndTrees, fetchSnapshot, fetchSnapshotWithRedeem, } from "./fetchSnapshot.
|
|
14
|
-
import { getUrlAndHeadersWithAuth } from "./getUrlAndHeadersWithAuth.
|
|
15
|
-
import { createCacheSnapshotKey, getWithRetryForTokenRefresh } from "./odspUtils.
|
|
16
|
-
import { pkgVersion as driverVersion } from "./packageVersion.
|
|
17
|
-
import { OdspDocumentStorageServiceBase } from "./odspDocumentStorageServiceBase.
|
|
12
|
+
import { OdspErrorTypes, getKeyForCacheEntry, } from "@fluidframework/odsp-driver-definitions";
|
|
13
|
+
import { downloadSnapshot, evalBlobsAndTrees, fetchSnapshot, fetchSnapshotWithRedeem, } from "./fetchSnapshot.js";
|
|
14
|
+
import { getUrlAndHeadersWithAuth } from "./getUrlAndHeadersWithAuth.js";
|
|
15
|
+
import { createCacheSnapshotKey, getWithRetryForTokenRefresh, isInstanceOfISnapshot, isSnapshotFetchForLoadingGroup, useLegacyFlowWithoutGroupsForSnapshotFetch, } from "./odspUtils.js";
|
|
16
|
+
import { pkgVersion as driverVersion } from "./packageVersion.js";
|
|
17
|
+
import { OdspDocumentStorageServiceBase } from "./odspDocumentStorageServiceBase.js";
|
|
18
18
|
export const defaultSummarizerCacheExpiryTimeout = 60 * 1000; // 60 seconds.
|
|
19
19
|
export class OdspDocumentStorageService extends OdspDocumentStorageServiceBase {
|
|
20
20
|
constructor(odspResolvedUrl, getStorageToken, logger, fetchFullSnapshot, cache, hostPolicy, epochTracker, flushCallback, relayServiceTenantAndSessionId, snapshotFormatFetchType) {
|
|
@@ -30,7 +30,7 @@ export class OdspDocumentStorageService extends OdspDocumentStorageServiceBase {
|
|
|
30
30
|
this.relayServiceTenantAndSessionId = relayServiceTenantAndSessionId;
|
|
31
31
|
this.snapshotFormatFetchType = snapshotFormatFetchType;
|
|
32
32
|
this.odspSummaryModuleLoaded = false;
|
|
33
|
-
this.
|
|
33
|
+
this.firstSnapshotFetchCall = true;
|
|
34
34
|
// Driver specified limits for snapshot size and time.
|
|
35
35
|
/**
|
|
36
36
|
* NOTE: While commit cfff6e3 added restrictions to prevent large payloads, snapshot failures will continue to
|
|
@@ -84,7 +84,7 @@ export class OdspDocumentStorageService extends OdspDocumentStorageServiceBase {
|
|
|
84
84
|
eventName: "readDataBlob",
|
|
85
85
|
blobId,
|
|
86
86
|
evicted,
|
|
87
|
-
headers: Object.keys(headers).length
|
|
87
|
+
headers: Object.keys(headers).length > 0 ? true : undefined,
|
|
88
88
|
waitQueueLength: this.epochTracker.rateLimiter.waitQueueLength,
|
|
89
89
|
}, async (event) => {
|
|
90
90
|
const res = await this.epochTracker.fetchArray(url, { headers }, "blob");
|
|
@@ -111,10 +111,186 @@ export class OdspDocumentStorageService extends OdspDocumentStorageServiceBase {
|
|
|
111
111
|
}
|
|
112
112
|
async getSnapshotTree(version, scenarioName) {
|
|
113
113
|
if (!this.snapshotUrl) {
|
|
114
|
+
// eslint-disable-next-line unicorn/no-null
|
|
114
115
|
return null;
|
|
115
116
|
}
|
|
116
117
|
return super.getSnapshotTree(version, scenarioName);
|
|
117
118
|
}
|
|
119
|
+
/**
|
|
120
|
+
* Fetches and returns the snapshot. If no loadingGroupIds or empty loadingGroupIds is provided, then snapshot for all
|
|
121
|
+
* ungrouped data will be provided.
|
|
122
|
+
* @param snapshotFetchOptions - fetch options for snapshot.
|
|
123
|
+
*/
|
|
124
|
+
async getSnapshot(snapshotFetchOptions) {
|
|
125
|
+
// Don't consult cache if request is not for a particular loading group.
|
|
126
|
+
const { snapshot } = await this.fetchSnapshot({
|
|
127
|
+
...snapshotFetchOptions,
|
|
128
|
+
fetchSource: isSnapshotFetchForLoadingGroup(snapshotFetchOptions?.loadingGroupIds)
|
|
129
|
+
? FetchSource.noCache
|
|
130
|
+
: snapshotFetchOptions?.fetchSource,
|
|
131
|
+
loadingGroupIds: snapshotFetchOptions?.loadingGroupIds ?? [],
|
|
132
|
+
});
|
|
133
|
+
return {
|
|
134
|
+
...snapshot,
|
|
135
|
+
snapshotTree: this.combineProtocolAndAppSnapshotTree(snapshot.snapshotTree),
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
async fetchSnapshot(snapshotFetchOptions) {
|
|
139
|
+
const hostSnapshotOptions = this.hostPolicy.snapshotOptions;
|
|
140
|
+
const odspSnapshotCacheValue = await PerformanceEvent.timedExecAsync(this.logger, {
|
|
141
|
+
eventName: isSnapshotFetchForLoadingGroup(snapshotFetchOptions.loadingGroupIds)
|
|
142
|
+
? "ObtainSnapshotForGroup"
|
|
143
|
+
: "ObtainSnapshot",
|
|
144
|
+
fetchSource: snapshotFetchOptions?.fetchSource,
|
|
145
|
+
}, async (event) => {
|
|
146
|
+
const props = {};
|
|
147
|
+
let cacheLookupTimeInSerialFetch = 0;
|
|
148
|
+
let retrievedSnapshot;
|
|
149
|
+
let method;
|
|
150
|
+
let prefetchWaitStartTime = performance.now();
|
|
151
|
+
if (snapshotFetchOptions.fetchSource === FetchSource.noCache) {
|
|
152
|
+
retrievedSnapshot = await this.fetchSnapshotFromNetwork(hostSnapshotOptions, snapshotFetchOptions.loadingGroupIds, snapshotFetchOptions.scenarioName);
|
|
153
|
+
method = "networkOnly";
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
// Here's the logic to grab the persistent cache snapshot implemented by the host
|
|
157
|
+
// Epoch tracker is responsible for communicating with the persistent cache, handling epochs and cache versions
|
|
158
|
+
const cachedSnapshotP = this.epochTracker
|
|
159
|
+
.get(createCacheSnapshotKey(this.odspResolvedUrl))
|
|
160
|
+
.then(async (
|
|
161
|
+
// eslint-disable-next-line import/no-deprecated
|
|
162
|
+
snapshotCachedEntry) => {
|
|
163
|
+
if (snapshotCachedEntry !== undefined) {
|
|
164
|
+
// If the cached entry does not contain the entry time, then assign it a default of 30 days old.
|
|
165
|
+
const age = Date.now() -
|
|
166
|
+
(snapshotCachedEntry.cacheEntryTime ??
|
|
167
|
+
Date.now() - 30 * 24 * 60 * 60 * 1000);
|
|
168
|
+
// In order to decrease the number of times we have to execute a snapshot refresh,
|
|
169
|
+
// if this is the summarizer and we have a cache entry but it is past the defaultSummarizerCacheExpiryTimeout,
|
|
170
|
+
// force the network retrieval instead as there might be a more recent snapshot available.
|
|
171
|
+
// See: https://github.com/microsoft/FluidFramework/issues/8995 for additional information.
|
|
172
|
+
if (this.hostPolicy.summarizerClient) {
|
|
173
|
+
if (age > defaultSummarizerCacheExpiryTimeout) {
|
|
174
|
+
props.cacheSummarizerExpired = true;
|
|
175
|
+
return undefined;
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
props.cacheSummarizerExpired = false;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
// Record the cache age
|
|
182
|
+
props.cacheEntryAge = age;
|
|
183
|
+
// Snapshot from cache could be in older format, so transform that before returning.
|
|
184
|
+
if (isInstanceOfISnapshot(snapshotCachedEntry)) {
|
|
185
|
+
return snapshotCachedEntry;
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
const snapshot = {
|
|
189
|
+
snapshotTree: snapshotCachedEntry.snapshotTree,
|
|
190
|
+
blobContents: snapshotCachedEntry.blobs,
|
|
191
|
+
ops: snapshotCachedEntry.ops,
|
|
192
|
+
latestSequenceNumber: snapshotCachedEntry.latestSequenceNumber,
|
|
193
|
+
sequenceNumber: snapshotCachedEntry.sequenceNumber,
|
|
194
|
+
snapshotFormatV: 1,
|
|
195
|
+
};
|
|
196
|
+
return snapshot;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
// Based on the concurrentSnapshotFetch policy:
|
|
201
|
+
// Either retrieve both the network and cache snapshots concurrently and pick the first to return,
|
|
202
|
+
// or grab the cache value and then the network value if the cache value returns undefined.
|
|
203
|
+
// For summarizer which could call this during refreshing of summary parent, always use the cache
|
|
204
|
+
// first. Also for other clients, if it is not critical path which is determined by firstSnapshotFetchCall,
|
|
205
|
+
// then also check the cache first.
|
|
206
|
+
if (this.firstSnapshotFetchCall &&
|
|
207
|
+
this.hostPolicy.concurrentSnapshotFetch &&
|
|
208
|
+
!this.hostPolicy.summarizerClient) {
|
|
209
|
+
const networkSnapshotP = this.fetchSnapshotFromNetwork(hostSnapshotOptions, snapshotFetchOptions.loadingGroupIds, snapshotFetchOptions.scenarioName);
|
|
210
|
+
// Ensure that failures on both paths are ignored initially.
|
|
211
|
+
// I.e. if cache fails for some reason, we will proceed with network result.
|
|
212
|
+
// And vice versa - if (for example) client is offline and network request fails first, we
|
|
213
|
+
// do want to attempt to succeed with cached data!
|
|
214
|
+
const promiseRaceWinner = await promiseRaceWithWinner([
|
|
215
|
+
cachedSnapshotP.catch(() => undefined),
|
|
216
|
+
networkSnapshotP.catch(() => undefined),
|
|
217
|
+
]);
|
|
218
|
+
retrievedSnapshot = promiseRaceWinner.value;
|
|
219
|
+
method = promiseRaceWinner.index === 0 ? "cache" : "network";
|
|
220
|
+
if (retrievedSnapshot === undefined) {
|
|
221
|
+
// if network failed -> wait for cache ( then return network failure)
|
|
222
|
+
// If cache returned empty or failed -> wait for network (success of failure)
|
|
223
|
+
try {
|
|
224
|
+
if (promiseRaceWinner.index === 1) {
|
|
225
|
+
retrievedSnapshot = await cachedSnapshotP;
|
|
226
|
+
method = "cache";
|
|
227
|
+
}
|
|
228
|
+
if (retrievedSnapshot === undefined) {
|
|
229
|
+
retrievedSnapshot = await networkSnapshotP;
|
|
230
|
+
method = "network";
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
catch (error) {
|
|
234
|
+
// The call stacks of any errors thrown by cached snapshot or network snapshot aren't very useful:
|
|
235
|
+
// they get truncated at this stack frame due to the promise race and how v8 tracks async stack traces--
|
|
236
|
+
// see https://v8.dev/docs/stack-trace-api#async-stack-traces and the "zero-cost async stack traces" document
|
|
237
|
+
// linked there. https://v8.dev/blog/fast-async#await-under-the-hood may also be helpful for context on internals.
|
|
238
|
+
// Regenerating the stack at this level provides more information for logged errors.
|
|
239
|
+
// Once FF uses an ES2021 target, we could convert the above promise race to use `Promise.any` + AggregateError and
|
|
240
|
+
// get similar quality stacks with less hand-crafted code.
|
|
241
|
+
const innerStack = error.stack;
|
|
242
|
+
const normalizedError = normalizeError(error);
|
|
243
|
+
normalizedError.addTelemetryProperties({ innerStack });
|
|
244
|
+
const newStack = `<<STACK TRUNCATED: see innerStack property>> \n${generateStack()}`;
|
|
245
|
+
overwriteStack(normalizedError, newStack);
|
|
246
|
+
throw normalizedError;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
else {
|
|
251
|
+
// Note: There's a race condition here - another caller may come past the undefined check
|
|
252
|
+
// while the first caller is awaiting later async code in this block.
|
|
253
|
+
const startTime = performance.now();
|
|
254
|
+
retrievedSnapshot = await cachedSnapshotP;
|
|
255
|
+
cacheLookupTimeInSerialFetch = performance.now() - startTime;
|
|
256
|
+
method = retrievedSnapshot === undefined ? "network" : "cache";
|
|
257
|
+
if (retrievedSnapshot === undefined) {
|
|
258
|
+
prefetchWaitStartTime = performance.now();
|
|
259
|
+
retrievedSnapshot = await this.fetchSnapshotFromNetwork(hostSnapshotOptions, snapshotFetchOptions.loadingGroupIds, snapshotFetchOptions.scenarioName);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
if (method === "network") {
|
|
264
|
+
props.cacheEntryAge = undefined;
|
|
265
|
+
}
|
|
266
|
+
if (this.firstSnapshotFetchCall) {
|
|
267
|
+
this._isFirstSnapshotFromNetwork = method === "cache" ? false : true;
|
|
268
|
+
}
|
|
269
|
+
const prefetchStartTime = retrievedSnapshot.prefetchStartTime;
|
|
270
|
+
event.end({
|
|
271
|
+
...props,
|
|
272
|
+
method,
|
|
273
|
+
fetchSnapshotForInitialLoad: this.firstSnapshotFetchCall,
|
|
274
|
+
useLegacyFlowWithoutGroups: useLegacyFlowWithoutGroupsForSnapshotFetch(snapshotFetchOptions.loadingGroupIds),
|
|
275
|
+
avoidPrefetchSnapshotCache: this.hostPolicy.avoidPrefetchSnapshotCache,
|
|
276
|
+
...evalBlobsAndTrees(retrievedSnapshot),
|
|
277
|
+
cacheLookupTimeInSerialFetch,
|
|
278
|
+
prefetchSavedDuration: prefetchStartTime !== undefined && method !== "cache"
|
|
279
|
+
? prefetchWaitStartTime - prefetchStartTime
|
|
280
|
+
: undefined,
|
|
281
|
+
});
|
|
282
|
+
return retrievedSnapshot;
|
|
283
|
+
});
|
|
284
|
+
const stTime = performance.now();
|
|
285
|
+
// Don't override ops which were fetched during initial load, since we could still need them.
|
|
286
|
+
const id = this.initializeFromSnapshot(odspSnapshotCacheValue, this.firstSnapshotFetchCall, snapshotFetchOptions?.cacheSnapshot ?? this.firstSnapshotFetchCall);
|
|
287
|
+
this.logger.sendTelemetryEvent({
|
|
288
|
+
eventName: "SnapshotInitializeTime",
|
|
289
|
+
duration: performance.now() - stTime,
|
|
290
|
+
}, undefined, LogLevel.verbose);
|
|
291
|
+
this.firstSnapshotFetchCall = false;
|
|
292
|
+
return { snapshot: odspSnapshotCacheValue, id };
|
|
293
|
+
}
|
|
118
294
|
async getVersions(
|
|
119
295
|
// eslint-disable-next-line @rushstack/no-new-null
|
|
120
296
|
blobid, count, scenarioName, fetchSource) {
|
|
@@ -137,136 +313,12 @@ export class OdspDocumentStorageService extends OdspDocumentStorageServiceBase {
|
|
|
137
313
|
}
|
|
138
314
|
// 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
|
|
139
315
|
if (count === 1 && (blobid === null || blobid === this.documentId)) {
|
|
140
|
-
const
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
let method;
|
|
146
|
-
let prefetchWaitStartTime = performance.now();
|
|
147
|
-
if (fetchSource === FetchSource.noCache) {
|
|
148
|
-
retrievedSnapshot = await this.fetchSnapshot(hostSnapshotOptions, scenarioName);
|
|
149
|
-
method = "networkOnly";
|
|
150
|
-
}
|
|
151
|
-
else {
|
|
152
|
-
// Here's the logic to grab the persistent cache snapshot implemented by the host
|
|
153
|
-
// Epoch tracker is responsible for communicating with the persistent cache, handling epochs and cache versions
|
|
154
|
-
const cachedSnapshotP = this.epochTracker
|
|
155
|
-
.get(createCacheSnapshotKey(this.odspResolvedUrl))
|
|
156
|
-
.then(async (snapshotCachedEntry) => {
|
|
157
|
-
if (snapshotCachedEntry !== undefined) {
|
|
158
|
-
// If the cached entry does not contain the entry time, then assign it a default of 30 days old.
|
|
159
|
-
const age = Date.now() -
|
|
160
|
-
(snapshotCachedEntry.cacheEntryTime ??
|
|
161
|
-
Date.now() - 30 * 24 * 60 * 60 * 1000);
|
|
162
|
-
// In order to decrease the number of times we have to execute a snapshot refresh,
|
|
163
|
-
// if this is the summarizer and we have a cache entry but it is past the defaultSummarizerCacheExpiryTimeout,
|
|
164
|
-
// force the network retrieval instead as there might be a more recent snapshot available.
|
|
165
|
-
// See: https://github.com/microsoft/FluidFramework/issues/8995 for additional information.
|
|
166
|
-
if (this.hostPolicy.summarizerClient) {
|
|
167
|
-
if (age > defaultSummarizerCacheExpiryTimeout) {
|
|
168
|
-
props.cacheSummarizerExpired = true;
|
|
169
|
-
return undefined;
|
|
170
|
-
}
|
|
171
|
-
else {
|
|
172
|
-
props.cacheSummarizerExpired = false;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
// Record the cache age
|
|
176
|
-
props.cacheEntryAge = age;
|
|
177
|
-
}
|
|
178
|
-
return snapshotCachedEntry;
|
|
179
|
-
});
|
|
180
|
-
// Based on the concurrentSnapshotFetch policy:
|
|
181
|
-
// Either retrieve both the network and cache snapshots concurrently and pick the first to return,
|
|
182
|
-
// or grab the cache value and then the network value if the cache value returns undefined.
|
|
183
|
-
// For summarizer which could call this during refreshing of summary parent, always use the cache
|
|
184
|
-
// first. Also for other clients, if it is not critical path which is determined by firstVersionCall,
|
|
185
|
-
// then also check the cache first.
|
|
186
|
-
if (this.firstVersionCall &&
|
|
187
|
-
this.hostPolicy.concurrentSnapshotFetch &&
|
|
188
|
-
!this.hostPolicy.summarizerClient) {
|
|
189
|
-
const networkSnapshotP = this.fetchSnapshot(hostSnapshotOptions, scenarioName);
|
|
190
|
-
// Ensure that failures on both paths are ignored initially.
|
|
191
|
-
// I.e. if cache fails for some reason, we will proceed with network result.
|
|
192
|
-
// And vice versa - if (for example) client is offline and network request fails first, we
|
|
193
|
-
// do want to attempt to succeed with cached data!
|
|
194
|
-
const promiseRaceWinner = await promiseRaceWithWinner([
|
|
195
|
-
cachedSnapshotP.catch(() => undefined),
|
|
196
|
-
networkSnapshotP.catch(() => undefined),
|
|
197
|
-
]);
|
|
198
|
-
retrievedSnapshot = promiseRaceWinner.value;
|
|
199
|
-
method = promiseRaceWinner.index === 0 ? "cache" : "network";
|
|
200
|
-
if (retrievedSnapshot === undefined) {
|
|
201
|
-
// if network failed -> wait for cache ( then return network failure)
|
|
202
|
-
// If cache returned empty or failed -> wait for network (success of failure)
|
|
203
|
-
try {
|
|
204
|
-
if (promiseRaceWinner.index === 1) {
|
|
205
|
-
retrievedSnapshot = await cachedSnapshotP;
|
|
206
|
-
method = "cache";
|
|
207
|
-
}
|
|
208
|
-
if (retrievedSnapshot === undefined) {
|
|
209
|
-
retrievedSnapshot = await networkSnapshotP;
|
|
210
|
-
method = "network";
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
catch (err) {
|
|
214
|
-
// The call stacks of any errors thrown by cached snapshot or network snapshot aren't very useful:
|
|
215
|
-
// they get truncated at this stack frame due to the promise race and how v8 tracks async stack traces--
|
|
216
|
-
// see https://v8.dev/docs/stack-trace-api#async-stack-traces and the "zero-cost async stack traces" document
|
|
217
|
-
// linked there. https://v8.dev/blog/fast-async#await-under-the-hood may also be helpful for context on internals.
|
|
218
|
-
// Regenerating the stack at this level provides more information for logged errors.
|
|
219
|
-
// Once FF uses an ES2021 target, we could convert the above promise race to use `Promise.any` + AggregateError and
|
|
220
|
-
// get similar quality stacks with less hand-crafted code.
|
|
221
|
-
const innerStack = err.stack;
|
|
222
|
-
const normalizedError = normalizeError(err);
|
|
223
|
-
normalizedError.addTelemetryProperties({ innerStack });
|
|
224
|
-
const newStack = `<<STACK TRUNCATED: see innerStack property>> \n${generateStack()}`;
|
|
225
|
-
overwriteStack(normalizedError, newStack);
|
|
226
|
-
throw normalizedError;
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
else {
|
|
231
|
-
// Note: There's a race condition here - another caller may come past the undefined check
|
|
232
|
-
// while the first caller is awaiting later async code in this block.
|
|
233
|
-
const startTime = performance.now();
|
|
234
|
-
retrievedSnapshot = await cachedSnapshotP;
|
|
235
|
-
cacheLookupTimeInSerialFetch = performance.now() - startTime;
|
|
236
|
-
method = retrievedSnapshot !== undefined ? "cache" : "network";
|
|
237
|
-
if (retrievedSnapshot === undefined) {
|
|
238
|
-
prefetchWaitStartTime = performance.now();
|
|
239
|
-
retrievedSnapshot = await this.fetchSnapshot(hostSnapshotOptions, scenarioName);
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
if (method === "network") {
|
|
244
|
-
props.cacheEntryAge = undefined;
|
|
245
|
-
}
|
|
246
|
-
if (this.firstVersionCall) {
|
|
247
|
-
this._isFirstSnapshotFromNetwork = method === "cache" ? false : true;
|
|
248
|
-
}
|
|
249
|
-
const prefetchStartTime = retrievedSnapshot.prefetchStartTime;
|
|
250
|
-
event.end({
|
|
251
|
-
...props,
|
|
252
|
-
method,
|
|
253
|
-
avoidPrefetchSnapshotCache: this.hostPolicy.avoidPrefetchSnapshotCache,
|
|
254
|
-
...evalBlobsAndTrees(retrievedSnapshot),
|
|
255
|
-
cacheLookupTimeInSerialFetch,
|
|
256
|
-
prefetchSavedDuration: prefetchStartTime !== undefined && method !== "cache"
|
|
257
|
-
? prefetchWaitStartTime - prefetchStartTime
|
|
258
|
-
: undefined,
|
|
259
|
-
});
|
|
260
|
-
return retrievedSnapshot;
|
|
316
|
+
const { id } = await this.fetchSnapshot({
|
|
317
|
+
cacheSnapshot: true,
|
|
318
|
+
scenarioName,
|
|
319
|
+
versionId: blobid ?? undefined,
|
|
320
|
+
fetchSource,
|
|
261
321
|
});
|
|
262
|
-
const stTime = performance.now();
|
|
263
|
-
// Don't override ops which were fetched during initial load, since we could still need them.
|
|
264
|
-
const id = this.initializeFromSnapshot(odspSnapshotCacheValue, this.firstVersionCall);
|
|
265
|
-
this.logger.sendTelemetryEvent({
|
|
266
|
-
eventName: "SnapshotInitializeTime",
|
|
267
|
-
duration: performance.now() - stTime,
|
|
268
|
-
}, undefined, LogLevel.verbose);
|
|
269
|
-
this.firstVersionCall = false;
|
|
270
322
|
return id ? [{ id, treeId: undefined }] : [];
|
|
271
323
|
}
|
|
272
324
|
return getWithRetryForTokenRefresh(async (options) => {
|
|
@@ -275,14 +327,14 @@ export class OdspDocumentStorageService extends OdspDocumentStorageServiceBase {
|
|
|
275
327
|
// Fetch the latest snapshot versions for the document
|
|
276
328
|
const response = await PerformanceEvent.timedExecAsync(this.logger, {
|
|
277
329
|
eventName: "getVersions",
|
|
278
|
-
headers: Object.keys(headers).length
|
|
330
|
+
headers: Object.keys(headers).length > 0 ? true : undefined,
|
|
279
331
|
}, async () => this.epochTracker.fetchAndParseAsJSON(url, { headers }, "versions", undefined, scenarioName));
|
|
280
332
|
const versionsResponse = response.content;
|
|
281
333
|
if (!versionsResponse) {
|
|
282
|
-
throw new NonRetryableError("No response from /versions endpoint",
|
|
334
|
+
throw new NonRetryableError("No response from /versions endpoint", OdspErrorTypes.genericNetworkError, { driverVersion });
|
|
283
335
|
}
|
|
284
336
|
if (!Array.isArray(versionsResponse.value)) {
|
|
285
|
-
throw new NonRetryableError("Incorrect response from /versions endpoint, expected an array",
|
|
337
|
+
throw new NonRetryableError("Incorrect response from /versions endpoint, expected an array", OdspErrorTypes.genericNetworkError, { driverVersion });
|
|
286
338
|
}
|
|
287
339
|
return versionsResponse.value.map((version) => {
|
|
288
340
|
return {
|
|
@@ -292,22 +344,24 @@ export class OdspDocumentStorageService extends OdspDocumentStorageServiceBase {
|
|
|
292
344
|
});
|
|
293
345
|
});
|
|
294
346
|
}
|
|
295
|
-
async
|
|
296
|
-
return this.
|
|
347
|
+
async fetchSnapshotFromNetwork(hostSnapshotOptions, loadingGroupIds, scenarioName) {
|
|
348
|
+
return this.fetchSnapshotFromNetworkCore(hostSnapshotOptions, loadingGroupIds, scenarioName).catch((error) => {
|
|
297
349
|
// Issue #5895:
|
|
298
350
|
// If we are offline, this error is retryable. But that means that RetriableDocumentStorageService
|
|
299
351
|
// will run in circles calling getSnapshotTree, which would result in OdspDocumentStorageService class
|
|
300
352
|
// going getVersions / individual blob download path. This path is very slow, and will not work with
|
|
301
353
|
// delay-loaded data stores and ODSP storage deleting old snapshots and blobs.
|
|
302
354
|
if (typeof error === "object" && error !== null) {
|
|
355
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
303
356
|
error.canRetry = false;
|
|
304
357
|
}
|
|
305
358
|
throw error;
|
|
306
359
|
});
|
|
307
360
|
}
|
|
308
|
-
async
|
|
309
|
-
// Don't look into cache, if the host specifically tells us so.
|
|
310
|
-
|
|
361
|
+
async fetchSnapshotFromNetworkCore(hostSnapshotOptions, loadingGroupIds, scenarioName) {
|
|
362
|
+
// Don't look into cache, if the host specifically tells us so. Also, if request is
|
|
363
|
+
// for initial snapshot, don't consult the prefetch cache.
|
|
364
|
+
if (!this.hostPolicy.avoidPrefetchSnapshotCache && this.firstSnapshotFetchCall) {
|
|
311
365
|
const prefetchCacheKey = getKeyForCacheEntry(createCacheSnapshotKey(this.odspResolvedUrl));
|
|
312
366
|
const result = await this.cache.snapshotPrefetchResultCache
|
|
313
367
|
?.get(prefetchCacheKey)
|
|
@@ -318,11 +372,11 @@ export class OdspDocumentStorageService extends OdspDocumentStorageServiceBase {
|
|
|
318
372
|
await this.epochTracker.validateEpoch(response.fluidEpoch, "treesLatest");
|
|
319
373
|
return response;
|
|
320
374
|
})
|
|
321
|
-
.catch(async (
|
|
375
|
+
.catch(async (error) => {
|
|
322
376
|
this.logger.sendTelemetryEvent({
|
|
323
377
|
eventName: "PrefetchSnapshotError",
|
|
324
378
|
concurrentSnapshotFetch: this.hostPolicy.concurrentSnapshotFetch,
|
|
325
|
-
},
|
|
379
|
+
}, error);
|
|
326
380
|
return undefined;
|
|
327
381
|
});
|
|
328
382
|
// If the prefetch call, is successful, then return the contents otherwise as backup for now, just
|
|
@@ -343,8 +397,8 @@ export class OdspDocumentStorageService extends OdspDocumentStorageServiceBase {
|
|
|
343
397
|
snapshotOptions.mds = undefined;
|
|
344
398
|
snapshotOptions.timeout = undefined;
|
|
345
399
|
}
|
|
346
|
-
const snapshotDownloader = async (finalOdspResolvedUrl, storageToken, options, controller) => {
|
|
347
|
-
return downloadSnapshot(finalOdspResolvedUrl, storageToken,
|
|
400
|
+
const snapshotDownloader = async (finalOdspResolvedUrl, storageToken, loadingGroupId, options, controller) => {
|
|
401
|
+
return downloadSnapshot(finalOdspResolvedUrl, storageToken, loadingGroupId, options, this.snapshotFormatFetchType, controller, this.epochTracker, scenarioName);
|
|
348
402
|
};
|
|
349
403
|
const putInCache = async (valueWithEpoch) => {
|
|
350
404
|
return this.cache.persistedCache.put(createCacheSnapshotKey(this.odspResolvedUrl),
|
|
@@ -353,23 +407,26 @@ export class OdspDocumentStorageService extends OdspDocumentStorageServiceBase {
|
|
|
353
407
|
};
|
|
354
408
|
const removeEntries = async () => this.cache.persistedCache.removeEntries();
|
|
355
409
|
try {
|
|
356
|
-
const odspSnapshot = await fetchSnapshotWithRedeem(this.odspResolvedUrl, this.getStorageToken, snapshotOptions, !!this.hostPolicy.sessionOptions?.forceAccessTokenViaAuthorizationHeader, this.logger, snapshotDownloader, putInCache, removeEntries, this.hostPolicy.enableRedeemFallback);
|
|
410
|
+
const odspSnapshot = await fetchSnapshotWithRedeem(this.odspResolvedUrl, this.getStorageToken, snapshotOptions, !!this.hostPolicy.sessionOptions?.forceAccessTokenViaAuthorizationHeader, this.logger, snapshotDownloader, putInCache, removeEntries, loadingGroupIds, this.hostPolicy.enableRedeemFallback);
|
|
357
411
|
return odspSnapshot;
|
|
412
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
358
413
|
}
|
|
359
414
|
catch (error) {
|
|
415
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
|
|
360
416
|
const errorType = error.errorType;
|
|
361
417
|
// 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.
|
|
362
|
-
if (errorType ===
|
|
418
|
+
if (errorType === OdspErrorTypes.snapshotTooBig &&
|
|
363
419
|
hostSnapshotOptions?.mds !== undefined &&
|
|
364
420
|
this.hostPolicy.summarizerClient !== true) {
|
|
365
421
|
throw error;
|
|
366
422
|
}
|
|
367
423
|
// If the first snapshot request was with blobs and we either timed out or the size was too big, then try to fetch without blobs.
|
|
368
|
-
if ((errorType ===
|
|
369
|
-
errorType ===
|
|
424
|
+
if ((errorType === OdspErrorTypes.snapshotTooBig ||
|
|
425
|
+
errorType === OdspErrorTypes.fetchTimeout) &&
|
|
370
426
|
snapshotOptions.blobs) {
|
|
371
427
|
this.logger.sendErrorEvent({
|
|
372
428
|
eventName: "TreeLatest_SecondCall",
|
|
429
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
373
430
|
errorType,
|
|
374
431
|
});
|
|
375
432
|
const snapshotOptionsWithoutBlobs = {
|
|
@@ -378,7 +435,7 @@ export class OdspDocumentStorageService extends OdspDocumentStorageServiceBase {
|
|
|
378
435
|
mds: undefined,
|
|
379
436
|
timeout: undefined,
|
|
380
437
|
};
|
|
381
|
-
const odspSnapshot = await fetchSnapshotWithRedeem(this.odspResolvedUrl, this.getStorageToken, snapshotOptionsWithoutBlobs, !!this.hostPolicy.sessionOptions?.forceAccessTokenViaAuthorizationHeader, this.logger, snapshotDownloader, putInCache, removeEntries, this.hostPolicy.enableRedeemFallback);
|
|
438
|
+
const odspSnapshot = await fetchSnapshotWithRedeem(this.odspResolvedUrl, this.getStorageToken, snapshotOptionsWithoutBlobs, !!this.hostPolicy.sessionOptions?.forceAccessTokenViaAuthorizationHeader, this.logger, snapshotDownloader, putInCache, removeEntries, loadingGroupIds, this.hostPolicy.enableRedeemFallback);
|
|
382
439
|
return odspSnapshot;
|
|
383
440
|
}
|
|
384
441
|
throw error;
|
|
@@ -435,7 +492,9 @@ export class OdspDocumentStorageService extends OdspDocumentStorageServiceBase {
|
|
|
435
492
|
}
|
|
436
493
|
async getDelayLoadedSummaryManager() {
|
|
437
494
|
assert(this.odspSummaryModuleLoaded === false, 0x56f /* Should be loaded only once */);
|
|
438
|
-
const module = await import(
|
|
495
|
+
const module = await import(
|
|
496
|
+
/* webpackChunkName: "summaryModule" */ "./odspSummaryUploadManager.js")
|
|
497
|
+
.then((m) => {
|
|
439
498
|
this.logger.sendTelemetryEvent({ eventName: "SummaryModuleLoaded" });
|
|
440
499
|
return m;
|
|
441
500
|
})
|
|
@@ -448,17 +507,17 @@ export class OdspDocumentStorageService extends OdspDocumentStorageServiceBase {
|
|
|
448
507
|
}
|
|
449
508
|
checkSnapshotUrl() {
|
|
450
509
|
if (!this.snapshotUrl) {
|
|
451
|
-
throw new NonRetryableError("Method failed because no snapshot url was available",
|
|
510
|
+
throw new NonRetryableError("Method failed because no snapshot url was available", OdspErrorTypes.genericError, { driverVersion });
|
|
452
511
|
}
|
|
453
512
|
}
|
|
454
513
|
checkAttachmentPOSTUrl() {
|
|
455
514
|
if (!this.attachmentPOSTUrl) {
|
|
456
|
-
throw new NonRetryableError("Method failed because no attachment POST url was available",
|
|
515
|
+
throw new NonRetryableError("Method failed because no attachment POST url was available", OdspErrorTypes.genericError, { driverVersion });
|
|
457
516
|
}
|
|
458
517
|
}
|
|
459
518
|
checkAttachmentGETUrl() {
|
|
460
519
|
if (!this.attachmentGETUrl) {
|
|
461
|
-
throw new NonRetryableError("Method failed because no attachment GET url was available",
|
|
520
|
+
throw new NonRetryableError("Method failed because no attachment GET url was available", OdspErrorTypes.genericError, { driverVersion });
|
|
462
521
|
}
|
|
463
522
|
}
|
|
464
523
|
async fetchTreeFromSnapshot(id, scenarioName) {
|
|
@@ -474,8 +533,8 @@ export class OdspDocumentStorageService extends OdspDocumentStorageServiceBase {
|
|
|
474
533
|
treeId = snapshot.snapshotTree.id;
|
|
475
534
|
this.setRootTree(treeId, snapshot.snapshotTree);
|
|
476
535
|
}
|
|
477
|
-
if (snapshot.
|
|
478
|
-
this.initBlobsCache(snapshot.
|
|
536
|
+
if (snapshot.blobContents) {
|
|
537
|
+
this.initBlobsCache(snapshot.blobContents);
|
|
479
538
|
}
|
|
480
539
|
// If the version id doesn't match with the id of the tree, then use the id of first tree which in that case
|
|
481
540
|
// will be the actual id of tree to be fetched.
|
|
@@ -483,4 +542,4 @@ export class OdspDocumentStorageService extends OdspDocumentStorageServiceBase {
|
|
|
483
542
|
});
|
|
484
543
|
}
|
|
485
544
|
}
|
|
486
|
-
//# sourceMappingURL=odspDocumentStorageManager.
|
|
545
|
+
//# sourceMappingURL=odspDocumentStorageManager.js.map
|