@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
package/src/contracts.ts
CHANGED
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
import * as api from "@fluidframework/protocol-definitions";
|
|
7
7
|
import { HostStoragePolicy } from "@fluidframework/odsp-driver-definitions";
|
|
8
8
|
import { ISnapshot } from "@fluidframework/driver-definitions";
|
|
9
|
-
|
|
9
|
+
// eslint-disable-next-line import/no-deprecated
|
|
10
|
+
import { ISnapshotContents } from "./odspPublicUtils.js";
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* Interface for error responses for the WebSocket connection
|
|
@@ -34,7 +35,7 @@ export interface IOdspSocketError {
|
|
|
34
35
|
* Any error supplied by the socket containing codes and inner errors with further
|
|
35
36
|
* details about the error.
|
|
36
37
|
*/
|
|
37
|
-
error?:
|
|
38
|
+
error?: unknown;
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
/**
|
|
@@ -86,6 +87,7 @@ export interface IOdspSummaryTreeValueEntry extends IOdspSummaryTreeBaseEntry {
|
|
|
86
87
|
value: OdspSummaryTreeValue;
|
|
87
88
|
// Indicates that this tree entry is unreferenced. If this is not present, the tree entry is considered referenced.
|
|
88
89
|
unreferenced?: true;
|
|
90
|
+
groupId?: string;
|
|
89
91
|
}
|
|
90
92
|
|
|
91
93
|
export interface IOdspSummaryTreeHandleEntry extends IOdspSummaryTreeBaseEntry {
|
|
@@ -116,6 +118,7 @@ export interface IOdspSnapshotTreeEntryTree {
|
|
|
116
118
|
type: "tree";
|
|
117
119
|
// Indicates that this tree entry is unreferenced. If this is not present, the tree entry is considered referenced.
|
|
118
120
|
unreferenced?: true;
|
|
121
|
+
groupId?: string;
|
|
119
122
|
}
|
|
120
123
|
|
|
121
124
|
export interface IOdspSnapshotTreeEntryCommit {
|
|
@@ -178,12 +181,16 @@ export interface ICreateFileResponse {
|
|
|
178
181
|
"itemUrl": string;
|
|
179
182
|
"sequenceNumber": number;
|
|
180
183
|
// sharing object contains shareId, sharingLink data or error in the response
|
|
184
|
+
// TODO: use a stronger type
|
|
185
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
181
186
|
"sharing"?: any;
|
|
182
187
|
"sharingLink"?: string;
|
|
183
188
|
"sharingLinkErrorReason"?: string;
|
|
184
189
|
}
|
|
185
190
|
|
|
186
191
|
export interface IVersionedValueWithEpoch {
|
|
192
|
+
// TODO: use a stronger type
|
|
193
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
187
194
|
value: any;
|
|
188
195
|
fluidEpoch: string;
|
|
189
196
|
// This is same as "persistedCacheValueVersion" below. This represents the version of data stored in cache.
|
|
@@ -195,7 +202,9 @@ export const persistedCacheValueVersion = 3;
|
|
|
195
202
|
export interface IGetOpsResponse {
|
|
196
203
|
nonce: string;
|
|
197
204
|
code: number;
|
|
198
|
-
/**
|
|
205
|
+
/**
|
|
206
|
+
* Time in seconds. Currently never set by PUSH
|
|
207
|
+
*/
|
|
199
208
|
retryAfter?: number;
|
|
200
209
|
messages?: api.ISequencedDocumentMessage[];
|
|
201
210
|
}
|
|
@@ -203,7 +212,9 @@ export interface IGetOpsResponse {
|
|
|
203
212
|
export interface IFlushOpsResponse {
|
|
204
213
|
nonce: string;
|
|
205
214
|
code: number;
|
|
206
|
-
/**
|
|
215
|
+
/**
|
|
216
|
+
* Time in seconds
|
|
217
|
+
*/
|
|
207
218
|
retryAfter?: number;
|
|
208
219
|
lastPersistedSequenceNumber?: number;
|
|
209
220
|
}
|
|
@@ -213,6 +224,7 @@ export interface IFlushOpsResponse {
|
|
|
213
224
|
* @deprecated - This will be replaced with ISnapshotCachedEntry2 which wraps the new ISnapshot interface.
|
|
214
225
|
* For now, to support back compat from cache, we need to keep it for now.
|
|
215
226
|
*/
|
|
227
|
+
// eslint-disable-next-line import/no-deprecated
|
|
216
228
|
export interface ISnapshotCachedEntry extends ISnapshotContents {
|
|
217
229
|
cacheEntryTime: number;
|
|
218
230
|
}
|
package/src/createFile.ts
CHANGED
|
@@ -15,31 +15,31 @@ import {
|
|
|
15
15
|
IFileEntry,
|
|
16
16
|
} from "@fluidframework/odsp-driver-definitions";
|
|
17
17
|
import { ISnapshot } from "@fluidframework/driver-definitions";
|
|
18
|
-
import { ICreateFileResponse } from "./contracts";
|
|
19
|
-
import { getUrlAndHeadersWithAuth } from "./getUrlAndHeadersWithAuth";
|
|
18
|
+
import { ICreateFileResponse } from "./contracts.js";
|
|
19
|
+
import { getUrlAndHeadersWithAuth } from "./getUrlAndHeadersWithAuth.js";
|
|
20
20
|
import {
|
|
21
21
|
buildOdspShareLinkReqParams,
|
|
22
22
|
createCacheSnapshotKey,
|
|
23
23
|
getWithRetryForTokenRefresh,
|
|
24
24
|
INewFileInfo,
|
|
25
25
|
getOrigin,
|
|
26
|
-
} from "./odspUtils";
|
|
27
|
-
import { createOdspUrl } from "./createOdspUrl";
|
|
28
|
-
import { getApiRoot } from "./odspUrlHelper";
|
|
29
|
-
import { EpochTracker } from "./epochTracker";
|
|
30
|
-
import { OdspDriverUrlResolver } from "./odspDriverUrlResolver";
|
|
26
|
+
} from "./odspUtils.js";
|
|
27
|
+
import { createOdspUrl } from "./createOdspUrl.js";
|
|
28
|
+
import { getApiRoot } from "./odspUrlHelper.js";
|
|
29
|
+
import { EpochTracker } from "./epochTracker.js";
|
|
30
|
+
import { OdspDriverUrlResolver } from "./odspDriverUrlResolver.js";
|
|
31
31
|
import {
|
|
32
32
|
convertCreateNewSummaryTreeToTreeAndBlobs,
|
|
33
33
|
convertSummaryIntoContainerSnapshot,
|
|
34
34
|
createNewFluidContainerCore,
|
|
35
|
-
} from "./createNewUtils";
|
|
36
|
-
import { runWithRetry } from "./retryUtils";
|
|
37
|
-
import { pkgVersion as driverVersion } from "./packageVersion";
|
|
38
|
-
import { ClpCompliantAppHeader } from "./contractsPublic";
|
|
35
|
+
} from "./createNewUtils.js";
|
|
36
|
+
import { runWithRetry } from "./retryUtils.js";
|
|
37
|
+
import { pkgVersion as driverVersion } from "./packageVersion.js";
|
|
38
|
+
import { ClpCompliantAppHeader } from "./contractsPublic.js";
|
|
39
39
|
|
|
40
40
|
const isInvalidFileName = (fileName: string): boolean => {
|
|
41
41
|
const invalidCharsRegex = /["*/:<>?\\|]+/g;
|
|
42
|
-
return
|
|
42
|
+
return invalidCharsRegex.test(fileName);
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
/**
|
|
@@ -134,10 +134,12 @@ function extractShareLinkData(
|
|
|
134
134
|
): ShareLinkInfoType | undefined {
|
|
135
135
|
let shareLinkInfo: ShareLinkInfoType | undefined;
|
|
136
136
|
if (enableSingleRequestForShareLinkWithCreate) {
|
|
137
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
137
138
|
const { sharing } = response;
|
|
138
139
|
if (!sharing) {
|
|
139
140
|
return;
|
|
140
141
|
}
|
|
142
|
+
/* eslint-disable @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access */
|
|
141
143
|
shareLinkInfo = {
|
|
142
144
|
createLink: {
|
|
143
145
|
link: sharing.sharingLink
|
|
@@ -152,6 +154,7 @@ function extractShareLinkData(
|
|
|
152
154
|
shareId: sharing.shareId,
|
|
153
155
|
},
|
|
154
156
|
};
|
|
157
|
+
/* eslint-enable @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access */
|
|
155
158
|
}
|
|
156
159
|
return shareLinkInfo;
|
|
157
160
|
}
|
|
@@ -209,7 +212,7 @@ export async function createNewEmptyFluidFile(
|
|
|
209
212
|
);
|
|
210
213
|
}
|
|
211
214
|
event.end({
|
|
212
|
-
headers: Object.keys(headers).length
|
|
215
|
+
headers: Object.keys(headers).length > 0 ? true : undefined,
|
|
213
216
|
...fetchResponse.propsToLog,
|
|
214
217
|
});
|
|
215
218
|
return content.id;
|
|
@@ -12,18 +12,18 @@ import {
|
|
|
12
12
|
InstrumentedStorageTokenFetcher,
|
|
13
13
|
IOdspResolvedUrl,
|
|
14
14
|
} from "@fluidframework/odsp-driver-definitions";
|
|
15
|
-
import { IWriteSummaryResponse } from "./contracts";
|
|
16
|
-
import { createCacheSnapshotKey, getOrigin, IExistingFileInfo } from "./odspUtils";
|
|
17
|
-
import { createOdspUrl } from "./createOdspUrl";
|
|
18
|
-
import { getApiRoot } from "./odspUrlHelper";
|
|
19
|
-
import { EpochTracker } from "./epochTracker";
|
|
20
|
-
import { OdspDriverUrlResolver } from "./odspDriverUrlResolver";
|
|
15
|
+
import { IWriteSummaryResponse } from "./contracts.js";
|
|
16
|
+
import { createCacheSnapshotKey, getOrigin, IExistingFileInfo } from "./odspUtils.js";
|
|
17
|
+
import { createOdspUrl } from "./createOdspUrl.js";
|
|
18
|
+
import { getApiRoot } from "./odspUrlHelper.js";
|
|
19
|
+
import { EpochTracker } from "./epochTracker.js";
|
|
20
|
+
import { OdspDriverUrlResolver } from "./odspDriverUrlResolver.js";
|
|
21
21
|
import {
|
|
22
22
|
convertCreateNewSummaryTreeToTreeAndBlobs,
|
|
23
23
|
convertSummaryIntoContainerSnapshot,
|
|
24
24
|
createNewFluidContainerCore,
|
|
25
|
-
} from "./createNewUtils";
|
|
26
|
-
import { ClpCompliantAppHeader } from "./contractsPublic";
|
|
25
|
+
} from "./createNewUtils.js";
|
|
26
|
+
import { ClpCompliantAppHeader } from "./contractsPublic.js";
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* Creates a new Fluid container on an existing file.
|
package/src/createNewModule.ts
CHANGED
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
export { createNewFluidFile } from "./createFile";
|
|
7
|
-
export { createNewContainerOnExistingFile } from "./createNewContainerOnExistingFile";
|
|
6
|
+
export { createNewFluidFile } from "./createFile.js";
|
|
7
|
+
export { createNewContainerOnExistingFile } from "./createNewContainerOnExistingFile.js";
|
package/src/createNewUtils.ts
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
ISummaryTree,
|
|
10
10
|
SummaryType,
|
|
11
11
|
ISnapshotTree,
|
|
12
|
+
type SummaryObject,
|
|
12
13
|
} from "@fluidframework/protocol-definitions";
|
|
13
14
|
import {
|
|
14
15
|
getDocAttributesFromProtocolSummary,
|
|
@@ -25,11 +26,11 @@ import {
|
|
|
25
26
|
IOdspSummaryTree,
|
|
26
27
|
OdspSummaryTreeEntry,
|
|
27
28
|
OdspSummaryTreeValue,
|
|
28
|
-
} from "./contracts";
|
|
29
|
-
import { getWithRetryForTokenRefresh, maxUmpPostBodySize } from "./odspUtils";
|
|
30
|
-
import { EpochTracker, FetchType } from "./epochTracker";
|
|
31
|
-
import { getUrlAndHeadersWithAuth } from "./getUrlAndHeadersWithAuth";
|
|
32
|
-
import { runWithRetry } from "./retryUtils";
|
|
29
|
+
} from "./contracts.js";
|
|
30
|
+
import { getWithRetryForTokenRefresh, maxUmpPostBodySize } from "./odspUtils.js";
|
|
31
|
+
import { EpochTracker, FetchType } from "./epochTracker.js";
|
|
32
|
+
import { getUrlAndHeadersWithAuth } from "./getUrlAndHeadersWithAuth.js";
|
|
33
|
+
import { runWithRetry } from "./retryUtils.js";
|
|
33
34
|
|
|
34
35
|
/**
|
|
35
36
|
* Converts a summary(ISummaryTree) taken in detached container to snapshot tree and blobs
|
|
@@ -59,11 +60,12 @@ export function convertCreateNewSummaryTreeToTreeAndBlobs(
|
|
|
59
60
|
function convertCreateNewSummaryTreeToTreeAndBlobsCore(
|
|
60
61
|
summary: ISummaryTree,
|
|
61
62
|
blobs: Map<string, ArrayBuffer>,
|
|
62
|
-
) {
|
|
63
|
+
): ISnapshotTree {
|
|
63
64
|
const treeNode: ISnapshotTree = {
|
|
64
65
|
blobs: {},
|
|
65
66
|
trees: {},
|
|
66
67
|
unreferenced: summary.unreferenced,
|
|
68
|
+
groupId: summary.groupId,
|
|
67
69
|
};
|
|
68
70
|
const keys = Object.keys(summary.tree);
|
|
69
71
|
for (const key of keys) {
|
|
@@ -92,14 +94,19 @@ function convertCreateNewSummaryTreeToTreeAndBlobsCore(
|
|
|
92
94
|
throw new Error(`No ${summaryObject.type} should be present for detached summary!`);
|
|
93
95
|
}
|
|
94
96
|
default: {
|
|
95
|
-
unreachableCase(
|
|
97
|
+
unreachableCase(
|
|
98
|
+
summaryObject,
|
|
99
|
+
`Unknown tree type ${(summaryObject as SummaryObject).type}`,
|
|
100
|
+
);
|
|
96
101
|
}
|
|
97
102
|
}
|
|
98
103
|
}
|
|
99
104
|
return treeNode;
|
|
100
105
|
}
|
|
101
106
|
|
|
102
|
-
export function convertSummaryIntoContainerSnapshot(
|
|
107
|
+
export function convertSummaryIntoContainerSnapshot(
|
|
108
|
+
createNewSummary: ISummaryTree,
|
|
109
|
+
): IOdspSummaryPayload {
|
|
103
110
|
if (!isCombinedAppAndProtocolSummary(createNewSummary)) {
|
|
104
111
|
throw new Error("App and protocol summary required for create new path!!");
|
|
105
112
|
}
|
|
@@ -146,11 +153,13 @@ function convertSummaryToSnapshotTreeForCreateNew(summary: ISummaryTree): IOdspS
|
|
|
146
153
|
// property is not present, the tree entry is considered referenced. If the property is present and is true,
|
|
147
154
|
// the tree entry is considered unreferenced.
|
|
148
155
|
let unreferenced: true | undefined;
|
|
156
|
+
let groupId: string | undefined;
|
|
149
157
|
|
|
150
158
|
switch (summaryObject.type) {
|
|
151
159
|
case SummaryType.Tree: {
|
|
152
160
|
value = convertSummaryToSnapshotTreeForCreateNew(summaryObject);
|
|
153
161
|
unreferenced = summaryObject.unreferenced;
|
|
162
|
+
groupId = summaryObject.groupId;
|
|
154
163
|
break;
|
|
155
164
|
}
|
|
156
165
|
case SummaryType.Blob: {
|
|
@@ -180,6 +189,7 @@ function convertSummaryToSnapshotTreeForCreateNew(summary: ISummaryTree): IOdspS
|
|
|
180
189
|
type: getGitType(summaryObject),
|
|
181
190
|
value,
|
|
182
191
|
unreferenced,
|
|
192
|
+
groupId,
|
|
183
193
|
};
|
|
184
194
|
snapshotTree.entries?.push(entry);
|
|
185
195
|
}
|
|
@@ -271,7 +281,7 @@ export async function createNewFluidContainerCore<T>(args: {
|
|
|
271
281
|
validateResponseCallback?.(fetchResponse.content);
|
|
272
282
|
|
|
273
283
|
event.end({
|
|
274
|
-
headers: Object.keys(headers).length
|
|
284
|
+
headers: Object.keys(headers).length > 0 ? true : undefined,
|
|
275
285
|
attempts: options.refresh ? 2 : 1,
|
|
276
286
|
...fetchResponse.propsToLog,
|
|
277
287
|
});
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
+
|
|
5
6
|
import { IRequest } from "@fluidframework/core-interfaces";
|
|
6
7
|
import { DriverHeader } from "@fluidframework/driver-definitions";
|
|
7
8
|
import { ISharingLinkKind } from "@fluidframework/odsp-driver-definitions";
|
|
8
|
-
import { buildOdspShareLinkReqParams } from "./odspUtils";
|
|
9
|
+
import { buildOdspShareLinkReqParams } from "./odspUtils.js";
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* Create the request object with url and headers for creating a new file on OneDrive Sharepoint
|
package/src/createOdspUrl.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { OdspFluidDataStoreLocator } from "./contractsPublic";
|
|
6
|
+
import { OdspFluidDataStoreLocator } from "./contractsPublic.js";
|
|
7
7
|
|
|
8
8
|
/*
|
|
9
9
|
* Per https://github.com/microsoft/FluidFramework/issues/1556, isolating createOdspUrl() in its own file.
|
package/src/epochTracker.ts
CHANGED
|
@@ -29,6 +29,8 @@ import {
|
|
|
29
29
|
IOdspError,
|
|
30
30
|
IOdspErrorAugmentations,
|
|
31
31
|
IOdspResolvedUrl,
|
|
32
|
+
maximumCacheDurationMs,
|
|
33
|
+
type HostStoragePolicy,
|
|
32
34
|
} from "@fluidframework/odsp-driver-definitions";
|
|
33
35
|
import {
|
|
34
36
|
fetchAndParseAsJSONHelper,
|
|
@@ -36,12 +38,12 @@ import {
|
|
|
36
38
|
fetchHelper,
|
|
37
39
|
getOdspResolvedUrl,
|
|
38
40
|
IOdspResponse,
|
|
39
|
-
} from "./odspUtils";
|
|
40
|
-
import { IOdspCache, INonPersistentCache, IPersistedFileCache } from "./odspCache";
|
|
41
|
-
import { IVersionedValueWithEpoch, persistedCacheValueVersion } from "./contracts";
|
|
42
|
-
import { ClpCompliantAppHeader } from "./contractsPublic";
|
|
43
|
-
import { pkgVersion as driverVersion } from "./packageVersion";
|
|
44
|
-
import { patchOdspResolvedUrl } from "./odspLocationRedirection";
|
|
41
|
+
} from "./odspUtils.js";
|
|
42
|
+
import { IOdspCache, INonPersistentCache, IPersistedFileCache } from "./odspCache.js";
|
|
43
|
+
import { IVersionedValueWithEpoch, persistedCacheValueVersion } from "./contracts.js";
|
|
44
|
+
import { ClpCompliantAppHeader } from "./contractsPublic.js";
|
|
45
|
+
import { pkgVersion as driverVersion } from "./packageVersion.js";
|
|
46
|
+
import { patchOdspResolvedUrl } from "./odspLocationRedirection.js";
|
|
45
47
|
|
|
46
48
|
/**
|
|
47
49
|
* @alpha
|
|
@@ -66,9 +68,6 @@ export type FetchTypeInternal = FetchType | "cache";
|
|
|
66
68
|
|
|
67
69
|
export const Odsp409Error = "Odsp409Error";
|
|
68
70
|
|
|
69
|
-
// Must be less than policy of 5 days
|
|
70
|
-
export const defaultCacheExpiryTimeoutMs: number = 2 * 24 * 60 * 60 * 1000; // 2 days in ms
|
|
71
|
-
|
|
72
71
|
/**
|
|
73
72
|
* In ODSP, the concept of "epoch" refers to binary updates to files. For example, this might include using
|
|
74
73
|
* version restore, or if the user downloads a Fluid file and then uploads it again. These result in the epoch
|
|
@@ -98,6 +97,7 @@ export class EpochTracker implements IPersistedFileCache {
|
|
|
98
97
|
protected readonly fileEntry: IFileEntry,
|
|
99
98
|
protected readonly logger: ITelemetryLoggerExt,
|
|
100
99
|
protected readonly clientIsSummarizer?: boolean,
|
|
100
|
+
protected readonly hostPolicy?: HostStoragePolicy,
|
|
101
101
|
) {
|
|
102
102
|
// Limits the max number of concurrent requests to 24.
|
|
103
103
|
this.rateLimiter = new RateLimiter(24);
|
|
@@ -107,11 +107,11 @@ export class EpochTracker implements IPersistedFileCache {
|
|
|
107
107
|
"Fluid.Driver.Odsp.TestOverride.DisableSnapshotCache",
|
|
108
108
|
)
|
|
109
109
|
? 0
|
|
110
|
-
:
|
|
110
|
+
: maximumCacheDurationMs;
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
// public for UT purposes only!
|
|
114
|
-
public setEpoch(epoch: string, fromCache: boolean, fetchType: FetchTypeInternal) {
|
|
114
|
+
public setEpoch(epoch: string, fromCache: boolean, fetchType: FetchTypeInternal): void {
|
|
115
115
|
assert(this._fluidEpoch === undefined, 0x1db /* "epoch exists" */);
|
|
116
116
|
this._fluidEpoch = epoch;
|
|
117
117
|
|
|
@@ -123,9 +123,12 @@ export class EpochTracker implements IPersistedFileCache {
|
|
|
123
123
|
});
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
+
// TODO: return a stronger type
|
|
127
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
126
128
|
public async get(entry: IEntry): Promise<any> {
|
|
127
129
|
try {
|
|
128
130
|
// Return undefined so that the ops/snapshots are grabbed from the server instead of the cache
|
|
131
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
129
132
|
const value: IVersionedValueWithEpoch = await this.cache.get(
|
|
130
133
|
this.fileEntryFromEntry(entry),
|
|
131
134
|
);
|
|
@@ -145,6 +148,7 @@ export class EpochTracker implements IPersistedFileCache {
|
|
|
145
148
|
// Expire the cached snapshot if it's older than snapshotCacheExpiryTimeoutMs and immediately
|
|
146
149
|
// expire all old caches that do not have cacheEntryTime
|
|
147
150
|
if (entry.type === snapshotKey) {
|
|
151
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
|
|
148
152
|
const cacheTime = value.value?.cacheEntryTime;
|
|
149
153
|
const currentTime = Date.now();
|
|
150
154
|
if (
|
|
@@ -168,14 +172,18 @@ export class EpochTracker implements IPersistedFileCache {
|
|
|
168
172
|
}
|
|
169
173
|
}
|
|
170
174
|
|
|
171
|
-
|
|
175
|
+
// TODO: take a stronger type or `unknown`
|
|
176
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
|
177
|
+
public async put(entry: IEntry, value: any): Promise<void> {
|
|
172
178
|
assert(this._fluidEpoch !== undefined, 0x1dd /* "no epoch" */);
|
|
173
179
|
// For snapshots, the value should have the cacheEntryTime.
|
|
174
180
|
// This will be used to expire snapshots older than snapshotCacheExpiryTimeoutMs.
|
|
175
181
|
if (entry.type === snapshotKey) {
|
|
182
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
|
|
176
183
|
value.cacheEntryTime = value.cacheEntryTime ?? Date.now();
|
|
177
184
|
}
|
|
178
185
|
const data: IVersionedValueWithEpoch = {
|
|
186
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
179
187
|
value,
|
|
180
188
|
version: persistedCacheValueVersion,
|
|
181
189
|
fluidEpoch: this._fluidEpoch,
|
|
@@ -194,11 +202,11 @@ export class EpochTracker implements IPersistedFileCache {
|
|
|
194
202
|
}
|
|
195
203
|
}
|
|
196
204
|
|
|
197
|
-
public get fluidEpoch() {
|
|
205
|
+
public get fluidEpoch(): string | undefined {
|
|
198
206
|
return this._fluidEpoch;
|
|
199
207
|
}
|
|
200
208
|
|
|
201
|
-
public async validateEpoch(epoch: string | undefined, fetchType: FetchType) {
|
|
209
|
+
public async validateEpoch(epoch: string | undefined, fetchType: FetchType): Promise<void> {
|
|
202
210
|
assert(epoch !== undefined, 0x584 /* response should contain epoch */);
|
|
203
211
|
try {
|
|
204
212
|
this.validateEpochFromResponse(epoch, fetchType);
|
|
@@ -247,7 +255,7 @@ export class EpochTracker implements IPersistedFileCache {
|
|
|
247
255
|
fetchType: FetchType,
|
|
248
256
|
addInBody: boolean = false,
|
|
249
257
|
fetchReason?: string,
|
|
250
|
-
) {
|
|
258
|
+
): Promise<IOdspResponse<Response>> {
|
|
251
259
|
return this.fetchCore<Response>(
|
|
252
260
|
url,
|
|
253
261
|
fetchOptions,
|
|
@@ -260,12 +268,12 @@ export class EpochTracker implements IPersistedFileCache {
|
|
|
260
268
|
|
|
261
269
|
private async fetchCore<T>(
|
|
262
270
|
url: string,
|
|
263
|
-
fetchOptions:
|
|
264
|
-
fetcher: (url: string, fetchOptions:
|
|
271
|
+
fetchOptions: RequestInit,
|
|
272
|
+
fetcher: (url: string, fetchOptions: RequestInit) => Promise<IOdspResponse<T>>,
|
|
265
273
|
fetchType: FetchType,
|
|
266
274
|
addInBody: boolean = false,
|
|
267
275
|
fetchReason?: string,
|
|
268
|
-
) {
|
|
276
|
+
): Promise<IOdspResponse<T>> {
|
|
269
277
|
const clientCorrelationId = this.formatClientCorrelationId(fetchReason);
|
|
270
278
|
// Add epoch in fetch request.
|
|
271
279
|
this.addEpochInRequest(fetchOptions, addInBody, clientCorrelationId);
|
|
@@ -288,29 +296,48 @@ export class EpochTracker implements IPersistedFileCache {
|
|
|
288
296
|
throw error;
|
|
289
297
|
})
|
|
290
298
|
.catch((error) => {
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
299
|
+
if (isFluidError(error)) {
|
|
300
|
+
// If the error is about location redirection, then we need to generate new resolved url with correct
|
|
301
|
+
// location info.
|
|
302
|
+
if (error.errorType === OdspErrorTypes.fileNotFoundOrAccessDeniedError) {
|
|
303
|
+
const redirectLocation = (error as IOdspErrorAugmentations)
|
|
304
|
+
.redirectLocation;
|
|
305
|
+
if (redirectLocation !== undefined) {
|
|
306
|
+
const redirectUrl: IOdspResolvedUrl = patchOdspResolvedUrl(
|
|
307
|
+
this.fileEntry.resolvedUrl,
|
|
308
|
+
redirectLocation,
|
|
309
|
+
);
|
|
310
|
+
const locationRedirectionError = new LocationRedirectionError(
|
|
311
|
+
error.message,
|
|
312
|
+
redirectUrl,
|
|
313
|
+
{ driverVersion, redirectLocation },
|
|
314
|
+
);
|
|
315
|
+
locationRedirectionError.addTelemetryProperties(
|
|
316
|
+
error.getTelemetryProperties(),
|
|
317
|
+
);
|
|
318
|
+
throw locationRedirectionError;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
// If the hostPolicy disallows retries for throttling errors, then we throw a NonRetryableError
|
|
322
|
+
else if (
|
|
323
|
+
error.errorType === OdspErrorTypes.throttlingError &&
|
|
324
|
+
this.hostPolicy?.disableRetriesOnStorageThrottlingError
|
|
325
|
+
) {
|
|
326
|
+
const nonRetriableThrottlingError = new NonRetryableError(
|
|
304
327
|
error.message,
|
|
305
|
-
|
|
306
|
-
{
|
|
328
|
+
OdspErrorTypes.throttlingError,
|
|
329
|
+
{
|
|
330
|
+
driverVersion,
|
|
331
|
+
},
|
|
307
332
|
);
|
|
308
|
-
|
|
333
|
+
// This step ensures all the telemetry props are preserved including the retryAfterSeconds from the original error
|
|
334
|
+
nonRetriableThrottlingError.addTelemetryProperties(
|
|
309
335
|
error.getTelemetryProperties(),
|
|
310
336
|
);
|
|
311
|
-
throw
|
|
337
|
+
throw nonRetriableThrottlingError;
|
|
312
338
|
}
|
|
313
339
|
}
|
|
340
|
+
|
|
314
341
|
throw error;
|
|
315
342
|
})
|
|
316
343
|
.catch((error) => {
|
|
@@ -331,11 +358,11 @@ export class EpochTracker implements IPersistedFileCache {
|
|
|
331
358
|
*/
|
|
332
359
|
public async fetchArray(
|
|
333
360
|
url: string,
|
|
334
|
-
fetchOptions: { [index: string]:
|
|
361
|
+
fetchOptions: { [index: string]: RequestInit },
|
|
335
362
|
fetchType: FetchType,
|
|
336
363
|
addInBody: boolean = false,
|
|
337
364
|
fetchReason?: string,
|
|
338
|
-
) {
|
|
365
|
+
): Promise<IOdspResponse<ArrayBuffer>> {
|
|
339
366
|
return this.fetchCore<ArrayBuffer>(
|
|
340
367
|
url,
|
|
341
368
|
fetchOptions,
|
|
@@ -350,7 +377,7 @@ export class EpochTracker implements IPersistedFileCache {
|
|
|
350
377
|
fetchOptions: RequestInit,
|
|
351
378
|
addInBody: boolean,
|
|
352
379
|
clientCorrelationId: string,
|
|
353
|
-
) {
|
|
380
|
+
): void {
|
|
354
381
|
const isClpCompliantApp = getOdspResolvedUrl(this.fileEntry.resolvedUrl).isClpCompliantApp;
|
|
355
382
|
if (addInBody) {
|
|
356
383
|
const headers: { [key: string]: string } = {};
|
|
@@ -363,7 +390,7 @@ export class EpochTracker implements IPersistedFileCache {
|
|
|
363
390
|
}
|
|
364
391
|
this.addParamInBody(fetchOptions, headers);
|
|
365
392
|
} else {
|
|
366
|
-
const addHeader = (key: string, val: string) => {
|
|
393
|
+
const addHeader = (key: string, val: string): void => {
|
|
367
394
|
fetchOptions.headers = {
|
|
368
395
|
...fetchOptions.headers,
|
|
369
396
|
};
|
|
@@ -383,7 +410,7 @@ export class EpochTracker implements IPersistedFileCache {
|
|
|
383
410
|
}
|
|
384
411
|
}
|
|
385
412
|
|
|
386
|
-
private addParamInBody(fetchOptions: RequestInit, headers: { [key: string]: string }) {
|
|
413
|
+
private addParamInBody(fetchOptions: RequestInit, headers: { [key: string]: string }): void {
|
|
387
414
|
// We use multi part form request for post body where we want to use this.
|
|
388
415
|
// So extract the form boundary to mark the end of form.
|
|
389
416
|
const body = fetchOptions.body;
|
|
@@ -392,16 +419,16 @@ export class EpochTracker implements IPersistedFileCache {
|
|
|
392
419
|
const firstLine = splitBody.shift();
|
|
393
420
|
assert(firstLine?.startsWith("--") === true, 0x21e /* "improper boundary format" */);
|
|
394
421
|
const formParams = [firstLine];
|
|
395
|
-
|
|
422
|
+
for (const [key, value] of Object.entries(headers)) {
|
|
396
423
|
formParams.push(`${key}: ${value}`);
|
|
397
|
-
}
|
|
398
|
-
|
|
424
|
+
}
|
|
425
|
+
for (const value of splitBody) {
|
|
399
426
|
formParams.push(value);
|
|
400
|
-
}
|
|
427
|
+
}
|
|
401
428
|
fetchOptions.body = formParams.join("\r\n");
|
|
402
429
|
}
|
|
403
430
|
|
|
404
|
-
private formatClientCorrelationId(fetchReason?: string) {
|
|
431
|
+
private formatClientCorrelationId(fetchReason?: string): string {
|
|
405
432
|
const items: string[] = [
|
|
406
433
|
`driverId=${this.driverId}`,
|
|
407
434
|
`RequestNumber=${this.networkCallNumber++}`,
|
|
@@ -418,15 +445,13 @@ export class EpochTracker implements IPersistedFileCache {
|
|
|
418
445
|
epochFromResponse: string | undefined,
|
|
419
446
|
fetchType: FetchTypeInternal,
|
|
420
447
|
fromCache: boolean = false,
|
|
421
|
-
) {
|
|
448
|
+
): void {
|
|
422
449
|
const error = this.checkForEpochErrorCore(epochFromResponse);
|
|
423
450
|
if (error !== undefined) {
|
|
424
451
|
throw error;
|
|
425
452
|
}
|
|
426
|
-
if (epochFromResponse !== undefined) {
|
|
427
|
-
|
|
428
|
-
this.setEpoch(epochFromResponse, fromCache, fetchType);
|
|
429
|
-
}
|
|
453
|
+
if (epochFromResponse !== undefined && this._fluidEpoch === undefined) {
|
|
454
|
+
this.setEpoch(epochFromResponse, fromCache, fetchType);
|
|
430
455
|
}
|
|
431
456
|
}
|
|
432
457
|
|
|
@@ -435,7 +460,7 @@ export class EpochTracker implements IPersistedFileCache {
|
|
|
435
460
|
epochFromResponse: string | null | undefined,
|
|
436
461
|
fetchType: FetchTypeInternal,
|
|
437
462
|
fromCache: boolean = false,
|
|
438
|
-
) {
|
|
463
|
+
): Promise<void> {
|
|
439
464
|
if (isFluidError(error) && error.errorType === OdspErrorTypes.fileOverwrittenInStorage) {
|
|
440
465
|
const epochError = this.checkForEpochErrorCore(epochFromResponse);
|
|
441
466
|
if (epochError !== undefined) {
|
|
@@ -461,7 +486,9 @@ export class EpochTracker implements IPersistedFileCache {
|
|
|
461
486
|
}
|
|
462
487
|
}
|
|
463
488
|
|
|
464
|
-
private checkForEpochErrorCore(
|
|
489
|
+
private checkForEpochErrorCore(
|
|
490
|
+
epochFromResponse: string | null | undefined,
|
|
491
|
+
): NonRetryableError<"fileOverwrittenInStorage"> | undefined {
|
|
465
492
|
// If epoch is undefined, then don't compare it because initially for createNew or TreesLatest
|
|
466
493
|
// initializes this value. Sometimes response does not contain epoch as it is still in
|
|
467
494
|
// implementation phase at server side. In that case also, don't compare it with our epoch value.
|
|
@@ -489,8 +516,9 @@ export class EpochTrackerWithRedemption extends EpochTracker {
|
|
|
489
516
|
protected readonly fileEntry: IFileEntry,
|
|
490
517
|
protected readonly logger: ITelemetryLoggerExt,
|
|
491
518
|
protected readonly clientIsSummarizer?: boolean,
|
|
519
|
+
protected readonly hostPolicy?: HostStoragePolicy,
|
|
492
520
|
) {
|
|
493
|
-
super(cache, fileEntry, logger, clientIsSummarizer);
|
|
521
|
+
super(cache, fileEntry, logger, clientIsSummarizer, hostPolicy);
|
|
494
522
|
// Handles the rejected promise within treesLatestDeferral.
|
|
495
523
|
this.treesLatestDeferral.promise.catch(() => {});
|
|
496
524
|
}
|
|
@@ -499,7 +527,7 @@ export class EpochTrackerWithRedemption extends EpochTracker {
|
|
|
499
527
|
epochFromResponse: string | undefined,
|
|
500
528
|
fetchType: FetchType,
|
|
501
529
|
fromCache: boolean = false,
|
|
502
|
-
) {
|
|
530
|
+
): void {
|
|
503
531
|
super.validateEpochFromResponse(epochFromResponse, fetchType, fromCache);
|
|
504
532
|
|
|
505
533
|
// Any successful call means we have access to a file, i.e. any redemption that was required already happened.
|
|
@@ -508,6 +536,8 @@ export class EpochTrackerWithRedemption extends EpochTracker {
|
|
|
508
536
|
this.treesLatestDeferral.resolve();
|
|
509
537
|
}
|
|
510
538
|
|
|
539
|
+
// TODO: return a stronger type
|
|
540
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
511
541
|
public async get(entry: IEntry): Promise<any> {
|
|
512
542
|
let result = super.get(entry);
|
|
513
543
|
|
|
@@ -533,7 +563,7 @@ export class EpochTrackerWithRedemption extends EpochTracker {
|
|
|
533
563
|
|
|
534
564
|
public async fetchAndParseAsJSON<T>(
|
|
535
565
|
url: string,
|
|
536
|
-
fetchOptions: { [index: string]:
|
|
566
|
+
fetchOptions: { [index: string]: RequestInit },
|
|
537
567
|
fetchType: FetchType,
|
|
538
568
|
addInBody: boolean = false,
|
|
539
569
|
fetchReason?: string,
|
|
@@ -550,6 +580,7 @@ export class EpochTrackerWithRedemption extends EpochTracker {
|
|
|
550
580
|
addInBody,
|
|
551
581
|
fetchReason,
|
|
552
582
|
);
|
|
583
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
553
584
|
} catch (error: any) {
|
|
554
585
|
// Only handling here treesLatest. If createFile failed, we should never try to do joinSession.
|
|
555
586
|
// Similar, if getVersions failed, we should not do any further storage calls.
|
|
@@ -559,7 +590,9 @@ export class EpochTrackerWithRedemption extends EpochTracker {
|
|
|
559
590
|
}
|
|
560
591
|
if (
|
|
561
592
|
fetchType !== "joinSession" ||
|
|
593
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
562
594
|
error.statusCode < 401 ||
|
|
595
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
563
596
|
error.statusCode > 404 ||
|
|
564
597
|
completed
|
|
565
598
|
) {
|
|
@@ -616,12 +649,14 @@ export function createOdspCacheAndTracker(
|
|
|
616
649
|
fileEntry: IFileEntry,
|
|
617
650
|
logger: ITelemetryLoggerExt,
|
|
618
651
|
clientIsSummarizer?: boolean,
|
|
652
|
+
hostPolicy?: HostStoragePolicy,
|
|
619
653
|
): ICacheAndTracker {
|
|
620
654
|
const epochTracker = new EpochTrackerWithRedemption(
|
|
621
655
|
persistedCacheArg,
|
|
622
656
|
fileEntry,
|
|
623
657
|
logger,
|
|
624
658
|
clientIsSummarizer,
|
|
659
|
+
hostPolicy,
|
|
625
660
|
);
|
|
626
661
|
return {
|
|
627
662
|
cache: {
|