@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.
- package/.eslintrc.cjs +18 -3
- 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 +11 -12
- 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.map +1 -1
- package/dist/compactSnapshotParser.js +87 -69
- package/dist/compactSnapshotParser.js.map +1 -1
- package/dist/compactSnapshotWriter.d.ts.map +1 -1
- package/dist/compactSnapshotWriter.js +25 -19
- package/dist/compactSnapshotWriter.js.map +1 -1
- package/dist/contracts.d.ts +10 -4
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js.map +1 -1
- package/dist/createFile.d.ts +3 -3
- package/dist/createFile.d.ts.map +1 -1
- package/dist/createFile.js +30 -27
- 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 +2 -2
- package/dist/createNewUtils.d.ts.map +1 -1
- package/dist/createNewUtils.js +12 -8
- package/dist/createNewUtils.js.map +1 -1
- package/dist/createOdspCreateContainerRequest.d.ts.map +1 -1
- package/dist/createOdspCreateContainerRequest.js +6 -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 +66 -43
- package/dist/epochTracker.js.map +1 -1
- package/dist/fetchSnapshot.d.ts +11 -8
- package/dist/fetchSnapshot.d.ts.map +1 -1
- package/dist/fetchSnapshot.js +79 -58
- package/dist/fetchSnapshot.js.map +1 -1
- package/dist/getFileLink.d.ts.map +1 -1
- package/dist/getFileLink.js +24 -17
- package/dist/getFileLink.js.map +1 -1
- package/dist/getQueryString.d.ts.map +1 -1
- package/dist/getQueryString.js +6 -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 +1 -1
- package/dist/localOdspDriver/localOdspDocumentService.d.ts.map +1 -1
- package/dist/localOdspDriver/localOdspDocumentService.js +5 -5
- 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 +1 -1
- package/dist/localOdspDriver/localOdspDocumentStorageManager.d.ts.map +1 -1
- package/dist/localOdspDriver/localOdspDocumentStorageManager.js +6 -6
- package/dist/localOdspDriver/localOdspDocumentStorageManager.js.map +1 -1
- package/dist/odsp-driver-alpha.d.ts +27 -12
- package/dist/odsp-driver-beta.d.ts +1 -2
- package/dist/odsp-driver-public.d.ts +1 -2
- package/dist/odsp-driver-untrimmed.d.ts +29 -12
- package/dist/odspCache.d.ts +3 -3
- package/dist/odspCache.d.ts.map +1 -1
- package/dist/odspCache.js +3 -4
- package/dist/odspCache.js.map +1 -1
- package/dist/odspDelayLoadedDeltaStream.d.ts +7 -5
- package/dist/odspDelayLoadedDeltaStream.d.ts.map +1 -1
- package/dist/odspDelayLoadedDeltaStream.js +41 -28
- 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 +6 -4
- package/dist/odspDocumentService.d.ts.map +1 -1
- package/dist/odspDocumentService.js +19 -16
- 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 +26 -22
- 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 +15 -9
- package/dist/odspDocumentStorageManager.d.ts.map +1 -1
- package/dist/odspDocumentStorageManager.js +219 -181
- package/dist/odspDocumentStorageManager.js.map +1 -1
- package/dist/odspDocumentStorageServiceBase.d.ts +2 -4
- package/dist/odspDocumentStorageServiceBase.d.ts.map +1 -1
- package/dist/odspDocumentStorageServiceBase.js +32 -29
- package/dist/odspDocumentStorageServiceBase.js.map +1 -1
- package/dist/odspDriverUrlResolver.d.ts +5 -1
- package/dist/odspDriverUrlResolver.d.ts.map +1 -1
- package/dist/odspDriverUrlResolver.js +27 -24
- package/dist/odspDriverUrlResolver.js.map +1 -1
- package/dist/odspDriverUrlResolverForShareLink.d.ts +17 -6
- package/dist/odspDriverUrlResolverForShareLink.d.ts.map +1 -1
- package/dist/odspDriverUrlResolverForShareLink.js +49 -39
- 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 +5 -5
- 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 +3 -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 +1 -1
- package/dist/odspSnapshotParser.d.ts.map +1 -1
- package/dist/odspSnapshotParser.js +3 -2
- 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 +19 -7
- package/dist/odspUtils.d.ts.map +1 -1
- package/dist/odspUtils.js +61 -31
- 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 +0 -1
- package/dist/retryErrorsStorageAdapter.d.ts.map +1 -1
- package/dist/retryErrorsStorageAdapter.js +2 -5
- package/dist/retryErrorsStorageAdapter.js.map +1 -1
- package/dist/retryUtils.d.ts.map +1 -1
- package/dist/retryUtils.js +6 -2
- 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 +15 -11
- 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} +1 -1
- package/lib/compactSnapshotParser.d.ts.map +1 -0
- package/lib/{compactSnapshotParser.mjs → compactSnapshotParser.js} +61 -43
- package/lib/compactSnapshotParser.js.map +1 -0
- package/lib/{compactSnapshotWriter.d.mts → compactSnapshotWriter.d.ts} +1 -1
- package/lib/compactSnapshotWriter.d.ts.map +1 -0
- package/lib/{compactSnapshotWriter.mjs → compactSnapshotWriter.js} +13 -7
- 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} +11 -5
- package/lib/contracts.d.ts.map +1 -0
- package/lib/{contracts.mjs → contracts.js} +1 -1
- 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} +4 -4
- package/lib/createFile.d.ts.map +1 -0
- package/lib/{createFile.mjs → createFile.js} +15 -12
- 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} +3 -3
- package/lib/createNewUtils.d.ts.map +1 -0
- package/lib/{createNewUtils.mjs → createNewUtils.js} +9 -5
- package/lib/createNewUtils.js.map +1 -0
- package/lib/{createOdspCreateContainerRequest.d.mts → createOdspCreateContainerRequest.d.ts} +5 -1
- package/lib/createOdspCreateContainerRequest.d.ts.map +1 -0
- package/lib/{createOdspCreateContainerRequest.mjs → createOdspCreateContainerRequest.js} +6 -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} +56 -33
- 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} +12 -9
- package/lib/fetchSnapshot.d.ts.map +1 -0
- package/lib/{fetchSnapshot.mjs → fetchSnapshot.js} +61 -40
- 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} +14 -7
- 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} +7 -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} +2 -2
- package/lib/localOdspDriver/localOdspDocumentService.d.ts.map +1 -0
- package/lib/localOdspDriver/{localOdspDocumentService.mjs → localOdspDocumentService.js} +4 -4
- 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} +2 -2
- package/lib/localOdspDriver/localOdspDocumentStorageManager.d.ts.map +1 -0
- package/lib/localOdspDriver/{localOdspDocumentStorageManager.mjs → localOdspDocumentStorageManager.js} +4 -4
- package/lib/localOdspDriver/localOdspDocumentStorageManager.js.map +1 -0
- package/lib/{odsp-driver-alpha.d.mts → odsp-driver-alpha.d.ts} +27 -12
- package/lib/{odsp-driver-public.d.mts → odsp-driver-beta.d.ts} +1 -2
- package/lib/{odsp-driver-beta.d.mts → odsp-driver-public.d.ts} +1 -2
- package/lib/{odsp-driver-untrimmed.d.mts → odsp-driver-untrimmed.d.ts} +29 -12
- package/lib/{odspCache.d.mts → odspCache.d.ts} +8 -4
- 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} +8 -6
- package/lib/odspDelayLoadedDeltaStream.d.ts.map +1 -0
- package/lib/{odspDelayLoadedDeltaStream.mjs → odspDelayLoadedDeltaStream.js} +33 -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} +7 -5
- package/lib/odspDocumentService.d.ts.map +1 -0
- package/lib/{odspDocumentService.mjs → odspDocumentService.js} +16 -11
- 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} +23 -17
- 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} +16 -10
- package/lib/odspDocumentStorageManager.d.ts.map +1 -0
- package/lib/{odspDocumentStorageManager.mjs → odspDocumentStorageManager.js} +207 -167
- package/lib/odspDocumentStorageManager.js.map +1 -0
- package/lib/{odspDocumentStorageServiceBase.d.mts → odspDocumentStorageServiceBase.d.ts} +3 -5
- package/lib/odspDocumentStorageServiceBase.d.ts.map +1 -0
- package/lib/{odspDocumentStorageServiceBase.mjs → odspDocumentStorageServiceBase.js} +32 -29
- package/lib/odspDocumentStorageServiceBase.js.map +1 -0
- package/lib/{odspDriverUrlResolver.d.mts → odspDriverUrlResolver.d.ts} +6 -2
- package/lib/odspDriverUrlResolver.d.ts.map +1 -0
- package/lib/{odspDriverUrlResolver.mjs → odspDriverUrlResolver.js} +24 -17
- package/lib/odspDriverUrlResolver.js.map +1 -0
- package/lib/{odspDriverUrlResolverForShareLink.d.mts → odspDriverUrlResolverForShareLink.d.ts} +18 -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} +4 -4
- 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} +4 -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} +2 -2
- package/lib/odspSnapshotParser.d.ts.map +1 -0
- package/lib/{odspSnapshotParser.mjs → odspSnapshotParser.js} +4 -3
- 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} +20 -8
- package/lib/odspUtils.d.ts.map +1 -0
- package/lib/{odspUtils.mjs → odspUtils.js} +45 -17
- 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} +1 -2
- package/lib/retryErrorsStorageAdapter.d.ts.map +1 -0
- package/lib/{retryErrorsStorageAdapter.mjs → retryErrorsStorageAdapter.js} +2 -5
- 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} +6 -2
- 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} +17 -9
- package/lib/zipItDataRepresentationUtils.js.map +1 -0
- package/package.json +90 -31
- package/src/ReadBufferUtils.ts +7 -7
- package/src/WriteBufferUtils.ts +13 -9
- package/src/checkUrl.ts +4 -2
- package/src/compactSnapshotParser.ts +87 -52
- package/src/compactSnapshotWriter.ts +19 -12
- package/src/contracts.ts +16 -4
- package/src/createFile.ts +16 -13
- package/src/createNewContainerOnExistingFile.ts +8 -8
- package/src/createNewModule.ts +2 -2
- package/src/createNewUtils.ts +19 -9
- package/src/createOdspCreateContainerRequest.ts +2 -1
- package/src/createOdspUrl.ts +1 -1
- package/src/epochTracker.ts +90 -55
- package/src/fetchSnapshot.ts +104 -47
- package/src/getFileLink.ts +21 -13
- package/src/getQueryString.ts +3 -0
- package/src/index.ts +27 -19
- package/src/localOdspDriver/localOdspDocumentService.ts +3 -3
- package/src/localOdspDriver/localOdspDocumentServiceFactory.ts +12 -11
- package/src/localOdspDriver/localOdspDocumentStorageManager.ts +5 -5
- package/src/odspCache.ts +13 -9
- package/src/odspDelayLoadedDeltaStream.ts +54 -33
- package/src/odspDeltaStorageService.ts +17 -16
- package/src/odspDocumentDeltaConnection.ts +52 -34
- package/src/odspDocumentService.ts +23 -20
- package/src/odspDocumentServiceFactory.ts +7 -2
- package/src/odspDocumentServiceFactoryCore.ts +25 -18
- package/src/odspDocumentServiceFactoryWithCodeSplit.ts +1 -1
- package/src/odspDocumentStorageManager.ts +276 -216
- package/src/odspDocumentStorageServiceBase.ts +45 -43
- package/src/odspDriverUrlResolver.ts +39 -24
- package/src/odspDriverUrlResolverForShareLink.ts +51 -31
- package/src/odspError.ts +4 -4
- package/src/odspFluidFileLink.ts +3 -3
- package/src/odspLocationRedirection.ts +1 -1
- package/src/odspPublicUtils.ts +3 -0
- package/src/odspSnapshotParser.ts +4 -3
- package/src/odspSummaryUploadManager.ts +21 -9
- package/src/odspUrlHelper.ts +2 -3
- package/src/odspUtils.ts +73 -30
- package/src/opsCaching.ts +13 -12
- package/src/packageVersion.ts +1 -1
- package/src/prefetchLatestSnapshot.ts +24 -15
- package/src/retryErrorsStorageAdapter.ts +4 -8
- package/src/retryUtils.ts +6 -2
- package/src/socketModule.ts +2 -0
- package/src/vroom.ts +6 -6
- package/src/zipItDataRepresentationUtils.ts +63 -35
- package/tsconfig.cjs.json +7 -0
- package/tsconfig.json +2 -5
- 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.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
|
@@ -26,11 +26,11 @@ import {
|
|
|
26
26
|
import { Socket } from "socket.io-client";
|
|
27
27
|
import { v4 as uuid } from "uuid";
|
|
28
28
|
import { createGenericNetworkError } from "@fluidframework/driver-utils";
|
|
29
|
-
import { IOdspSocketError, IGetOpsResponse, IFlushOpsResponse } from "./contracts";
|
|
30
|
-
import { EpochTracker } from "./epochTracker";
|
|
31
|
-
import { errorObjectFromSocketError } from "./odspError";
|
|
32
|
-
import { SocketIOClientStatic } from "./socketModule";
|
|
33
|
-
import { pkgVersion } from "./packageVersion";
|
|
29
|
+
import { IOdspSocketError, IGetOpsResponse, IFlushOpsResponse } from "./contracts.js";
|
|
30
|
+
import { EpochTracker } from "./epochTracker.js";
|
|
31
|
+
import { errorObjectFromSocketError } from "./odspError.js";
|
|
32
|
+
import { SocketIOClientStatic } from "./socketModule.js";
|
|
33
|
+
import { pkgVersion } from "./packageVersion.js";
|
|
34
34
|
|
|
35
35
|
const protocolVersions = ["^0.4.0", "^0.3.0", "^0.2.0", "^0.1.0"];
|
|
36
36
|
const feature_get_ops = "api_get_ops";
|
|
@@ -67,7 +67,7 @@ class SocketReference extends TypedEventEmitter<ISocketEvents> {
|
|
|
67
67
|
// Map of all existing socket io sockets. [url, tenantId, documentId] -> socket
|
|
68
68
|
private static readonly socketIoSockets: Map<string, SocketReference> = new Map();
|
|
69
69
|
|
|
70
|
-
public static find(key: string, logger: ITelemetryLoggerExt) {
|
|
70
|
+
public static find(key: string, logger: ITelemetryLoggerExt): SocketReference | undefined {
|
|
71
71
|
const socketReference = SocketReference.socketIoSockets.get(key);
|
|
72
72
|
|
|
73
73
|
// Verify the socket is healthy before reusing it
|
|
@@ -90,7 +90,7 @@ class SocketReference extends TypedEventEmitter<ISocketEvents> {
|
|
|
90
90
|
* Removes a reference for the given key
|
|
91
91
|
* Once the ref count hits 0, the socket is disconnected and removed
|
|
92
92
|
*/
|
|
93
|
-
public removeSocketIoReference() {
|
|
93
|
+
public removeSocketIoReference(): void {
|
|
94
94
|
assert(this.references > 0, 0x09f /* "No more socketIO refs to remove!" */);
|
|
95
95
|
this.references--;
|
|
96
96
|
|
|
@@ -114,7 +114,7 @@ class SocketReference extends TypedEventEmitter<ISocketEvents> {
|
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
public get socket() {
|
|
117
|
+
public get socket(): Socket {
|
|
118
118
|
if (!this._socket) {
|
|
119
119
|
throw new Error(`Invalid socket for key "${this.key}`);
|
|
120
120
|
}
|
|
@@ -140,7 +140,7 @@ class SocketReference extends TypedEventEmitter<ISocketEvents> {
|
|
|
140
140
|
private readonly serverDisconnectEventHandler = (
|
|
141
141
|
socketError: IOdspSocketError,
|
|
142
142
|
clientId?: string,
|
|
143
|
-
) => {
|
|
143
|
+
): void => {
|
|
144
144
|
// Treat all errors as recoverable, and rely on joinSession / reconnection flow to
|
|
145
145
|
// filter out retryable vs. non-retryable cases.
|
|
146
146
|
const error = errorObjectFromSocketError(socketError, "server_disconnect");
|
|
@@ -161,14 +161,14 @@ class SocketReference extends TypedEventEmitter<ISocketEvents> {
|
|
|
161
161
|
}
|
|
162
162
|
};
|
|
163
163
|
|
|
164
|
-
private clearTimer() {
|
|
164
|
+
private clearTimer(): void {
|
|
165
165
|
if (this.delayDeleteTimeout !== undefined) {
|
|
166
166
|
clearTimeout(this.delayDeleteTimeout);
|
|
167
167
|
this.delayDeleteTimeout = undefined;
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
-
public closeSocket(error?: IAnyDriverError) {
|
|
171
|
+
public closeSocket(error?: IAnyDriverError): void {
|
|
172
172
|
if (!this._socket) {
|
|
173
173
|
return;
|
|
174
174
|
}
|
|
@@ -211,7 +211,7 @@ class SocketReference extends TypedEventEmitter<ISocketEvents> {
|
|
|
211
211
|
socket.disconnect();
|
|
212
212
|
}
|
|
213
213
|
|
|
214
|
-
public get disconnected() {
|
|
214
|
+
public get disconnected(): boolean {
|
|
215
215
|
if (this._socket === undefined) {
|
|
216
216
|
return true;
|
|
217
217
|
}
|
|
@@ -319,8 +319,9 @@ export class OdspDocumentDeltaConnection extends DocumentDeltaConnection {
|
|
|
319
319
|
try {
|
|
320
320
|
await deltaConnection.initialize(connectMessage, timeoutMs);
|
|
321
321
|
await epochTracker.validateEpoch(deltaConnection.details.epoch, "push");
|
|
322
|
-
|
|
323
|
-
|
|
322
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
323
|
+
} catch (error: any) {
|
|
324
|
+
if (error !== null && typeof error === "object") {
|
|
324
325
|
// We have to special-case error types here in terms of what is re-triable.
|
|
325
326
|
// These errors have to re-retried, we just need new joinSession result to connect to right server:
|
|
326
327
|
// 400: Invalid tenant or document id. The WebSocket is connected to a different document
|
|
@@ -334,11 +335,13 @@ export class OdspDocumentDeltaConnection extends DocumentDeltaConnection {
|
|
|
334
335
|
// 401/403: Code will retry once with new token either way, then it becomes fatal - on this path
|
|
335
336
|
// and on join Session path.
|
|
336
337
|
// 501: (Fluid not enabled): this is fine either way, as joinSession is gatekeeper
|
|
337
|
-
|
|
338
|
-
|
|
338
|
+
// eslint-disable-next-line unicorn/no-lonely-if, @typescript-eslint/no-unsafe-member-access
|
|
339
|
+
if (error.statusCode === 400 || error.statusCode === 404) {
|
|
340
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
341
|
+
error.canRetry = true;
|
|
339
342
|
}
|
|
340
343
|
}
|
|
341
|
-
throw
|
|
344
|
+
throw error;
|
|
342
345
|
}
|
|
343
346
|
|
|
344
347
|
return deltaConnection;
|
|
@@ -357,10 +360,12 @@ export class OdspDocumentDeltaConnection extends DocumentDeltaConnection {
|
|
|
357
360
|
/**
|
|
358
361
|
* Error raising for socket.io issues
|
|
359
362
|
*/
|
|
363
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
|
360
364
|
protected createErrorObject(handler: string, error?: any, canRetry = true): IAnyDriverError {
|
|
361
365
|
// Note: we suspect the incoming error object is either:
|
|
362
366
|
// - a socketError: add it to the OdspError object for driver to be able to parse it and reason over it.
|
|
363
367
|
// - anything else: let base class handle it
|
|
368
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
364
369
|
return canRetry && Number.isInteger(error?.code) && typeof error?.message === "string"
|
|
365
370
|
? errorObjectFromSocketError(error as IOdspSocketError, handler)
|
|
366
371
|
: super.createErrorObject(handler, error, canRetry);
|
|
@@ -378,6 +383,7 @@ export class OdspDocumentDeltaConnection extends DocumentDeltaConnection {
|
|
|
378
383
|
documentId: string,
|
|
379
384
|
logger: ITelemetryLoggerExt,
|
|
380
385
|
): SocketReference {
|
|
386
|
+
// eslint-disable-next-line unicorn/no-array-callback-reference, unicorn/no-array-method-this-argument
|
|
381
387
|
const existingSocketReference = SocketReference.find(key, logger);
|
|
382
388
|
if (existingSocketReference) {
|
|
383
389
|
return existingSocketReference;
|
|
@@ -422,7 +428,7 @@ export class OdspDocumentDeltaConnection extends DocumentDeltaConnection {
|
|
|
422
428
|
* @param to - exclusive
|
|
423
429
|
* @returns ops retrieved
|
|
424
430
|
*/
|
|
425
|
-
public requestOps(from: number, to: number) {
|
|
431
|
+
public requestOps(from: number, to: number): void {
|
|
426
432
|
assert(!this.socketReference?.disconnected, 0x413 /* non-active socket */);
|
|
427
433
|
|
|
428
434
|
// Given that to is exclusive, we should be asking for at least something!
|
|
@@ -430,6 +436,7 @@ export class OdspDocumentDeltaConnection extends DocumentDeltaConnection {
|
|
|
430
436
|
|
|
431
437
|
// PUSH may disable this functionality
|
|
432
438
|
// back-compat: remove cast to any once latest version of IConnected is consumed
|
|
439
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access
|
|
433
440
|
if ((this.details as any).supportedFeatures?.[feature_get_ops] !== true) {
|
|
434
441
|
return;
|
|
435
442
|
}
|
|
@@ -481,6 +488,7 @@ export class OdspDocumentDeltaConnection extends DocumentDeltaConnection {
|
|
|
481
488
|
assert(!this.socketReference?.disconnected, 0x414 /* non-active socket */);
|
|
482
489
|
|
|
483
490
|
// back-compat: remove cast to any once latest version of IConnected is consumed
|
|
491
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access
|
|
484
492
|
if ((this.details as any).supportedFeatures?.[feature_flush_ops] !== true) {
|
|
485
493
|
// Once single-commit summary is enabled end-to-end, flush support is a must!
|
|
486
494
|
// The only alternative is change in design where SPO fetches ops from PUSH OR
|
|
@@ -511,7 +519,7 @@ export class OdspDocumentDeltaConnection extends DocumentDeltaConnection {
|
|
|
511
519
|
return this.flushDeferred.promise;
|
|
512
520
|
}
|
|
513
521
|
|
|
514
|
-
protected disconnectHandler = (error: IFluidErrorBase & OdspError, clientId?: string) => {
|
|
522
|
+
protected disconnectHandler = (error: IFluidErrorBase & OdspError, clientId?: string): void => {
|
|
515
523
|
if (clientId === undefined || clientId === this.clientId) {
|
|
516
524
|
this.logger.sendTelemetryEvent(
|
|
517
525
|
{
|
|
@@ -527,7 +535,7 @@ export class OdspDocumentDeltaConnection extends DocumentDeltaConnection {
|
|
|
527
535
|
}
|
|
528
536
|
};
|
|
529
537
|
|
|
530
|
-
protected async initialize(connectMessage: IConnect, timeout: number) {
|
|
538
|
+
protected async initialize(connectMessage: IConnect, timeout: number): Promise<void> {
|
|
531
539
|
assert(!this.socketReference?.disconnected, 0x415 /* non-active socket */);
|
|
532
540
|
|
|
533
541
|
if (this.enableMultiplexing) {
|
|
@@ -535,7 +543,7 @@ export class OdspDocumentDeltaConnection extends DocumentDeltaConnection {
|
|
|
535
543
|
this.earlyOpHandler = (
|
|
536
544
|
messageDocumentId: string,
|
|
537
545
|
msgs: ISequencedDocumentMessage[],
|
|
538
|
-
) => {
|
|
546
|
+
): void => {
|
|
539
547
|
if (this.documentId === messageDocumentId) {
|
|
540
548
|
this.queuedMessages.push(...msgs);
|
|
541
549
|
}
|
|
@@ -544,7 +552,7 @@ export class OdspDocumentDeltaConnection extends DocumentDeltaConnection {
|
|
|
544
552
|
this.earlySignalHandler = (
|
|
545
553
|
msg: ISignalMessage | ISignalMessage[],
|
|
546
554
|
messageDocumentId?: string,
|
|
547
|
-
) => {
|
|
555
|
+
): void => {
|
|
548
556
|
if (messageDocumentId === undefined || messageDocumentId === this.documentId) {
|
|
549
557
|
if (Array.isArray(msg)) {
|
|
550
558
|
this.queuedSignals.push(...msg);
|
|
@@ -599,14 +607,17 @@ export class OdspDocumentDeltaConnection extends DocumentDeltaConnection {
|
|
|
599
607
|
if (result.lastPersistedSequenceNumber === undefined || result.code !== 200) {
|
|
600
608
|
switch (result.code) {
|
|
601
609
|
case 409:
|
|
602
|
-
case 429:
|
|
610
|
+
case 429: {
|
|
603
611
|
category = "error";
|
|
604
612
|
break;
|
|
605
|
-
|
|
613
|
+
}
|
|
614
|
+
case 204: {
|
|
606
615
|
break;
|
|
607
|
-
|
|
616
|
+
}
|
|
617
|
+
default: {
|
|
608
618
|
category = "error";
|
|
609
619
|
break;
|
|
620
|
+
}
|
|
610
621
|
}
|
|
611
622
|
}
|
|
612
623
|
this.logger.sendTelemetryEvent({
|
|
@@ -629,10 +640,11 @@ export class OdspDocumentDeltaConnection extends DocumentDeltaConnection {
|
|
|
629
640
|
});
|
|
630
641
|
}
|
|
631
642
|
|
|
632
|
-
|
|
643
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
644
|
+
protected addTrackedListener(event: string, listener: (...args: any[]) => void): void {
|
|
633
645
|
// override some event listeners in order to support multiple documents/clients over the same websocket
|
|
634
646
|
switch (event) {
|
|
635
|
-
case "op":
|
|
647
|
+
case "op": {
|
|
636
648
|
// per document op handling
|
|
637
649
|
super.addTrackedListener(
|
|
638
650
|
event,
|
|
@@ -643,8 +655,9 @@ export class OdspDocumentDeltaConnection extends DocumentDeltaConnection {
|
|
|
643
655
|
},
|
|
644
656
|
);
|
|
645
657
|
break;
|
|
658
|
+
}
|
|
646
659
|
|
|
647
|
-
case "signal":
|
|
660
|
+
case "signal": {
|
|
648
661
|
// per document signal handling
|
|
649
662
|
super.addTrackedListener(
|
|
650
663
|
event,
|
|
@@ -659,8 +672,9 @@ export class OdspDocumentDeltaConnection extends DocumentDeltaConnection {
|
|
|
659
672
|
},
|
|
660
673
|
);
|
|
661
674
|
break;
|
|
675
|
+
}
|
|
662
676
|
|
|
663
|
-
case "nack":
|
|
677
|
+
case "nack": {
|
|
664
678
|
// per client / document nack handling
|
|
665
679
|
super.addTrackedListener(event, (clientIdOrDocumentId: string, nacks: INack[]) => {
|
|
666
680
|
const handle =
|
|
@@ -687,16 +701,19 @@ export class OdspDocumentDeltaConnection extends DocumentDeltaConnection {
|
|
|
687
701
|
}
|
|
688
702
|
});
|
|
689
703
|
break;
|
|
704
|
+
}
|
|
690
705
|
|
|
691
|
-
default:
|
|
706
|
+
default: {
|
|
692
707
|
super.addTrackedListener(event, listener);
|
|
693
708
|
break;
|
|
709
|
+
}
|
|
694
710
|
}
|
|
695
711
|
}
|
|
696
712
|
|
|
697
|
-
public get disposed() {
|
|
713
|
+
public get disposed(): boolean {
|
|
698
714
|
if (!(this._disposed || this.socket.connected)) {
|
|
699
715
|
// Send error event if this connection is not yet disposed after socket is disconnected for 15s.
|
|
716
|
+
// eslint-disable-next-line unicorn/no-lonely-if
|
|
700
717
|
if (this.connectionNotYetDisposedTimeout === undefined) {
|
|
701
718
|
this.connectionNotYetDisposedTimeout = setTimeout(() => {
|
|
702
719
|
if (!this._disposed) {
|
|
@@ -723,7 +740,7 @@ export class OdspDocumentDeltaConnection extends DocumentDeltaConnection {
|
|
|
723
740
|
return !this.disposed && this.socket.connected;
|
|
724
741
|
}
|
|
725
742
|
|
|
726
|
-
protected emitMessages(type: string, messages: IDocumentMessage[][]) {
|
|
743
|
+
protected emitMessages(type: string, messages: IDocumentMessage[][]): void {
|
|
727
744
|
// Only submit the op/signals if we are connected.
|
|
728
745
|
if (this.connected) {
|
|
729
746
|
this.socket.emit(type, this.clientId, messages);
|
|
@@ -751,6 +768,7 @@ export class OdspDocumentDeltaConnection extends DocumentDeltaConnection {
|
|
|
751
768
|
};
|
|
752
769
|
|
|
753
770
|
// back-compat: the typing for this method and emitMessages is incorrect, will be fixed in a future PR
|
|
771
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any
|
|
754
772
|
this.emitMessages("submitSignal", [signal] as any);
|
|
755
773
|
}
|
|
756
774
|
|
|
@@ -758,7 +776,7 @@ export class OdspDocumentDeltaConnection extends DocumentDeltaConnection {
|
|
|
758
776
|
* Critical path where we need to also close the socket for an error.
|
|
759
777
|
* @param error - Error causing the socket to close.
|
|
760
778
|
*/
|
|
761
|
-
protected closeSocketCore(error: IAnyDriverError) {
|
|
779
|
+
protected closeSocketCore(error: IAnyDriverError): void {
|
|
762
780
|
const socket = this.socketReference;
|
|
763
781
|
assert(socket !== undefined, 0x416 /* reentrancy not supported in close socket */);
|
|
764
782
|
socket.closeSocket(error);
|
|
@@ -771,7 +789,7 @@ export class OdspDocumentDeltaConnection extends DocumentDeltaConnection {
|
|
|
771
789
|
/**
|
|
772
790
|
* Disconnect from the websocket
|
|
773
791
|
*/
|
|
774
|
-
protected disconnectCore() {
|
|
792
|
+
protected disconnectCore(): void {
|
|
775
793
|
const socket = this.socketReference;
|
|
776
794
|
assert(socket !== undefined, 0x0a2 /* "reentrancy not supported!" */);
|
|
777
795
|
this.socketReference = undefined;
|
|
@@ -27,16 +27,16 @@ import {
|
|
|
27
27
|
HostStoragePolicy,
|
|
28
28
|
InstrumentedStorageTokenFetcher,
|
|
29
29
|
} from "@fluidframework/odsp-driver-definitions";
|
|
30
|
-
import { HostStoragePolicyInternal } from "./contracts";
|
|
31
|
-
import { IOdspCache } from "./odspCache";
|
|
32
|
-
import { OdspDeltaStorageService, OdspDeltaStorageWithCache } from "./odspDeltaStorageService";
|
|
33
|
-
import { OdspDocumentStorageService } from "./odspDocumentStorageManager";
|
|
34
|
-
import { getOdspResolvedUrl } from "./odspUtils";
|
|
35
|
-
import { isOdcOrigin } from "./odspUrlHelper";
|
|
36
|
-
import { EpochTracker } from "./epochTracker";
|
|
37
|
-
import { OpsCache } from "./opsCaching";
|
|
38
|
-
import { RetryErrorsStorageAdapter } from "./retryErrorsStorageAdapter";
|
|
39
|
-
import type { OdspDelayLoadedDeltaStream } from "./odspDelayLoadedDeltaStream";
|
|
30
|
+
import { HostStoragePolicyInternal } from "./contracts.js";
|
|
31
|
+
import { IOdspCache } from "./odspCache.js";
|
|
32
|
+
import { OdspDeltaStorageService, OdspDeltaStorageWithCache } from "./odspDeltaStorageService.js";
|
|
33
|
+
import { OdspDocumentStorageService } from "./odspDocumentStorageManager.js";
|
|
34
|
+
import { getOdspResolvedUrl } from "./odspUtils.js";
|
|
35
|
+
import { isOdcOrigin } from "./odspUrlHelper.js";
|
|
36
|
+
import { EpochTracker } from "./epochTracker.js";
|
|
37
|
+
import { OpsCache } from "./opsCaching.js";
|
|
38
|
+
import { RetryErrorsStorageAdapter } from "./retryErrorsStorageAdapter.js";
|
|
39
|
+
import type { OdspDelayLoadedDeltaStream } from "./odspDelayLoadedDeltaStream.js";
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
* The DocumentService manages the Socket.IO connection and manages routing requests to connected
|
|
@@ -56,6 +56,8 @@ export class OdspDocumentService
|
|
|
56
56
|
private odspSocketModuleLoaded: boolean = false;
|
|
57
57
|
|
|
58
58
|
/**
|
|
59
|
+
* Creates a new OdspDocumentService instance.
|
|
60
|
+
*
|
|
59
61
|
* @param resolvedUrl - resolved url identifying document that will be managed by returned service instance.
|
|
60
62
|
* @param getStorageToken - function that can provide the storage token. This is is also referred to as
|
|
61
63
|
* the "Vroom" token in SPO.
|
|
@@ -133,6 +135,7 @@ export class OdspDocumentService
|
|
|
133
135
|
// load in storage-only mode if a file version is specified
|
|
134
136
|
storageOnly: odspResolvedUrl.fileVersion !== undefined,
|
|
135
137
|
summarizeProtocolTree: true,
|
|
138
|
+
supportGetSnapshotApi: true,
|
|
136
139
|
};
|
|
137
140
|
|
|
138
141
|
this.mc = createChildMonitoringContext({
|
|
@@ -156,7 +159,7 @@ export class OdspDocumentService
|
|
|
156
159
|
public get resolvedUrl(): IResolvedUrl {
|
|
157
160
|
return this.odspResolvedUrl;
|
|
158
161
|
}
|
|
159
|
-
public get policies() {
|
|
162
|
+
public get policies(): IDocumentServicePolicies {
|
|
160
163
|
return this._policies;
|
|
161
164
|
}
|
|
162
165
|
|
|
@@ -266,7 +269,7 @@ export class OdspDocumentService
|
|
|
266
269
|
* import this later on when required.
|
|
267
270
|
* @returns The delta stream object.
|
|
268
271
|
*/
|
|
269
|
-
private async getDelayLoadedDeltaStream() {
|
|
272
|
+
private async getDelayLoadedDeltaStream(): Promise<OdspDelayLoadedDeltaStream> {
|
|
270
273
|
assert(this.odspSocketModuleLoaded === false, 0x507 /* Should be loaded only once */);
|
|
271
274
|
const module = await import(
|
|
272
275
|
/* webpackChunkName: "socketModule" */ "./odspDelayLoadedDeltaStream.js"
|
|
@@ -295,22 +298,22 @@ export class OdspDocumentService
|
|
|
295
298
|
return this.odspDelayLoadedDeltaStream;
|
|
296
299
|
}
|
|
297
300
|
|
|
298
|
-
public dispose(error?:
|
|
301
|
+
public dispose(error?: unknown): void {
|
|
299
302
|
// Error might indicate mismatch between client & server knowledge about file
|
|
300
303
|
// (OdspErrorTypes.fileOverwrittenInStorage).
|
|
301
304
|
// For example, file might have been overwritten in storage without generating new epoch
|
|
302
305
|
// In such case client cached info is stale and has to be removed.
|
|
303
|
-
if (error
|
|
304
|
-
this.epochTracker.removeEntries().catch(() => {});
|
|
305
|
-
} else {
|
|
306
|
+
if (error === undefined) {
|
|
306
307
|
this._opsCache?.flushOps();
|
|
308
|
+
} else {
|
|
309
|
+
this.epochTracker.removeEntries().catch(() => {});
|
|
307
310
|
}
|
|
308
311
|
this._opsCache?.dispose();
|
|
309
312
|
// Only need to dipose this, if it is already loaded.
|
|
310
313
|
this.odspDelayLoadedDeltaStream?.dispose();
|
|
311
314
|
}
|
|
312
315
|
|
|
313
|
-
protected get opsCache() {
|
|
316
|
+
protected get opsCache(): OpsCache | undefined {
|
|
314
317
|
if (this._opsCache) {
|
|
315
318
|
return this._opsCache;
|
|
316
319
|
}
|
|
@@ -329,11 +332,11 @@ export class OdspDocumentService
|
|
|
329
332
|
this.mc.logger,
|
|
330
333
|
// ICache
|
|
331
334
|
{
|
|
332
|
-
write: async (key: string, opsData: string) => {
|
|
335
|
+
write: async (key: string, opsData: string): Promise<void> => {
|
|
333
336
|
return this.cache.persistedCache.put({ ...opsKey, key }, opsData);
|
|
334
337
|
},
|
|
335
338
|
read: async (key: string) => this.cache.persistedCache.get({ ...opsKey, key }),
|
|
336
|
-
remove: () => {
|
|
339
|
+
remove: (): void => {
|
|
337
340
|
this.cache.persistedCache.removeEntries().catch(() => {});
|
|
338
341
|
},
|
|
339
342
|
},
|
|
@@ -346,7 +349,7 @@ export class OdspDocumentService
|
|
|
346
349
|
|
|
347
350
|
// Called whenever re receive ops through any channel for this document (snapshot, delta connection, delta storage)
|
|
348
351
|
// We use it to notify caching layer of how stale is snapshot stored in cache.
|
|
349
|
-
protected opsReceived(ops: ISequencedDocumentMessage[]) {
|
|
352
|
+
protected opsReceived(ops: ISequencedDocumentMessage[]): void {
|
|
350
353
|
// No need for two clients to save same ops
|
|
351
354
|
if (ops.length === 0 || this.odspResolvedUrl.summarizer) {
|
|
352
355
|
return;
|
|
@@ -10,9 +10,9 @@ import {
|
|
|
10
10
|
IPersistedCache,
|
|
11
11
|
HostStoragePolicy,
|
|
12
12
|
} from "@fluidframework/odsp-driver-definitions";
|
|
13
|
-
import { OdspDocumentServiceFactoryCore } from "./odspDocumentServiceFactoryCore";
|
|
13
|
+
import { OdspDocumentServiceFactoryCore } from "./odspDocumentServiceFactoryCore.js";
|
|
14
14
|
// eslint-disable-next-line import/no-internal-modules
|
|
15
|
-
import { LocalOdspDocumentServiceFactory } from "./localOdspDriver/localOdspDocumentServiceFactory";
|
|
15
|
+
import { LocalOdspDocumentServiceFactory } from "./localOdspDriver/localOdspDocumentServiceFactory.js";
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Factory for creating the sharepoint document service. Use this if you want to
|
|
@@ -31,6 +31,11 @@ export class OdspDocumentServiceFactory extends OdspDocumentServiceFactoryCore {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
|
+
* Creates a factory instance for creating a sharepoint document service from a provided snapshot.
|
|
35
|
+
*
|
|
36
|
+
* @remarks Use if you don't want to connect to any kind of external/internal storages and want to provide
|
|
37
|
+
* content directly.
|
|
38
|
+
*
|
|
34
39
|
* @alpha
|
|
35
40
|
*/
|
|
36
41
|
export function createLocalOdspDocumentServiceFactory(
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { ITelemetryBaseLogger
|
|
6
|
+
import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
7
7
|
import { PromiseCache } from "@fluidframework/core-utils";
|
|
8
8
|
import {
|
|
9
9
|
IDocumentService,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
IResolvedUrl,
|
|
12
12
|
} from "@fluidframework/driver-definitions";
|
|
13
13
|
import { ISummaryTree } from "@fluidframework/protocol-definitions";
|
|
14
|
-
import { PerformanceEvent } from "@fluidframework/telemetry-utils";
|
|
14
|
+
import { PerformanceEvent, createChildLogger } from "@fluidframework/telemetry-utils";
|
|
15
15
|
import {
|
|
16
16
|
getDocAttributesFromProtocolSummary,
|
|
17
17
|
isCombinedAppAndProtocolSummary,
|
|
@@ -36,9 +36,9 @@ import {
|
|
|
36
36
|
IPrefetchSnapshotContents,
|
|
37
37
|
LocalPersistentCache,
|
|
38
38
|
NonPersistentCache,
|
|
39
|
-
} from "./odspCache";
|
|
40
|
-
import { createOdspCacheAndTracker, ICacheAndTracker } from "./epochTracker";
|
|
41
|
-
import { OdspDocumentService } from "./odspDocumentService";
|
|
39
|
+
} from "./odspCache.js";
|
|
40
|
+
import { createOdspCacheAndTracker, ICacheAndTracker } from "./epochTracker.js";
|
|
41
|
+
import { OdspDocumentService } from "./odspDocumentService.js";
|
|
42
42
|
import {
|
|
43
43
|
INewFileInfo,
|
|
44
44
|
getOdspResolvedUrl,
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
IExistingFileInfo,
|
|
48
48
|
isNewFileInfo,
|
|
49
49
|
getJoinSessionCacheKey,
|
|
50
|
-
} from "./odspUtils";
|
|
50
|
+
} from "./odspUtils.js";
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
53
|
* Factory for creating the sharepoint document service. Use this if you want to
|
|
@@ -67,7 +67,8 @@ export class OdspDocumentServiceFactoryCore
|
|
|
67
67
|
return this.nonPersistentCache.snapshotPrefetchResultCache;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
// TODO: return `IRelaySessionAwareDriverFactory` instead of `this` (breaking change)
|
|
71
|
+
public get IRelaySessionAwareDriverFactory(): this {
|
|
71
72
|
return this;
|
|
72
73
|
}
|
|
73
74
|
|
|
@@ -93,7 +94,7 @@ export class OdspDocumentServiceFactoryCore
|
|
|
93
94
|
logger?: ITelemetryBaseLogger,
|
|
94
95
|
clientIsSummarizer?: boolean,
|
|
95
96
|
): Promise<IDocumentService> {
|
|
96
|
-
|
|
97
|
+
const odspResolvedUrl = getOdspResolvedUrl(createNewResolvedUrl);
|
|
97
98
|
const resolvedUrlData: IOdspUrlParts = {
|
|
98
99
|
siteUrl: odspResolvedUrl.siteUrl,
|
|
99
100
|
driveId: odspResolvedUrl.driveId,
|
|
@@ -150,6 +151,7 @@ export class OdspDocumentServiceFactoryCore
|
|
|
150
151
|
fileEntry,
|
|
151
152
|
odspLogger,
|
|
152
153
|
clientIsSummarizer,
|
|
154
|
+
this.hostPolicy,
|
|
153
155
|
);
|
|
154
156
|
|
|
155
157
|
return PerformanceEvent.timedExecAsync(
|
|
@@ -187,7 +189,7 @@ export class OdspDocumentServiceFactoryCore
|
|
|
187
189
|
);
|
|
188
190
|
throw error;
|
|
189
191
|
});
|
|
190
|
-
|
|
192
|
+
const _odspResolvedUrl = isNewFileInfo(fileInfo)
|
|
191
193
|
? await module.createNewFluidFile(
|
|
192
194
|
getStorageToken,
|
|
193
195
|
fileInfo,
|
|
@@ -214,13 +216,13 @@ export class OdspDocumentServiceFactoryCore
|
|
|
214
216
|
odspResolvedUrl.isClpCompliantApp,
|
|
215
217
|
);
|
|
216
218
|
const docService = this.createDocumentServiceCore(
|
|
217
|
-
|
|
219
|
+
_odspResolvedUrl,
|
|
218
220
|
odspLogger,
|
|
219
221
|
cacheAndTracker,
|
|
220
222
|
clientIsSummarizer,
|
|
221
223
|
);
|
|
222
224
|
event.end({
|
|
223
|
-
docId:
|
|
225
|
+
docId: _odspResolvedUrl.hashedDocumentId,
|
|
224
226
|
});
|
|
225
227
|
return docService;
|
|
226
228
|
},
|
|
@@ -269,28 +271,31 @@ export class OdspDocumentServiceFactoryCore
|
|
|
269
271
|
|
|
270
272
|
protected async createDocumentServiceCore(
|
|
271
273
|
resolvedUrl: IResolvedUrl,
|
|
272
|
-
odspLogger:
|
|
274
|
+
odspLogger: ITelemetryBaseLogger,
|
|
273
275
|
cacheAndTrackerArg?: ICacheAndTracker,
|
|
274
276
|
clientIsSummarizer?: boolean,
|
|
275
277
|
): Promise<IDocumentService> {
|
|
278
|
+
const extLogger = createChildLogger({ logger: odspLogger });
|
|
276
279
|
const odspResolvedUrl = getOdspResolvedUrl(resolvedUrl);
|
|
277
280
|
const resolvedUrlData: IOdspUrlParts = {
|
|
278
281
|
siteUrl: odspResolvedUrl.siteUrl,
|
|
279
282
|
driveId: odspResolvedUrl.driveId,
|
|
280
283
|
itemId: odspResolvedUrl.itemId,
|
|
281
284
|
};
|
|
285
|
+
|
|
282
286
|
const cacheAndTracker =
|
|
283
287
|
cacheAndTrackerArg ??
|
|
284
288
|
createOdspCacheAndTracker(
|
|
285
289
|
this.persistedCache,
|
|
286
290
|
this.nonPersistentCache,
|
|
287
291
|
{ resolvedUrl: odspResolvedUrl, docId: odspResolvedUrl.hashedDocumentId },
|
|
288
|
-
|
|
292
|
+
extLogger,
|
|
289
293
|
clientIsSummarizer,
|
|
294
|
+
this.hostPolicy,
|
|
290
295
|
);
|
|
291
296
|
|
|
292
297
|
const storageTokenFetcher = toInstrumentedOdspTokenFetcher(
|
|
293
|
-
|
|
298
|
+
extLogger,
|
|
294
299
|
resolvedUrlData,
|
|
295
300
|
this.getStorageToken,
|
|
296
301
|
true /* throwOnNullToken */,
|
|
@@ -299,9 +304,9 @@ export class OdspDocumentServiceFactoryCore
|
|
|
299
304
|
const webSocketTokenFetcher =
|
|
300
305
|
this.getWebsocketToken === undefined
|
|
301
306
|
? undefined
|
|
302
|
-
: async (options: TokenFetchOptions) =>
|
|
307
|
+
: async (options: TokenFetchOptions): Promise<string | null> =>
|
|
303
308
|
toInstrumentedOdspTokenFetcher(
|
|
304
|
-
|
|
309
|
+
extLogger,
|
|
305
310
|
resolvedUrlData,
|
|
306
311
|
this.getWebsocketToken!,
|
|
307
312
|
false /* throwOnNullToken */,
|
|
@@ -311,7 +316,7 @@ export class OdspDocumentServiceFactoryCore
|
|
|
311
316
|
resolvedUrl,
|
|
312
317
|
storageTokenFetcher,
|
|
313
318
|
webSocketTokenFetcher,
|
|
314
|
-
|
|
319
|
+
extLogger,
|
|
315
320
|
cacheAndTracker.cache,
|
|
316
321
|
this.hostPolicy,
|
|
317
322
|
cacheAndTracker.epochTracker,
|
|
@@ -335,9 +340,11 @@ function getSharingLinkParams(
|
|
|
335
340
|
const createLinkRole = searchParams.get("createLinkRole");
|
|
336
341
|
if (createLinkScope && SharingLinkScope[createLinkScope]) {
|
|
337
342
|
createShareLinkParam = {
|
|
343
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
338
344
|
scope: SharingLinkScope[createLinkScope],
|
|
339
345
|
...(createLinkRole && SharingLinkRole[createLinkRole]
|
|
340
|
-
?
|
|
346
|
+
? // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
347
|
+
{ role: SharingLinkRole[createLinkRole] }
|
|
341
348
|
: {}),
|
|
342
349
|
};
|
|
343
350
|
}
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
IPersistedCache,
|
|
11
11
|
HostStoragePolicy,
|
|
12
12
|
} from "@fluidframework/odsp-driver-definitions";
|
|
13
|
-
import { OdspDocumentServiceFactoryCore } from "./odspDocumentServiceFactoryCore";
|
|
13
|
+
import { OdspDocumentServiceFactoryCore } from "./odspDocumentServiceFactoryCore.js";
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* @deprecated This is deprecated in favour of OdspDocumentServiceFactory as the socket io is now loaded inside the
|