@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
|
@@ -11,12 +11,12 @@ import {
|
|
|
11
11
|
LoaderCachingPolicy,
|
|
12
12
|
FiveDaysMs,
|
|
13
13
|
FetchSource,
|
|
14
|
+
ISnapshot,
|
|
15
|
+
ISnapshotFetchOptions,
|
|
14
16
|
} from "@fluidframework/driver-definitions";
|
|
17
|
+
import { maximumCacheDurationMs } from "@fluidframework/odsp-driver-definitions";
|
|
15
18
|
import * as api from "@fluidframework/protocol-definitions";
|
|
16
19
|
import { IConfigProvider } from "@fluidframework/telemetry-utils";
|
|
17
|
-
import { ISnapshotContents } from "./odspPublicUtils";
|
|
18
|
-
|
|
19
|
-
const maximumCacheDurationMs: FiveDaysMs = 432000000; // 5 * 24 * 60 * 60 * 1000 = 5 days in ms
|
|
20
20
|
|
|
21
21
|
class BlobCache {
|
|
22
22
|
// Save the timeout so we can cancel and reschedule it as needed
|
|
@@ -42,14 +42,14 @@ class BlobCache {
|
|
|
42
42
|
// So for now, purging is disabled.
|
|
43
43
|
private readonly purgeEnabled = false;
|
|
44
44
|
|
|
45
|
-
public get value() {
|
|
45
|
+
public get value(): Map<string, ArrayBuffer> {
|
|
46
46
|
return this._blobCache;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
public addBlobs(blobs: Map<string, ArrayBuffer>) {
|
|
50
|
-
blobs.
|
|
49
|
+
public addBlobs(blobs: Map<string, ArrayBuffer>): void {
|
|
50
|
+
for (const [blobId, value] of blobs.entries()) {
|
|
51
51
|
this._blobCache.set(blobId, value);
|
|
52
|
-
}
|
|
52
|
+
}
|
|
53
53
|
// Reset the timer on cache set
|
|
54
54
|
this.scheduleClearBlobsCache();
|
|
55
55
|
}
|
|
@@ -57,14 +57,14 @@ class BlobCache {
|
|
|
57
57
|
/**
|
|
58
58
|
* Schedule a timer for clearing the blob cache or defer the current one.
|
|
59
59
|
*/
|
|
60
|
-
private scheduleClearBlobsCache() {
|
|
60
|
+
private scheduleClearBlobsCache(): void {
|
|
61
61
|
if (this.blobCacheTimeout !== undefined) {
|
|
62
62
|
// If we already have an outstanding timer, just signal that we should defer the clear
|
|
63
63
|
this.deferBlobCacheClear = true;
|
|
64
64
|
} else if (this.purgeEnabled) {
|
|
65
65
|
// If we don't have an outstanding timer, set a timer
|
|
66
66
|
// When the timer runs out, we'll decide whether to proceed with the cache clear or reset the timer
|
|
67
|
-
const clearCacheOrDefer = () => {
|
|
67
|
+
const clearCacheOrDefer = (): void => {
|
|
68
68
|
this.blobCacheTimeout = undefined;
|
|
69
69
|
if (this.deferBlobCacheClear) {
|
|
70
70
|
this.deferBlobCacheClear = false;
|
|
@@ -76,7 +76,9 @@ class BlobCache {
|
|
|
76
76
|
// We want to optimize both - memory footprint and number of future requests to storage.
|
|
77
77
|
// Note that Container can realize data store or DDS on-demand at any point in time, so we do not
|
|
78
78
|
// control when blobs will be used.
|
|
79
|
-
|
|
79
|
+
for (const blobId of this._blobCache.keys()) {
|
|
80
|
+
this.blobsEvicted.add(blobId);
|
|
81
|
+
}
|
|
80
82
|
this._blobCache.clear();
|
|
81
83
|
}
|
|
82
84
|
};
|
|
@@ -87,7 +89,10 @@ class BlobCache {
|
|
|
87
89
|
}
|
|
88
90
|
}
|
|
89
91
|
|
|
90
|
-
public getBlob(blobId: string) {
|
|
92
|
+
public getBlob(blobId: string): {
|
|
93
|
+
blobContent: ArrayBuffer | undefined;
|
|
94
|
+
evicted: boolean;
|
|
95
|
+
} {
|
|
91
96
|
// Reset the timer on attempted cache read
|
|
92
97
|
this.scheduleClearBlobsCache();
|
|
93
98
|
const blobContent = this._blobCache.get(blobId);
|
|
@@ -95,7 +100,7 @@ class BlobCache {
|
|
|
95
100
|
return { blobContent, evicted };
|
|
96
101
|
}
|
|
97
102
|
|
|
98
|
-
public setBlob(blobId: string, blob: ArrayBuffer) {
|
|
103
|
+
public setBlob(blobId: string, blob: ArrayBuffer): Map<string, ArrayBuffer> | undefined {
|
|
99
104
|
// This API is called as result of cache miss and reading blob from storage.
|
|
100
105
|
// Runtime never reads same blob twice.
|
|
101
106
|
// The only reason we may get read request for same blob is blob de-duping in summaries.
|
|
@@ -136,8 +141,6 @@ export abstract class OdspDocumentStorageServiceBase implements IDocumentStorage
|
|
|
136
141
|
}
|
|
137
142
|
protected readonly commitCache: Map<string, api.ISnapshotTree> = new Map();
|
|
138
143
|
|
|
139
|
-
private readonly attributesBlobHandles: Set<string> = new Set();
|
|
140
|
-
|
|
141
144
|
private _ops: api.ISequencedDocumentMessage[] | undefined;
|
|
142
145
|
|
|
143
146
|
private _snapshotSequenceNumber: number | undefined;
|
|
@@ -153,12 +156,10 @@ export abstract class OdspDocumentStorageServiceBase implements IDocumentStorage
|
|
|
153
156
|
return this._ops;
|
|
154
157
|
}
|
|
155
158
|
|
|
156
|
-
public get snapshotSequenceNumber() {
|
|
159
|
+
public get snapshotSequenceNumber(): number | undefined {
|
|
157
160
|
return this._snapshotSequenceNumber;
|
|
158
161
|
}
|
|
159
162
|
|
|
160
|
-
public readonly repositoryUrl = "";
|
|
161
|
-
|
|
162
163
|
public abstract createBlob(file: ArrayBufferLike): Promise<api.ICreateBlobResponse>;
|
|
163
164
|
|
|
164
165
|
private async readBlobCore(blobId: string): Promise<ArrayBuffer> {
|
|
@@ -178,36 +179,29 @@ export abstract class OdspDocumentStorageServiceBase implements IDocumentStorage
|
|
|
178
179
|
// eslint-disable-next-line @rushstack/no-new-null
|
|
179
180
|
): Promise<api.ISnapshotTree | null> {
|
|
180
181
|
let id: string;
|
|
181
|
-
if (
|
|
182
|
+
if (version?.id) {
|
|
183
|
+
id = version.id;
|
|
184
|
+
} else {
|
|
185
|
+
// eslint-disable-next-line unicorn/no-null
|
|
182
186
|
const versions = await this.getVersions(null, 1, scenarioName);
|
|
183
187
|
if (!versions || versions.length === 0) {
|
|
188
|
+
// eslint-disable-next-line unicorn/no-null
|
|
184
189
|
return null;
|
|
185
190
|
}
|
|
186
191
|
id = versions[0].id;
|
|
187
|
-
} else {
|
|
188
|
-
id = version.id;
|
|
189
192
|
}
|
|
190
193
|
|
|
191
194
|
const snapshotTree = await this.readTree(id, scenarioName);
|
|
192
195
|
if (!snapshotTree) {
|
|
196
|
+
// eslint-disable-next-line unicorn/no-null
|
|
193
197
|
return null;
|
|
194
198
|
}
|
|
195
199
|
|
|
196
|
-
|
|
197
|
-
const attributesBlob = snapshotTree.blobs.attributes;
|
|
198
|
-
if (attributesBlob) {
|
|
199
|
-
this.attributesBlobHandles.add(attributesBlob);
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
// When we upload the container snapshot, we upload appTree in ".app" and protocol tree in ".protocol"
|
|
204
|
-
// So when we request the snapshot we get ".app" as tree and not as commit node as in the case just above.
|
|
205
|
-
const appTree = snapshotTree.trees[".app"];
|
|
206
|
-
const protocolTree = snapshotTree.trees[".protocol"];
|
|
207
|
-
|
|
208
|
-
return this.combineProtocolAndAppSnapshotTree(appTree, protocolTree);
|
|
200
|
+
return this.combineProtocolAndAppSnapshotTree(snapshotTree);
|
|
209
201
|
}
|
|
210
202
|
|
|
203
|
+
public abstract getSnapshot(snapshotFetchOptions?: ISnapshotFetchOptions): Promise<ISnapshot>;
|
|
204
|
+
|
|
211
205
|
public abstract getVersions(
|
|
212
206
|
// eslint-disable-next-line @rushstack/no-new-null
|
|
213
207
|
blobid: string | null,
|
|
@@ -225,11 +219,11 @@ export abstract class OdspDocumentStorageServiceBase implements IDocumentStorage
|
|
|
225
219
|
throw new Error("Not implemented yet");
|
|
226
220
|
}
|
|
227
221
|
|
|
228
|
-
protected setRootTree(id: string, tree: api.ISnapshotTree) {
|
|
222
|
+
protected setRootTree(id: string, tree: api.ISnapshotTree): void {
|
|
229
223
|
this.commitCache.set(id, tree);
|
|
230
224
|
}
|
|
231
225
|
|
|
232
|
-
protected initBlobsCache(blobs: Map<string, ArrayBuffer>) {
|
|
226
|
+
protected initBlobsCache(blobs: Map<string, ArrayBuffer>): void {
|
|
233
227
|
this.blobCache.addBlobs(blobs);
|
|
234
228
|
}
|
|
235
229
|
|
|
@@ -239,6 +233,7 @@ export abstract class OdspDocumentStorageServiceBase implements IDocumentStorage
|
|
|
239
233
|
tree = await this.fetchTreeFromSnapshot(id, scenarioName);
|
|
240
234
|
}
|
|
241
235
|
|
|
236
|
+
// eslint-disable-next-line unicorn/no-null
|
|
242
237
|
return tree ?? null;
|
|
243
238
|
}
|
|
244
239
|
|
|
@@ -247,42 +242,52 @@ export abstract class OdspDocumentStorageServiceBase implements IDocumentStorage
|
|
|
247
242
|
scenarioName?: string,
|
|
248
243
|
): Promise<api.ISnapshotTree | undefined>;
|
|
249
244
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
245
|
+
protected combineProtocolAndAppSnapshotTree(
|
|
246
|
+
snapshotTree: api.ISnapshotTree,
|
|
247
|
+
): api.ISnapshotTree {
|
|
248
|
+
// When we upload the container snapshot, we upload appTree in ".app" and protocol tree in ".protocol"
|
|
249
|
+
// So when we request the snapshot we get ".app" as tree and not as commit node as in the case just above.
|
|
250
|
+
const hierarchicalAppTree = snapshotTree.trees[".app"];
|
|
251
|
+
const hierarchicalProtocolTree = snapshotTree.trees[".protocol"];
|
|
254
252
|
const summarySnapshotTree: api.ISnapshotTree = {
|
|
255
253
|
blobs: {
|
|
256
254
|
...hierarchicalAppTree.blobs,
|
|
257
255
|
},
|
|
258
256
|
trees: {
|
|
259
257
|
...hierarchicalAppTree.trees,
|
|
260
|
-
// the app tree could have a .protocol
|
|
261
|
-
// in that case we want to server protocol to override it
|
|
262
|
-
".protocol": hierarchicalProtocolTree,
|
|
263
258
|
},
|
|
264
259
|
};
|
|
265
260
|
|
|
261
|
+
// The app tree could have a .protocol in that case we want to server protocol to override it.
|
|
262
|
+
// Snapshot which are for a loading GroupId, will not have a protocol tree.
|
|
263
|
+
if (hierarchicalProtocolTree !== undefined) {
|
|
264
|
+
summarySnapshotTree.trees[".protocol"] = hierarchicalProtocolTree;
|
|
265
|
+
}
|
|
266
|
+
|
|
266
267
|
return summarySnapshotTree;
|
|
267
268
|
}
|
|
268
269
|
|
|
269
270
|
protected initializeFromSnapshot(
|
|
270
|
-
odspSnapshotCacheValue:
|
|
271
|
+
odspSnapshotCacheValue: ISnapshot,
|
|
271
272
|
cacheOps: boolean = true,
|
|
273
|
+
cacheSnapshot: boolean = true,
|
|
272
274
|
): string | undefined {
|
|
273
275
|
this._snapshotSequenceNumber = odspSnapshotCacheValue.sequenceNumber;
|
|
274
|
-
const { snapshotTree,
|
|
276
|
+
const { snapshotTree, blobContents, ops } = odspSnapshotCacheValue;
|
|
275
277
|
|
|
276
278
|
// id should be undefined in case of just ops in snapshot.
|
|
277
279
|
let id: string | undefined;
|
|
278
280
|
if (snapshotTree) {
|
|
279
281
|
id = snapshotTree.id;
|
|
280
282
|
assert(id !== undefined, 0x221 /* "Root tree should contain the id" */);
|
|
281
|
-
|
|
283
|
+
if (cacheSnapshot) {
|
|
284
|
+
this.setRootTree(id, snapshotTree);
|
|
285
|
+
}
|
|
282
286
|
}
|
|
283
287
|
|
|
284
|
-
|
|
285
|
-
|
|
288
|
+
// Currently always cache blobs as container runtime is not caching them.
|
|
289
|
+
if (blobContents !== undefined) {
|
|
290
|
+
this.initBlobsCache(blobContents);
|
|
286
291
|
}
|
|
287
292
|
|
|
288
293
|
if (cacheOps) {
|
|
@@ -5,32 +5,37 @@
|
|
|
5
5
|
import { assert } from "@fluidframework/core-utils";
|
|
6
6
|
import { IRequest } from "@fluidframework/core-interfaces";
|
|
7
7
|
import {
|
|
8
|
-
DriverErrorType,
|
|
9
8
|
DriverHeader,
|
|
10
9
|
IContainerPackageInfo,
|
|
11
10
|
IResolvedUrl,
|
|
12
11
|
IUrlResolver,
|
|
13
12
|
} from "@fluidframework/driver-definitions";
|
|
14
|
-
import {
|
|
15
|
-
IOdspResolvedUrl,
|
|
16
|
-
ShareLinkTypes,
|
|
17
|
-
ShareLinkInfoType,
|
|
18
|
-
} from "@fluidframework/odsp-driver-definitions";
|
|
13
|
+
import { IOdspResolvedUrl, OdspErrorTypes } from "@fluidframework/odsp-driver-definitions";
|
|
19
14
|
import { NonRetryableError } from "@fluidframework/driver-utils";
|
|
20
|
-
import { createOdspUrl } from "./createOdspUrl";
|
|
21
|
-
import { getApiRoot } from "./odspUrlHelper";
|
|
22
|
-
import { getOdspResolvedUrl } from "./odspUtils";
|
|
23
|
-
import { getHashedDocumentId } from "./odspPublicUtils";
|
|
24
|
-
import { ClpCompliantAppHeader } from "./contractsPublic";
|
|
25
|
-
import { pkgVersion } from "./packageVersion";
|
|
15
|
+
import { createOdspUrl } from "./createOdspUrl.js";
|
|
16
|
+
import { getApiRoot } from "./odspUrlHelper.js";
|
|
17
|
+
import { getOdspResolvedUrl } from "./odspUtils.js";
|
|
18
|
+
import { getHashedDocumentId } from "./odspPublicUtils.js";
|
|
19
|
+
import { ClpCompliantAppHeader } from "./contractsPublic.js";
|
|
20
|
+
import { pkgVersion } from "./packageVersion.js";
|
|
26
21
|
|
|
27
|
-
function getUrlBase(
|
|
22
|
+
function getUrlBase(
|
|
23
|
+
siteUrl: string,
|
|
24
|
+
driveId: string,
|
|
25
|
+
itemId: string,
|
|
26
|
+
fileVersion?: string,
|
|
27
|
+
): string {
|
|
28
28
|
const siteOrigin = new URL(siteUrl).origin;
|
|
29
29
|
const version = fileVersion ? `versions/${fileVersion}/` : "";
|
|
30
30
|
return `${getApiRoot(siteOrigin)}/drives/${driveId}/items/${itemId}/${version}`;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
function getSnapshotUrl(
|
|
33
|
+
function getSnapshotUrl(
|
|
34
|
+
siteUrl: string,
|
|
35
|
+
driveId: string,
|
|
36
|
+
itemId: string,
|
|
37
|
+
fileVersion?: string,
|
|
38
|
+
): string {
|
|
34
39
|
const urlBase = getUrlBase(siteUrl, driveId, itemId, fileVersion);
|
|
35
40
|
return `${urlBase}opStream/snapshots`;
|
|
36
41
|
}
|
|
@@ -40,7 +45,7 @@ function getAttachmentPOSTUrl(
|
|
|
40
45
|
driveId: string,
|
|
41
46
|
itemId: string,
|
|
42
47
|
fileVersion?: string,
|
|
43
|
-
) {
|
|
48
|
+
): string {
|
|
44
49
|
const urlBase = getUrlBase(siteUrl, driveId, itemId, fileVersion);
|
|
45
50
|
return `${urlBase}opStream/attachment`;
|
|
46
51
|
}
|
|
@@ -50,7 +55,7 @@ function getAttachmentGETUrl(
|
|
|
50
55
|
driveId: string,
|
|
51
56
|
itemId: string,
|
|
52
57
|
fileVersion?: string,
|
|
53
|
-
) {
|
|
58
|
+
): string {
|
|
54
59
|
const urlBase = getUrlBase(siteUrl, driveId, itemId, fileVersion);
|
|
55
60
|
return `${urlBase}opStream/attachments`;
|
|
56
61
|
}
|
|
@@ -60,7 +65,7 @@ function getDeltaStorageUrl(
|
|
|
60
65
|
driveId: string,
|
|
61
66
|
itemId: string,
|
|
62
67
|
fileVersion?: string,
|
|
63
|
-
) {
|
|
68
|
+
): string {
|
|
64
69
|
const urlBase = getUrlBase(siteUrl, driveId, itemId, fileVersion);
|
|
65
70
|
return `${urlBase}opStream`;
|
|
66
71
|
}
|
|
@@ -71,12 +76,16 @@ function getDeltaStorageUrl(
|
|
|
71
76
|
*/
|
|
72
77
|
function removeBeginningSlash(str: string): string {
|
|
73
78
|
if (str.startsWith("/")) {
|
|
74
|
-
return str.
|
|
79
|
+
return str.slice(1);
|
|
75
80
|
}
|
|
76
81
|
|
|
77
82
|
return str;
|
|
78
83
|
}
|
|
79
84
|
|
|
85
|
+
// back-compat: GitHub #9653
|
|
86
|
+
const isFluidPackage = (pkg: Record<string, unknown>): boolean =>
|
|
87
|
+
typeof pkg === "object" && typeof pkg?.name === "string" && typeof pkg?.fluid === "object";
|
|
88
|
+
|
|
80
89
|
/**
|
|
81
90
|
* Resolver to resolve urls like the ones created by createOdspUrl which is driver inner
|
|
82
91
|
* url format. Ex: `${siteUrl}?driveId=${driveId}&itemId=${itemId}&path=${path}`
|
|
@@ -86,34 +95,26 @@ export class OdspDriverUrlResolver implements IUrlResolver {
|
|
|
86
95
|
constructor() {}
|
|
87
96
|
|
|
88
97
|
/**
|
|
89
|
-
* @
|
|
98
|
+
* {@inheritDoc @fluidframework/driver-definitions#IUrlResolver.resolve}
|
|
90
99
|
*/
|
|
91
100
|
public async resolve(request: IRequest): Promise<IOdspResolvedUrl> {
|
|
92
101
|
if (request.headers?.[DriverHeader.createNew]) {
|
|
93
102
|
const [siteURL, queryString] = request.url.split("?");
|
|
94
103
|
|
|
95
104
|
const searchParams = new URLSearchParams(queryString);
|
|
96
|
-
|
|
105
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
|
|
106
|
+
const fileName: string = request.headers[DriverHeader.createNew].fileName;
|
|
97
107
|
const driveID = searchParams.get("driveId");
|
|
98
108
|
const filePath = searchParams.get("path");
|
|
99
109
|
const packageName = searchParams.get("containerPackageName");
|
|
100
|
-
const createLinkType = searchParams.get("createLinkType");
|
|
101
110
|
// eslint-disable-next-line @typescript-eslint/prefer-optional-chain -- false positive
|
|
102
111
|
if (!(fileName && siteURL && driveID && filePath !== null && filePath !== undefined)) {
|
|
103
112
|
throw new NonRetryableError(
|
|
104
|
-
"Proper new file params should be there
|
|
105
|
-
|
|
113
|
+
"Proper new file params should be there",
|
|
114
|
+
OdspErrorTypes.genericError,
|
|
106
115
|
{ driverVersion: pkgVersion },
|
|
107
116
|
);
|
|
108
117
|
}
|
|
109
|
-
let shareLinkInfo: ShareLinkInfoType | undefined;
|
|
110
|
-
if (createLinkType && createLinkType in ShareLinkTypes) {
|
|
111
|
-
shareLinkInfo = {
|
|
112
|
-
createLink: {
|
|
113
|
-
type: ShareLinkTypes[createLinkType],
|
|
114
|
-
},
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
118
|
return {
|
|
118
119
|
endpoints: {
|
|
119
120
|
snapshotStorageUrl: "",
|
|
@@ -125,7 +126,7 @@ export class OdspDriverUrlResolver implements IUrlResolver {
|
|
|
125
126
|
type: "fluid",
|
|
126
127
|
odspResolvedUrl: true,
|
|
127
128
|
id: "odspCreateNew",
|
|
128
|
-
url: `
|
|
129
|
+
url: `https://${siteURL}?${queryString}&version=null`,
|
|
129
130
|
siteUrl: siteURL,
|
|
130
131
|
hashedDocumentId: "",
|
|
131
132
|
driveId: driveID,
|
|
@@ -136,7 +137,7 @@ export class OdspDriverUrlResolver implements IUrlResolver {
|
|
|
136
137
|
containerPackageName: packageName ?? undefined,
|
|
137
138
|
},
|
|
138
139
|
fileVersion: undefined,
|
|
139
|
-
shareLinkInfo,
|
|
140
|
+
shareLinkInfo: undefined,
|
|
140
141
|
isClpCompliantApp: request.headers?.[ClpCompliantAppHeader.isClpCompliantApp],
|
|
141
142
|
};
|
|
142
143
|
}
|
|
@@ -146,7 +147,7 @@ export class OdspDriverUrlResolver implements IUrlResolver {
|
|
|
146
147
|
const hashedDocumentId = await getHashedDocumentId(driveId, itemId);
|
|
147
148
|
assert(!hashedDocumentId.includes("/"), 0x0a8 /* "Docid should not contain slashes!!" */);
|
|
148
149
|
|
|
149
|
-
const documentUrl = `
|
|
150
|
+
const documentUrl = `https://placeholder/placeholder/${hashedDocumentId}/${removeBeginningSlash(
|
|
150
151
|
path,
|
|
151
152
|
)}`;
|
|
152
153
|
|
|
@@ -204,21 +205,20 @@ export class OdspDriverUrlResolver implements IUrlResolver {
|
|
|
204
205
|
dataStorePath = odspResolvedUrl.dataStorePath;
|
|
205
206
|
}
|
|
206
207
|
if (dataStorePath.startsWith("/")) {
|
|
207
|
-
dataStorePath = dataStorePath.
|
|
208
|
+
dataStorePath = dataStorePath.slice(1);
|
|
208
209
|
}
|
|
209
210
|
|
|
210
|
-
|
|
211
|
-
const isFluidPackage = (pkg: any) =>
|
|
212
|
-
typeof pkg === "object" &&
|
|
213
|
-
typeof pkg?.name === "string" &&
|
|
214
|
-
typeof pkg?.fluid === "object";
|
|
215
|
-
let containerPackageName;
|
|
211
|
+
let containerPackageName: string | undefined;
|
|
216
212
|
if (packageInfoSource && "name" in packageInfoSource) {
|
|
217
213
|
containerPackageName = packageInfoSource.name;
|
|
218
214
|
// packageInfoSource is cast to any as it is typed to IContainerPackageInfo instead of IFluidCodeDetails
|
|
215
|
+
// TODO: use stronger type
|
|
216
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any
|
|
219
217
|
} else if (isFluidPackage((packageInfoSource as any)?.package)) {
|
|
218
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any
|
|
220
219
|
containerPackageName = (packageInfoSource as any)?.package.name;
|
|
221
220
|
} else {
|
|
221
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any
|
|
222
222
|
containerPackageName = (packageInfoSource as any)?.package;
|
|
223
223
|
}
|
|
224
224
|
containerPackageName =
|
|
@@ -19,14 +19,13 @@ import {
|
|
|
19
19
|
import {
|
|
20
20
|
getLocatorFromOdspUrl,
|
|
21
21
|
storeLocatorInOdspUrl,
|
|
22
|
-
encodeOdspFluidDataStoreLocator,
|
|
23
22
|
locatorQueryParamName,
|
|
24
|
-
} from "./odspFluidFileLink";
|
|
25
|
-
import { OdspFluidDataStoreLocator, SharingLinkHeader } from "./contractsPublic";
|
|
26
|
-
import { createOdspUrl } from "./createOdspUrl";
|
|
27
|
-
import { OdspDriverUrlResolver } from "./odspDriverUrlResolver";
|
|
28
|
-
import { getOdspResolvedUrl, createOdspLogger } from "./odspUtils";
|
|
29
|
-
import { getFileLink } from "./getFileLink";
|
|
23
|
+
} from "./odspFluidFileLink.js";
|
|
24
|
+
import { OdspFluidDataStoreLocator, SharingLinkHeader } from "./contractsPublic.js";
|
|
25
|
+
import { createOdspUrl } from "./createOdspUrl.js";
|
|
26
|
+
import { OdspDriverUrlResolver } from "./odspDriverUrlResolver.js";
|
|
27
|
+
import { getOdspResolvedUrl, createOdspLogger } from "./odspUtils.js";
|
|
28
|
+
import { getFileLink } from "./getFileLink.js";
|
|
30
29
|
|
|
31
30
|
/**
|
|
32
31
|
* Properties passed to the code responsible for fetching share link for a file.
|
|
@@ -43,6 +42,10 @@ export interface ShareLinkFetcherProps {
|
|
|
43
42
|
identityType: IdentityType;
|
|
44
43
|
}
|
|
45
44
|
|
|
45
|
+
// back-compat: GitHub #9653
|
|
46
|
+
const isFluidPackage = (pkg: Record<string, unknown>): boolean =>
|
|
47
|
+
typeof pkg === "object" && typeof pkg?.name === "string" && typeof pkg?.fluid === "object";
|
|
48
|
+
|
|
46
49
|
/**
|
|
47
50
|
* Resolver to resolve urls like the ones created by createOdspUrl which is driver inner
|
|
48
51
|
* url format and the ones which have things like driveId, siteId, itemId etc encoded in nav param.
|
|
@@ -102,9 +105,9 @@ export class OdspDriverUrlResolverForShareLink implements IUrlResolver {
|
|
|
102
105
|
// Determine if the caller is passing a query parameter or path since processing will be different.
|
|
103
106
|
if (pathToAppend.startsWith("/?") || pathToAppend.startsWith("?")) {
|
|
104
107
|
const queryParams = new URLSearchParams(pathToAppend);
|
|
105
|
-
|
|
108
|
+
for (const [key, value] of queryParams.entries()) {
|
|
106
109
|
parsingUrl.searchParams.append(key, value);
|
|
107
|
-
}
|
|
110
|
+
}
|
|
108
111
|
fluidInfo.dataStorePath = `${parsingUrl.pathname}${parsingUrl.search}`;
|
|
109
112
|
} else {
|
|
110
113
|
fluidInfo.dataStorePath = `${parsingUrl.pathname}${
|
|
@@ -214,34 +217,55 @@ export class OdspDriverUrlResolverForShareLink implements IUrlResolver {
|
|
|
214
217
|
const odspResolvedUrl = getOdspResolvedUrl(resolvedUrl);
|
|
215
218
|
|
|
216
219
|
const shareLink = await this.getShareLinkPromise(odspResolvedUrl);
|
|
217
|
-
const shareLinkUrl = new URL(shareLink);
|
|
218
220
|
|
|
219
|
-
|
|
221
|
+
return this.appendLocatorParams(shareLink, resolvedUrl, dataStorePath, packageInfoSource);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Appends the store locator properties to the provided base URL. This function is useful for scenarios where an application
|
|
226
|
+
* has a base URL (for example a sharing link) of the Fluid file, but does not have the locator information that would be used by Fluid
|
|
227
|
+
* to load the file later.
|
|
228
|
+
* @param baseUrl - The input URL on which the locator params will be appended.
|
|
229
|
+
* @param resolvedUrl - odsp-driver's resolvedURL object.
|
|
230
|
+
* @param dataStorePath - The relative data store path URL.
|
|
231
|
+
* For requesting a driver URL, this value should always be '/'. If an empty string is passed, then dataStorePath
|
|
232
|
+
* will be extracted from the resolved url if present.
|
|
233
|
+
* @returns The provided base URL appended with odsp-specific locator information
|
|
234
|
+
*/
|
|
235
|
+
public async appendLocatorParams(
|
|
236
|
+
baseUrl: string,
|
|
237
|
+
resolvedUrl: IResolvedUrl,
|
|
238
|
+
dataStorePath: string,
|
|
239
|
+
packageInfoSource?: IContainerPackageInfo,
|
|
240
|
+
): Promise<string> {
|
|
241
|
+
const url = new URL(baseUrl);
|
|
242
|
+
const odspResolvedUrl = getOdspResolvedUrl(resolvedUrl);
|
|
243
|
+
|
|
220
244
|
// If the user has passed an empty dataStorePath, then extract it from the resolved url.
|
|
221
|
-
|
|
222
|
-
actualDataStorePath = odspResolvedUrl.dataStorePath;
|
|
223
|
-
}
|
|
245
|
+
const actualDataStorePath = dataStorePath || (odspResolvedUrl.dataStorePath ?? "");
|
|
224
246
|
|
|
225
|
-
|
|
226
|
-
const isFluidPackage = (pkg: any) =>
|
|
227
|
-
typeof pkg === "object" &&
|
|
228
|
-
typeof pkg?.name === "string" &&
|
|
229
|
-
typeof pkg?.fluid === "object";
|
|
230
|
-
let containerPackageName;
|
|
247
|
+
let containerPackageName: string | undefined;
|
|
231
248
|
if (packageInfoSource && "name" in packageInfoSource) {
|
|
232
249
|
containerPackageName = packageInfoSource.name;
|
|
233
250
|
// packageInfoSource is cast to any as it is typed to IContainerPackageInfo instead of IFluidCodeDetails
|
|
251
|
+
// TODO: use a stronger type
|
|
252
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any
|
|
234
253
|
} else if (isFluidPackage((packageInfoSource as any)?.package)) {
|
|
254
|
+
// TODO: use a stronger type
|
|
255
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any
|
|
235
256
|
containerPackageName = (packageInfoSource as any)?.package.name;
|
|
236
257
|
} else {
|
|
258
|
+
// TODO: use a stronger type
|
|
259
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any
|
|
237
260
|
containerPackageName = (packageInfoSource as any)?.package;
|
|
238
261
|
}
|
|
262
|
+
// TODO: use a stronger type
|
|
239
263
|
containerPackageName =
|
|
240
264
|
containerPackageName ?? odspResolvedUrl.codeHint?.containerPackageName;
|
|
241
265
|
|
|
242
266
|
const context = await this.getContext?.(odspResolvedUrl, actualDataStorePath);
|
|
243
267
|
|
|
244
|
-
storeLocatorInOdspUrl(
|
|
268
|
+
storeLocatorInOdspUrl(url, {
|
|
245
269
|
siteUrl: odspResolvedUrl.siteUrl,
|
|
246
270
|
driveId: odspResolvedUrl.driveId,
|
|
247
271
|
itemId: odspResolvedUrl.itemId,
|
|
@@ -252,25 +276,20 @@ export class OdspDriverUrlResolverForShareLink implements IUrlResolver {
|
|
|
252
276
|
context,
|
|
253
277
|
});
|
|
254
278
|
|
|
255
|
-
return
|
|
279
|
+
return url.href;
|
|
256
280
|
}
|
|
257
281
|
|
|
258
282
|
/**
|
|
259
283
|
* Crafts a supported document/driver URL
|
|
260
284
|
*/
|
|
261
|
-
public static createDocumentUrl(
|
|
285
|
+
public static createDocumentUrl(
|
|
286
|
+
baseUrl: string,
|
|
287
|
+
driverInfo: OdspFluidDataStoreLocator,
|
|
288
|
+
): string {
|
|
262
289
|
const url = new URL(baseUrl);
|
|
263
290
|
|
|
264
291
|
storeLocatorInOdspUrl(url, driverInfo);
|
|
265
292
|
|
|
266
293
|
return url.href;
|
|
267
294
|
}
|
|
268
|
-
|
|
269
|
-
/**
|
|
270
|
-
* Crafts a supported data store nav param
|
|
271
|
-
* @deprecated encodeOdspFluidDataStoreLocator should be used instead
|
|
272
|
-
*/
|
|
273
|
-
public static createNavParam(locator: OdspFluidDataStoreLocator) {
|
|
274
|
-
return encodeOdspFluidDataStoreLocator(locator);
|
|
275
|
-
}
|
|
276
295
|
}
|
package/src/odspError.ts
CHANGED
|
@@ -3,13 +3,12 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { createOdspNetworkError } from "@fluidframework/odsp-doclib-utils";
|
|
7
|
-
import { DriverErrorType } from "@fluidframework/driver-definitions";
|
|
6
|
+
import { createOdspNetworkError } from "@fluidframework/odsp-doclib-utils/internal";
|
|
8
7
|
import { NonRetryableError } from "@fluidframework/driver-utils";
|
|
9
|
-
import { OdspError } from "@fluidframework/odsp-driver-definitions";
|
|
8
|
+
import { OdspError, OdspErrorTypes } from "@fluidframework/odsp-driver-definitions";
|
|
10
9
|
import { getCircularReplacer, IFluidErrorBase } from "@fluidframework/telemetry-utils";
|
|
11
|
-
import { IOdspSocketError } from "./contracts";
|
|
12
|
-
import { pkgVersion as driverVersion } from "./packageVersion";
|
|
10
|
+
import { IOdspSocketError } from "./contracts.js";
|
|
11
|
+
import { pkgVersion as driverVersion } from "./packageVersion.js";
|
|
13
12
|
|
|
14
13
|
/**
|
|
15
14
|
* Returns network error based on error object from ODSP socket (IOdspSocketError)
|
|
@@ -34,10 +33,10 @@ export function errorObjectFromSocketError(
|
|
|
34
33
|
|
|
35
34
|
error.addTelemetryProperties({ odspError: true, relayServiceError: true });
|
|
36
35
|
return error;
|
|
37
|
-
} catch
|
|
36
|
+
} catch {
|
|
38
37
|
return new NonRetryableError(
|
|
39
38
|
"Internal error: errorObjectFromSocketError",
|
|
40
|
-
|
|
39
|
+
OdspErrorTypes.fileNotFoundOrAccessDeniedError,
|
|
41
40
|
{ driverVersion },
|
|
42
41
|
);
|
|
43
42
|
}
|
package/src/odspFluidFileLink.ts
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { fromBase64ToUtf8, fromUtf8ToBase64 } from "@fluid-internal/client-utils";
|
|
7
|
-
import { OdspFluidDataStoreLocator } from "./contractsPublic";
|
|
8
|
-
import { OdcFileSiteOrigin, OdcApiSiteOrigin } from "./constants";
|
|
7
|
+
import { OdspFluidDataStoreLocator } from "./contractsPublic.js";
|
|
8
|
+
import { OdcFileSiteOrigin, OdcApiSiteOrigin } from "./constants.js";
|
|
9
9
|
|
|
10
10
|
const fluidSignature = "1";
|
|
11
11
|
const fluidSignatureParamName = "fluid";
|
|
@@ -122,7 +122,7 @@ export const locatorQueryParamName = "nav";
|
|
|
122
122
|
* @param locator - object representing Fluid data store location in ODSP terms
|
|
123
123
|
* @alpha
|
|
124
124
|
*/
|
|
125
|
-
export function storeLocatorInOdspUrl(url: URL, locator: OdspFluidDataStoreLocator) {
|
|
125
|
+
export function storeLocatorInOdspUrl(url: URL, locator: OdspFluidDataStoreLocator): void {
|
|
126
126
|
const encodedLocatorValue = encodeOdspFluidDataStoreLocator(locator);
|
|
127
127
|
// IMPORTANT: Do not apply encodeURIComponent to encodedLocatorValue, param value is automatically encoded
|
|
128
128
|
// when set via URLSearchParams class
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import { IResolvedUrl } from "@fluidframework/driver-definitions";
|
|
7
7
|
import { IOdspResolvedUrl } from "@fluidframework/odsp-driver-definitions";
|
|
8
|
-
import { getOdspResolvedUrl } from "./odspUtils";
|
|
8
|
+
import { getOdspResolvedUrl } from "./odspUtils.js";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* It takes a resolved url with old siteUrl and creates a new resolved url with updated site url domain.
|
package/src/odspPublicUtils.ts
CHANGED
|
@@ -7,6 +7,9 @@ import { hashFile, IsoBuffer } from "@fluid-internal/client-utils";
|
|
|
7
7
|
import { ISequencedDocumentMessage, ISnapshotTree } from "@fluidframework/protocol-definitions";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
+
* Creates a unique and stable id for a document stored in ODSP which doesn't expose the driveId and itemId of
|
|
11
|
+
* said document.
|
|
12
|
+
*
|
|
10
13
|
* @alpha
|
|
11
14
|
*/
|
|
12
15
|
export async function getHashedDocumentId(driveId: string, itemId: string): Promise<string> {
|
|
@@ -16,6 +19,7 @@ export async function getHashedDocumentId(driveId: string, itemId: string): Prom
|
|
|
16
19
|
|
|
17
20
|
/**
|
|
18
21
|
* @alpha
|
|
22
|
+
* @deprecated - This is deprecated.
|
|
19
23
|
*/
|
|
20
24
|
export interface ISnapshotContents {
|
|
21
25
|
snapshotTree: ISnapshotTree;
|