@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
|
@@ -16,21 +16,22 @@ import {
|
|
|
16
16
|
IOdspUrlParts,
|
|
17
17
|
getKeyForCacheEntry,
|
|
18
18
|
} from "@fluidframework/odsp-driver-definitions";
|
|
19
|
-
import {
|
|
19
|
+
import { createChildMonitoringContext, PerformanceEvent } from "@fluidframework/telemetry-utils";
|
|
20
20
|
import {
|
|
21
21
|
createCacheSnapshotKey,
|
|
22
22
|
createOdspLogger,
|
|
23
23
|
getOdspResolvedUrl,
|
|
24
24
|
toInstrumentedOdspTokenFetcher,
|
|
25
|
-
} from "./odspUtils";
|
|
25
|
+
} from "./odspUtils.js";
|
|
26
26
|
import {
|
|
27
27
|
downloadSnapshot,
|
|
28
28
|
fetchSnapshotWithRedeem,
|
|
29
|
+
ISnapshotRequestAndResponseOptions,
|
|
29
30
|
SnapshotFormatSupportType,
|
|
30
|
-
} from "./fetchSnapshot";
|
|
31
|
-
import { IVersionedValueWithEpoch } from "./contracts";
|
|
32
|
-
import { IPrefetchSnapshotContents } from "./odspCache";
|
|
33
|
-
import { OdspDocumentServiceFactory } from "./odspDocumentServiceFactory";
|
|
31
|
+
} from "./fetchSnapshot.js";
|
|
32
|
+
import { IVersionedValueWithEpoch } from "./contracts.js";
|
|
33
|
+
import { IPrefetchSnapshotContents } from "./odspCache.js";
|
|
34
|
+
import { OdspDocumentServiceFactory } from "./odspDocumentServiceFactory.js";
|
|
34
35
|
|
|
35
36
|
/**
|
|
36
37
|
* Function to prefetch the snapshot and cached it in the persistant cache, so that when the container is loaded
|
|
@@ -66,9 +67,14 @@ export async function prefetchLatestSnapshot(
|
|
|
66
67
|
snapshotFormatFetchType?: SnapshotFormatSupportType,
|
|
67
68
|
odspDocumentServiceFactory?: OdspDocumentServiceFactory,
|
|
68
69
|
): Promise<boolean> {
|
|
69
|
-
const
|
|
70
|
-
|
|
70
|
+
const mc = createChildMonitoringContext({ logger, namespace: "PrefetchSnapshot" });
|
|
71
|
+
const odspLogger = createOdspLogger(mc.logger);
|
|
72
|
+
const useGroupIdsForSnapshotFetch = mc.config.getBoolean(
|
|
73
|
+
"Fluid.Container.UseLoadingGroupIdForSnapshotFetch",
|
|
71
74
|
);
|
|
75
|
+
// For prefetch, we just want to fetch the ungrouped data and want to use the new API if the
|
|
76
|
+
// feature gate is set, so provide an empty array.
|
|
77
|
+
const loadingGroupIds = useGroupIdsForSnapshotFetch ? [] : undefined;
|
|
72
78
|
const odspResolvedUrl = getOdspResolvedUrl(resolvedUrl);
|
|
73
79
|
|
|
74
80
|
const resolvedUrlData: IOdspUrlParts = {
|
|
@@ -86,13 +92,14 @@ export async function prefetchLatestSnapshot(
|
|
|
86
92
|
const snapshotDownloader = async (
|
|
87
93
|
finalOdspResolvedUrl: IOdspResolvedUrl,
|
|
88
94
|
storageToken: string,
|
|
95
|
+
loadingGroupId: string[] | undefined,
|
|
89
96
|
snapshotOptions: ISnapshotOptions | undefined,
|
|
90
97
|
controller?: AbortController,
|
|
91
|
-
) => {
|
|
98
|
+
): Promise<ISnapshotRequestAndResponseOptions> => {
|
|
92
99
|
return downloadSnapshot(
|
|
93
100
|
finalOdspResolvedUrl,
|
|
94
101
|
storageToken,
|
|
95
|
-
|
|
102
|
+
loadingGroupId,
|
|
96
103
|
snapshotOptions,
|
|
97
104
|
undefined,
|
|
98
105
|
controller,
|
|
@@ -101,12 +108,13 @@ export async function prefetchLatestSnapshot(
|
|
|
101
108
|
const snapshotKey = createCacheSnapshotKey(odspResolvedUrl);
|
|
102
109
|
let cacheP: Promise<void> | undefined;
|
|
103
110
|
let snapshotEpoch: string | undefined;
|
|
104
|
-
const putInCache = async (valueWithEpoch: IVersionedValueWithEpoch) => {
|
|
111
|
+
const putInCache = async (valueWithEpoch: IVersionedValueWithEpoch): Promise<void> => {
|
|
105
112
|
snapshotEpoch = valueWithEpoch.fluidEpoch;
|
|
106
113
|
cacheP = persistedCache.put(snapshotKey, valueWithEpoch);
|
|
107
114
|
return cacheP;
|
|
108
115
|
};
|
|
109
|
-
|
|
116
|
+
|
|
117
|
+
const removeEntries = async (): Promise<void> => persistedCache.removeEntries(snapshotKey.file);
|
|
110
118
|
return PerformanceEvent.timedExecAsync(
|
|
111
119
|
odspLogger,
|
|
112
120
|
{ eventName: "PrefetchLatestSnapshot" },
|
|
@@ -130,6 +138,7 @@ export async function prefetchLatestSnapshot(
|
|
|
130
138
|
snapshotDownloader,
|
|
131
139
|
putInCache,
|
|
132
140
|
removeEntries,
|
|
141
|
+
loadingGroupIds,
|
|
133
142
|
enableRedeemFallback,
|
|
134
143
|
)
|
|
135
144
|
.then(async (value) => {
|
|
@@ -157,11 +166,11 @@ export async function prefetchLatestSnapshot(
|
|
|
157
166
|
snapshotNonPersistentCache?.remove(nonPersistentCacheKey);
|
|
158
167
|
}, 5000);
|
|
159
168
|
})
|
|
160
|
-
.catch((
|
|
169
|
+
.catch((error) => {
|
|
161
170
|
// Remove it from the non persistent cache if an error occured.
|
|
162
171
|
snapshotNonPersistentCache?.remove(nonPersistentCacheKey);
|
|
163
|
-
snapshotContentsWithEpochP.reject(
|
|
164
|
-
throw
|
|
172
|
+
snapshotContentsWithEpochP.reject(error);
|
|
173
|
+
throw error;
|
|
165
174
|
});
|
|
166
175
|
return true;
|
|
167
176
|
},
|
|
@@ -3,11 +3,13 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { LoggingError, ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
|
|
6
|
+
import { LoggingError, ITelemetryLoggerExt, UsageError } from "@fluidframework/telemetry-utils";
|
|
7
7
|
import {
|
|
8
8
|
FetchSource,
|
|
9
9
|
IDocumentStorageService,
|
|
10
10
|
IDocumentStorageServicePolicies,
|
|
11
|
+
ISnapshot,
|
|
12
|
+
ISnapshotFetchOptions,
|
|
11
13
|
ISummaryContext,
|
|
12
14
|
} from "@fluidframework/driver-definitions";
|
|
13
15
|
import {
|
|
@@ -18,7 +20,7 @@ import {
|
|
|
18
20
|
IVersion,
|
|
19
21
|
} from "@fluidframework/protocol-definitions";
|
|
20
22
|
import { IDisposable } from "@fluidframework/core-interfaces";
|
|
21
|
-
import { runWithRetry } from "./retryUtils";
|
|
23
|
+
import { runWithRetry } from "./retryUtils.js";
|
|
22
24
|
|
|
23
25
|
export class RetryErrorsStorageAdapter implements IDocumentStorageService, IDisposable {
|
|
24
26
|
private _disposed = false;
|
|
@@ -30,17 +32,13 @@ export class RetryErrorsStorageAdapter implements IDocumentStorageService, IDisp
|
|
|
30
32
|
public get policies(): IDocumentStorageServicePolicies | undefined {
|
|
31
33
|
return this.internalStorageService.policies;
|
|
32
34
|
}
|
|
33
|
-
public get disposed() {
|
|
35
|
+
public get disposed(): boolean {
|
|
34
36
|
return this._disposed;
|
|
35
37
|
}
|
|
36
|
-
public dispose() {
|
|
38
|
+
public dispose(): void {
|
|
37
39
|
this._disposed = true;
|
|
38
40
|
}
|
|
39
41
|
|
|
40
|
-
public get repositoryUrl(): string {
|
|
41
|
-
return this.internalStorageService.repositoryUrl;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
42
|
// eslint-disable-next-line @rushstack/no-new-null
|
|
45
43
|
public async getSnapshotTree(version?: IVersion): Promise<ISnapshotTree | null> {
|
|
46
44
|
return this.runWithRetry(
|
|
@@ -49,6 +47,15 @@ export class RetryErrorsStorageAdapter implements IDocumentStorageService, IDisp
|
|
|
49
47
|
);
|
|
50
48
|
}
|
|
51
49
|
|
|
50
|
+
public async getSnapshot(snapshotFetchOptions?: ISnapshotFetchOptions): Promise<ISnapshot> {
|
|
51
|
+
return this.runWithRetry(async () => {
|
|
52
|
+
if (this.internalStorageService.getSnapshot !== undefined) {
|
|
53
|
+
return this.internalStorageService.getSnapshot(snapshotFetchOptions);
|
|
54
|
+
}
|
|
55
|
+
throw new UsageError("getSnapshot should exist in storage adapter in ODSP driver");
|
|
56
|
+
}, "storage_getSnapshot");
|
|
57
|
+
}
|
|
58
|
+
|
|
52
59
|
public async readBlob(id: string): Promise<ArrayBufferLike> {
|
|
53
60
|
return this.runWithRetry(
|
|
54
61
|
async () => this.internalStorageService.readBlob(id),
|
|
@@ -100,7 +107,7 @@ export class RetryErrorsStorageAdapter implements IDocumentStorageService, IDisp
|
|
|
100
107
|
);
|
|
101
108
|
}
|
|
102
109
|
|
|
103
|
-
private checkStorageDisposed() {
|
|
110
|
+
private checkStorageDisposed(): void {
|
|
104
111
|
if (this._disposed) {
|
|
105
112
|
// pre-0.58 error message: storageServiceDisposedCannotRetry
|
|
106
113
|
throw new LoggingError("Storage Service is disposed. Cannot retry", {
|
package/src/retryUtils.ts
CHANGED
|
@@ -7,8 +7,8 @@ import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
|
|
|
7
7
|
import { performance } from "@fluid-internal/client-utils";
|
|
8
8
|
import { delay } from "@fluidframework/core-utils";
|
|
9
9
|
import { canRetryOnError, getRetryDelayFromError } from "@fluidframework/driver-utils";
|
|
10
|
-
import {
|
|
11
|
-
import { Odsp409Error } from "./epochTracker";
|
|
10
|
+
import { OdspErrorTypes } from "@fluidframework/odsp-driver-definitions";
|
|
11
|
+
import { Odsp409Error } from "./epochTracker.js";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* This method retries only for retriable coherency and service read only errors.
|
|
@@ -21,7 +21,7 @@ export async function runWithRetry<T>(
|
|
|
21
21
|
): Promise<T> {
|
|
22
22
|
let retryAfter = 1000;
|
|
23
23
|
const start = performance.now();
|
|
24
|
-
let lastError:
|
|
24
|
+
let lastError: unknown;
|
|
25
25
|
for (let attempts = 1; ; attempts++) {
|
|
26
26
|
if (checkDisposed !== undefined) {
|
|
27
27
|
checkDisposed();
|
|
@@ -40,11 +40,14 @@ export async function runWithRetry<T>(
|
|
|
40
40
|
);
|
|
41
41
|
}
|
|
42
42
|
return result;
|
|
43
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
43
44
|
} catch (error: any) {
|
|
44
45
|
const canRetry = canRetryOnError(error);
|
|
45
46
|
|
|
47
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
46
48
|
const coherencyError = error?.[Odsp409Error] === true;
|
|
47
|
-
|
|
49
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
50
|
+
const serviceReadonlyError = error?.errorType === OdspErrorTypes.serviceReadOnly;
|
|
48
51
|
|
|
49
52
|
// logging the first failed retry instead of every attempt. We want to avoid filling telemetry
|
|
50
53
|
// when we have tight loop of retrying in offline mode, but we also want to know what caused
|
|
@@ -84,6 +87,7 @@ export async function runWithRetry<T>(
|
|
|
84
87
|
error,
|
|
85
88
|
);
|
|
86
89
|
// Fail hard.
|
|
90
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
87
91
|
error.canRetry = false;
|
|
88
92
|
throw error;
|
|
89
93
|
}
|
package/src/socketModule.ts
CHANGED
package/src/vroom.ts
CHANGED
|
@@ -4,17 +4,17 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { v4 as uuid } from "uuid";
|
|
7
|
-
import {
|
|
7
|
+
import { ITelemetryBaseProperties } from "@fluidframework/core-interfaces";
|
|
8
8
|
import { ITelemetryLoggerExt, PerformanceEvent } from "@fluidframework/telemetry-utils";
|
|
9
9
|
import {
|
|
10
10
|
InstrumentedStorageTokenFetcher,
|
|
11
11
|
ISocketStorageDiscovery,
|
|
12
12
|
IOdspUrlParts,
|
|
13
13
|
} from "@fluidframework/odsp-driver-definitions";
|
|
14
|
-
import { getOrigin, TokenFetchOptionsEx } from "./odspUtils";
|
|
15
|
-
import { getApiRoot } from "./odspUrlHelper";
|
|
16
|
-
import { EpochTracker } from "./epochTracker";
|
|
17
|
-
import { runWithRetry } from "./retryUtils";
|
|
14
|
+
import { getOrigin, TokenFetchOptionsEx } from "./odspUtils.js";
|
|
15
|
+
import { getApiRoot } from "./odspUrlHelper.js";
|
|
16
|
+
import { EpochTracker } from "./epochTracker.js";
|
|
17
|
+
import { runWithRetry } from "./retryUtils.js";
|
|
18
18
|
|
|
19
19
|
interface IJoinSessionBody {
|
|
20
20
|
requestSocketToken: boolean;
|
|
@@ -55,7 +55,7 @@ export async function fetchJoinSession(
|
|
|
55
55
|
const tokenRefreshProps = options.refresh
|
|
56
56
|
? { hasClaims: !!options.claims, hasTenantId: !!options.tenantId }
|
|
57
57
|
: {};
|
|
58
|
-
const details:
|
|
58
|
+
const details: ITelemetryBaseProperties = {
|
|
59
59
|
refreshedToken: options.refresh,
|
|
60
60
|
requestSocketToken,
|
|
61
61
|
...tokenRefreshProps,
|
|
@@ -12,10 +12,10 @@ import { Uint8ArrayToArrayBuffer, Uint8ArrayToString } from "@fluid-internal/cli
|
|
|
12
12
|
import { assert } from "@fluidframework/core-utils";
|
|
13
13
|
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
|
|
14
14
|
import { NonRetryableError } from "@fluidframework/driver-utils";
|
|
15
|
-
import {
|
|
16
|
-
import { ReadBuffer } from "./ReadBufferUtils";
|
|
17
|
-
import { pkgVersion as driverVersion } from "./packageVersion";
|
|
18
|
-
import { measure } from "./odspUtils";
|
|
15
|
+
import { OdspErrorTypes } from "@fluidframework/odsp-driver-definitions";
|
|
16
|
+
import { ReadBuffer } from "./ReadBufferUtils.js";
|
|
17
|
+
import { pkgVersion as driverVersion } from "./packageVersion.js";
|
|
18
|
+
import { measure } from "./odspUtils.js";
|
|
19
19
|
|
|
20
20
|
// https://onedrive.visualstudio.com/SharePoint%20Online/_git/SPO?path=/cobalt/Base/Property/BinaryEncodedPropertyReader.cs&version=GBmaster&_a=contents
|
|
21
21
|
/**
|
|
@@ -107,13 +107,13 @@ export const codeToBytesMap = {
|
|
|
107
107
|
36: 8,
|
|
108
108
|
};
|
|
109
109
|
|
|
110
|
-
export function getValueSafely(map: { [index: number]: number }, key: number) {
|
|
110
|
+
export function getValueSafely(map: { [index: number]: number }, key: number): number {
|
|
111
111
|
const val = map[key];
|
|
112
112
|
assert(val !== undefined, 0x287 /* key must exist in the map */);
|
|
113
113
|
return val;
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
export function getNodeProps(node: NodeCore) {
|
|
116
|
+
export function getNodeProps(node: NodeCore): Record<string, NodeTypes> {
|
|
117
117
|
const res: Record<string, NodeTypes> = {};
|
|
118
118
|
for (const [keyNode, valueNode] of node.iteratePairs()) {
|
|
119
119
|
const id = getStringInstance(keyNode, "keynode should be a string");
|
|
@@ -122,7 +122,7 @@ export function getNodeProps(node: NodeCore) {
|
|
|
122
122
|
return res;
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
export function iteratePairs<T>(it: IterableIterator<T>) {
|
|
125
|
+
export function iteratePairs<T>(it: IterableIterator<T>): IterableIterator<[T, T]> {
|
|
126
126
|
const res: IterableIterator<[T, T]> = {
|
|
127
127
|
next: () => {
|
|
128
128
|
const a = it.next();
|
|
@@ -144,7 +144,9 @@ export function iteratePairs<T>(it: IterableIterator<T>) {
|
|
|
144
144
|
* Helper function that returns iterator from an object
|
|
145
145
|
* @param obj - object that supports iteration
|
|
146
146
|
*/
|
|
147
|
-
export function iterate<T>(obj: {
|
|
147
|
+
export function iterate<T>(obj: {
|
|
148
|
+
[Symbol.iterator]: () => IterableIterator<T>;
|
|
149
|
+
}): IterableIterator<T> {
|
|
148
150
|
return obj[Symbol.iterator]();
|
|
149
151
|
}
|
|
150
152
|
|
|
@@ -177,7 +179,7 @@ class BlobDeepCopy extends BlobCore {
|
|
|
177
179
|
super();
|
|
178
180
|
}
|
|
179
181
|
|
|
180
|
-
public get buffer() {
|
|
182
|
+
public get buffer(): Uint8Array {
|
|
181
183
|
return this.data;
|
|
182
184
|
}
|
|
183
185
|
|
|
@@ -214,7 +216,7 @@ export class BlobShallowCopy extends BlobCore {
|
|
|
214
216
|
super();
|
|
215
217
|
}
|
|
216
218
|
|
|
217
|
-
public get buffer() {
|
|
219
|
+
public get buffer(): Uint8Array {
|
|
218
220
|
return this.data.subarray(this.start, this.end);
|
|
219
221
|
}
|
|
220
222
|
|
|
@@ -232,19 +234,19 @@ export class BlobShallowCopy extends BlobCore {
|
|
|
232
234
|
}
|
|
233
235
|
}
|
|
234
236
|
|
|
235
|
-
export const addStringProperty = (node: NodeCore, a: string, b: string) => {
|
|
237
|
+
export const addStringProperty = (node: NodeCore, a: string, b: string): void => {
|
|
236
238
|
node.addDictionaryString(a);
|
|
237
239
|
node.addString(b);
|
|
238
240
|
};
|
|
239
|
-
export const addDictionaryStringProperty = (node: NodeCore, a: string, b: string) => {
|
|
241
|
+
export const addDictionaryStringProperty = (node: NodeCore, a: string, b: string): void => {
|
|
240
242
|
node.addDictionaryString(a);
|
|
241
243
|
node.addString(b);
|
|
242
244
|
};
|
|
243
|
-
export const addNumberProperty = (node: NodeCore, a: string, b: number) => {
|
|
245
|
+
export const addNumberProperty = (node: NodeCore, a: string, b: number): void => {
|
|
244
246
|
node.addDictionaryString(a);
|
|
245
247
|
node.addNumber(b);
|
|
246
248
|
};
|
|
247
|
-
export const addBoolProperty = (node: NodeCore, a: string, b: boolean) => {
|
|
249
|
+
export const addBoolProperty = (node: NodeCore, a: string, b: boolean): void => {
|
|
248
250
|
node.addDictionaryString(a);
|
|
249
251
|
node.addBool(b);
|
|
250
252
|
};
|
|
@@ -278,26 +280,26 @@ export type NodeCoreTypes = "list" | "set";
|
|
|
278
280
|
export class NodeCore {
|
|
279
281
|
// It is an array of nodes.
|
|
280
282
|
private readonly children: NodeTypes[] = [];
|
|
281
|
-
public get nodes() {
|
|
283
|
+
public get nodes(): NodeTypes[] {
|
|
282
284
|
return this.children;
|
|
283
285
|
}
|
|
284
286
|
|
|
285
287
|
constructor(public type: NodeCoreTypes = "set") {}
|
|
286
288
|
|
|
287
|
-
public [Symbol.iterator]() {
|
|
289
|
+
public [Symbol.iterator](): IterableIterator<NodeTypes> {
|
|
288
290
|
return this.children[Symbol.iterator]();
|
|
289
291
|
}
|
|
290
292
|
|
|
291
|
-
public iteratePairs() {
|
|
293
|
+
public iteratePairs(): IterableIterator<[NodeTypes, NodeTypes]> {
|
|
292
294
|
assert(this.length % 2 === 0, 0x22c /* "reading pairs" */);
|
|
293
295
|
return iteratePairs(iterate(this));
|
|
294
296
|
}
|
|
295
297
|
|
|
296
|
-
public get length() {
|
|
298
|
+
public get length(): number {
|
|
297
299
|
return this.children.length;
|
|
298
300
|
}
|
|
299
301
|
|
|
300
|
-
public get(index: number) {
|
|
302
|
+
public get(index: number): NodeTypes {
|
|
301
303
|
return this.children[index];
|
|
302
304
|
}
|
|
303
305
|
|
|
@@ -306,7 +308,7 @@ export class NodeCore {
|
|
|
306
308
|
return getStringInstance(node, "getString should return string");
|
|
307
309
|
}
|
|
308
310
|
|
|
309
|
-
public getMaybeString(index: number) {
|
|
311
|
+
public getMaybeString(index: number): string | undefined {
|
|
310
312
|
const node = this.children[index];
|
|
311
313
|
return getMaybeStringInstance(node);
|
|
312
314
|
}
|
|
@@ -341,11 +343,11 @@ export class NodeCore {
|
|
|
341
343
|
return node;
|
|
342
344
|
}
|
|
343
345
|
|
|
344
|
-
public addBlob(blob: Uint8Array) {
|
|
346
|
+
public addBlob(blob: Uint8Array): void {
|
|
345
347
|
this.children.push(new BlobDeepCopy(blob));
|
|
346
348
|
}
|
|
347
349
|
|
|
348
|
-
public addDictionaryString(payload: string) {
|
|
350
|
+
public addDictionaryString(payload: string): void {
|
|
349
351
|
this.children.push({
|
|
350
352
|
content: payload,
|
|
351
353
|
dictionary: true,
|
|
@@ -353,7 +355,7 @@ export class NodeCore {
|
|
|
353
355
|
});
|
|
354
356
|
}
|
|
355
357
|
|
|
356
|
-
public addString(payload: string) {
|
|
358
|
+
public addString(payload: string): void {
|
|
357
359
|
this.children.push({
|
|
358
360
|
content: payload,
|
|
359
361
|
dictionary: false,
|
|
@@ -361,18 +363,22 @@ export class NodeCore {
|
|
|
361
363
|
});
|
|
362
364
|
}
|
|
363
365
|
|
|
364
|
-
public addNumber(payload: number | undefined) {
|
|
366
|
+
public addNumber(payload: number | undefined): void {
|
|
365
367
|
assert(Number.isInteger(payload), 0x231 /* "Number should be an integer" */);
|
|
366
368
|
assert(payload !== undefined && payload >= 0, 0x232 /* "Payload should not be negative" */);
|
|
367
369
|
this.children.push(payload);
|
|
368
370
|
}
|
|
369
371
|
|
|
370
|
-
public addBool(payload: boolean) {
|
|
372
|
+
public addBool(payload: boolean): void {
|
|
371
373
|
this.children.push(payload);
|
|
372
374
|
}
|
|
373
375
|
|
|
374
376
|
// Can we do more efficiently here, without extra objects somehow??
|
|
375
|
-
private static readString(
|
|
377
|
+
private static readString(
|
|
378
|
+
buffer: ReadBuffer,
|
|
379
|
+
code: number,
|
|
380
|
+
dictionary: boolean,
|
|
381
|
+
): IStringElementInternal & IStringElement {
|
|
376
382
|
const lengthLen = getValueSafely(codeToBytesMap, code);
|
|
377
383
|
const length = buffer.read(lengthLen);
|
|
378
384
|
const startPos = buffer.pos;
|
|
@@ -396,7 +402,13 @@ export class NodeCore {
|
|
|
396
402
|
* Load and parse the buffer into a tree.
|
|
397
403
|
* @param buffer - buffer to read from.
|
|
398
404
|
*/
|
|
399
|
-
protected load(
|
|
405
|
+
protected load(
|
|
406
|
+
buffer: ReadBuffer,
|
|
407
|
+
logger: ITelemetryLoggerExt,
|
|
408
|
+
): {
|
|
409
|
+
durationStructure: number;
|
|
410
|
+
durationStrings: number;
|
|
411
|
+
} {
|
|
400
412
|
const [stringsToResolve, durationStructure] = measure(() =>
|
|
401
413
|
this.loadStructure(buffer, logger),
|
|
402
414
|
);
|
|
@@ -410,7 +422,10 @@ export class NodeCore {
|
|
|
410
422
|
* Load and parse the buffer into a tree.
|
|
411
423
|
* @param buffer - buffer to read from.
|
|
412
424
|
*/
|
|
413
|
-
protected loadStructure(
|
|
425
|
+
protected loadStructure(
|
|
426
|
+
buffer: ReadBuffer,
|
|
427
|
+
logger: ITelemetryLoggerExt,
|
|
428
|
+
): IStringElementInternal[] {
|
|
414
429
|
const stack: NodeTypes[][] = [];
|
|
415
430
|
const stringsToResolve: IStringElementInternal[] = [];
|
|
416
431
|
const dictionary: IStringElement[] = [];
|
|
@@ -479,14 +494,16 @@ export class NodeCore {
|
|
|
479
494
|
children.push(buffer.read(getValueSafely(codeToBytesMap, code)));
|
|
480
495
|
continue;
|
|
481
496
|
}
|
|
482
|
-
case MarkerCodes.BoolTrue:
|
|
497
|
+
case MarkerCodes.BoolTrue: {
|
|
483
498
|
children.push(true);
|
|
484
499
|
continue;
|
|
485
|
-
|
|
500
|
+
}
|
|
501
|
+
case MarkerCodes.BoolFalse: {
|
|
486
502
|
children.push(false);
|
|
487
503
|
continue;
|
|
504
|
+
}
|
|
488
505
|
case MarkerCodesEnd.list:
|
|
489
|
-
case MarkerCodesEnd.set:
|
|
506
|
+
case MarkerCodesEnd.set: {
|
|
490
507
|
// Note: We are not checking that end marker matches start marker.
|
|
491
508
|
// I.e. that we do not have a case where we start a 'list' but end with a 'set'
|
|
492
509
|
// Checking it would require more state tracking that seems not very useful, given
|
|
@@ -497,8 +514,10 @@ export class NodeCore {
|
|
|
497
514
|
// We will rely on children.push() crashing in case of mismatch, and check below
|
|
498
515
|
// (outside of the loop)
|
|
499
516
|
continue;
|
|
500
|
-
|
|
517
|
+
}
|
|
518
|
+
default: {
|
|
501
519
|
throw new Error(`Invalid code: ${code}`);
|
|
520
|
+
}
|
|
502
521
|
}
|
|
503
522
|
}
|
|
504
523
|
|
|
@@ -512,7 +531,7 @@ export class NodeCore {
|
|
|
512
531
|
buffer: ReadBuffer,
|
|
513
532
|
stringsToResolve: IStringElementInternal[],
|
|
514
533
|
logger: ITelemetryLoggerExt,
|
|
515
|
-
) {
|
|
534
|
+
): void {
|
|
516
535
|
/**
|
|
517
536
|
* Process all the strings at once!
|
|
518
537
|
*/
|
|
@@ -536,7 +555,7 @@ export class NodeCore {
|
|
|
536
555
|
}
|
|
537
556
|
assert(length === stringBuffer.length, 0x418 /* properly encoded */);
|
|
538
557
|
|
|
539
|
-
const result = Uint8ArrayToString(stringBuffer, "
|
|
558
|
+
const result = Uint8ArrayToString(stringBuffer, "utf8").split(String.fromCodePoint(0));
|
|
540
559
|
if (result.length === stringsToResolve.length + 1) {
|
|
541
560
|
// All is good, we expect all the cases to get here
|
|
542
561
|
for (let i = 0; i < stringsToResolve.length; i++) {
|
|
@@ -549,7 +568,7 @@ export class NodeCore {
|
|
|
549
568
|
for (const el of stringsToResolve) {
|
|
550
569
|
assert(
|
|
551
570
|
el.content ===
|
|
552
|
-
Uint8ArrayToString(input.subarray(el.startPos, el.endPos), "
|
|
571
|
+
Uint8ArrayToString(input.subarray(el.startPos, el.endPos), "utf8"),
|
|
553
572
|
0x3ea /* test */,
|
|
554
573
|
);
|
|
555
574
|
}
|
|
@@ -562,7 +581,16 @@ export class NodeCore {
|
|
|
562
581
|
* Provides loading and serialization capabilities.
|
|
563
582
|
*/
|
|
564
583
|
export class TreeBuilder extends NodeCore {
|
|
565
|
-
static load(
|
|
584
|
+
static load(
|
|
585
|
+
buffer: ReadBuffer,
|
|
586
|
+
logger: ITelemetryLoggerExt,
|
|
587
|
+
): {
|
|
588
|
+
builder: TreeBuilder;
|
|
589
|
+
telemetryProps: {
|
|
590
|
+
durationStructure: number;
|
|
591
|
+
durationStrings: number;
|
|
592
|
+
};
|
|
593
|
+
} {
|
|
566
594
|
const builder = new TreeBuilder();
|
|
567
595
|
const telemetryProps = builder.load(buffer, logger);
|
|
568
596
|
assert(buffer.eof, 0x233 /* "Unexpected data at the end of buffer" */);
|
|
@@ -620,7 +648,7 @@ function throwBufferParseException(
|
|
|
620
648
|
): never {
|
|
621
649
|
throw new NonRetryableError(
|
|
622
650
|
`Buffer parsing exception: ${message}`,
|
|
623
|
-
|
|
651
|
+
OdspErrorTypes.incorrectServerResponse,
|
|
624
652
|
{
|
|
625
653
|
nodeType: getNodeType(node),
|
|
626
654
|
expectedNodeType,
|
package/tsconfig.json
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"extends":
|
|
3
|
-
"../../../common/build/build-common/tsconfig.base.json",
|
|
4
|
-
"../../../common/build/build-common/tsconfig.cjs.json",
|
|
5
|
-
],
|
|
2
|
+
"extends": "../../../common/build/build-common/tsconfig.node16.json",
|
|
6
3
|
"include": ["src/**/*"],
|
|
7
4
|
"exclude": ["src/test/**/*"],
|
|
8
5
|
"compilerOptions": {
|
|
9
6
|
"rootDir": "./src",
|
|
10
|
-
"outDir": "./
|
|
7
|
+
"outDir": "./lib",
|
|
11
8
|
},
|
|
12
9
|
}
|
package/.eslintrc.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
module.exports = {
|
|
7
|
-
extends: [require.resolve("@fluidframework/eslint-config-fluid/minimal"), "prettier"],
|
|
8
|
-
parserOptions: {
|
|
9
|
-
project: ["./tsconfig.json", "./src/test/tsconfig.json"],
|
|
10
|
-
},
|
|
11
|
-
rules: {
|
|
12
|
-
"@typescript-eslint/no-non-null-assertion": "off",
|
|
13
|
-
"@typescript-eslint/no-use-before-define": "off",
|
|
14
|
-
"@typescript-eslint/strict-boolean-expressions": "off",
|
|
15
|
-
"@rushstack/no-new-null": "error",
|
|
16
|
-
"import/no-deprecated": "warn", // This package uses the deprecated ShareLinkTypes type. Once we remove that, we can remove this override. It's set as a warning instead of "off" to serve as a reminder.
|
|
17
|
-
},
|
|
18
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ReadBufferUtils.d.mts","sourceRoot":"","sources":["../src/ReadBufferUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;GAGG;AACH,qBAAa,UAAU;IAOV,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,UAAU;IAN/C,SAAS,CAAC,KAAK,SAAK;IAEpB,IAAW,MAAM,eAEhB;gBAE8B,IAAI,EAAE,UAAU;IAO/C,IAAW,GAAG,YAEb;IACD,IAAW,GAAG,WAEb;IACD,IAAW,MAAM,WAEhB;IAEM,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;IAIhC,KAAK;IAIL,IAAI,CAAC,SAAS,SAAI,GAAG,MAAM;IAc3B,IAAI,CAAC,MAAM,EAAE,MAAM;CAK1B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ReadBufferUtils.mjs","sourceRoot":"","sources":["../src/ReadBufferUtils.ts"],"names":[],"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AAC;SACT;QACD,OAAO,GAAG,CAAC;IACZ,CAAC;IAEM,IAAI,CAAC,MAAc;QACzB,MAAM,CAAC,MAAM,IAAI,CAAC,EAAE,KAAK,CAAC,sCAAsC,CAAC,CAAC;QAClE,IAAI,CAAC,KAAK,IAAI,MAAM,CAAC;QACrB,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,kCAAkC,CAAC,CAAC;IAClF,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils\";\n\n/**\n * Buffer class, used to sequentially read data.\n * Used by tree code to reconstruct a tree from binary representation.\n */\nexport class ReadBuffer {\n\tprotected index = 0;\n\n\tpublic get buffer() {\n\t\treturn this.data;\n\t}\n\n\tconstructor(protected readonly data: Uint8Array) {\n\t\t// BlobShallowCopy will return to users parts of this array.\n\t\t// We need to ensure that nobody can change it, as it will have\n\t\t// catastrophic result and will be really hard to investigate.\n\t\tObject.freeze(data.buffer);\n\t}\n\n\tpublic get eof() {\n\t\treturn this.index === this.data.length;\n\t}\n\tpublic get pos() {\n\t\treturn this.index;\n\t}\n\tpublic get length() {\n\t\treturn this.data.length;\n\t}\n\n\tpublic slice(start: number, end: number) {\n\t\treturn this.data.slice(start, end);\n\t}\n\n\tpublic reset() {\n\t\tthis.index = 0;\n\t}\n\n\tpublic read(lengthArg = 1): number {\n\t\tlet res = 0;\n\t\tlet multiplier = 1;\n\t\tlet length = lengthArg;\n\t\twhile (length > 0) {\n\t\t\tassert(!this.eof, 0x223 /* \"unexpected end of buffer\" */);\n\t\t\tres += this.data[this.index] * multiplier;\n\t\t\tthis.index++;\n\t\t\tmultiplier *= 256;\n\t\t\tlength--;\n\t\t}\n\t\treturn res;\n\t}\n\n\tpublic skip(length: number) {\n\t\tassert(length >= 0, 0x224 /* \"Skip length should be positive\" */);\n\t\tthis.index += length;\n\t\tassert(this.index <= this.data.length, 0x3dc /* skipping past size of buffer */);\n\t}\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WriteBufferUtils.d.mts","sourceRoot":"","sources":["../src/WriteBufferUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAII,EAON,QAAQ,EACR;AAED;;;GAGG;AACH,qBAAa,WAAW;IACvB,SAAS,CAAC,IAAI,CAAC,EAAE,UAAU,CAAwB;IACnD,SAAS,CAAC,KAAK,SAAK;IAEpB,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM;IAiBpB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,SAAI;IAWpC,IAAI,IAAI,UAAU;CAQzB;AAwDD;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,UAexC;AA2HD,cAAM,kBAAmB,SAAQ,QAAQ;;IAKjC,SAAS,CAAC,MAAM,EAAE,WAAW;CAGpC;AAED,qBAAa,qBAAsB,SAAQ,kBAAkB;;IAKrD,SAAS,IAAI,UAAU;CAK9B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WriteBufferUtils.mjs","sourceRoot":"","sources":["../src/WriteBufferUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,SAAS,EAAE,MAAM,8BAA8B;OACjD,EAAE,MAAM,EAAE,MAAM,4BAA4B;OAC5C,EACN,QAAQ,EACR,cAAc,EACd,cAAc,EACd,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,QAAQ,GACR;AAED;;;GAGG;AACH,MAAM,OAAO,WAAW;IAAxB;QACW,SAAI,GAAgB,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC;QACzC,UAAK,GAAG,CAAC,CAAC;IAsCrB,CAAC;IApCU,IAAI,CAAC,IAAY;QAC1B,MAAM,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE,KAAK,CAAC,4BAA4B,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;KACD;AACF,CAAC;AAED,MAAM,kBAAmB,SAAQ,QAAQ;IACxC;QACC,KAAK,EAAE,CAAC;IACT,CAAC;IAEM,SAAS,CAAC,MAAmB;QACnC,iBAAiB,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,GAAG,EAAkB,CAAC,CAAC;IAC5D,CAAC;CACD;AAED,MAAM,OAAO,qBAAsB,SAAQ,kBAAkB;IAC5D;QACC,KAAK,EAAE,CAAC;IACT,CAAC;IAEM,SAAS;QACf,MAAM,MAAM,GAAG,IAAI,WAAW,EAAE,CAAC;QACjC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACxB,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC;IACtB,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IsoBuffer } from \"@fluid-internal/client-utils\";\nimport { assert } from \"@fluidframework/core-utils\";\nimport {\n\tBlobCore,\n\tcodeToBytesMap,\n\tgetValueSafely,\n\tMarkerCodes,\n\tMarkerCodesEnd,\n\tMarkerCodesStart,\n\tNodeCore,\n} from \"./zipItDataRepresentationUtils\";\n\n/**\n * Buffer class, used to sequentially writ data.\n * Used by tree code to serialize tree into binary representation.\n */\nexport class WriteBuffer {\n\tprotected data?: Uint8Array = new Uint8Array(4096);\n\tprotected index = 0;\n\n\tprotected push(code: number) {\n\t\tassert(this.data !== undefined, 0x225 /* \"Data should be there\" */);\n\t\tconst length = this.data.length;\n\t\tif (this.index === length) {\n\t\t\tconst newData = new Uint8Array(length * 1.2 + 4096);\n\t\t\tlet index = 0;\n\t\t\tconst oldData = this.data;\n\t\t\twhile (index < length) {\n\t\t\t\tnewData[index] = oldData[index];\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\tthis.data = newData;\n\t\t}\n\t\tthis.data[this.index] = code % 256;\n\t\tthis.index++;\n\t}\n\n\tpublic write(codeArg: number, lengthArg = 1) {\n\t\tlet code = codeArg;\n\t\tlet length = lengthArg;\n\t\twhile (length > 0) {\n\t\t\tthis.push(code % 256);\n\t\t\tcode = Math.floor(code / 256);\n\t\t\tlength--;\n\t\t}\n\t\tassert(code === 0, 0x226 /* Should write complete data */);\n\t}\n\n\tpublic done(): Uint8Array {\n\t\tassert(this.data !== undefined, 0x227 /* \"Data should be there\" */);\n\t\t// We can slice it to have smaller memory representation.\n\t\t// But it will be way more expensive in terms of CPU cycles!\n\t\tconst buffer = this.data.subarray(0, this.index);\n\t\tthis.data = undefined;\n\t\treturn buffer;\n\t}\n}\n\n// This list of maps below is reverse mapping of Marker Codes specified in zipItDataRepresentationUtils.ts file.\n// We can also found them on server filestore code.\n// https://onedrive.visualstudio.com/SharePoint%20Online/_git/SPO?path=/cobalt/Base/Property/BinaryEncodedPropertyReader.cs&version=GBmaster&_a=contents\n\n/**\n * This contains mapping of number of bytes representing the corresponding string length to Marker Codes.\n */\nconst utf8StringBytesToCodeMap = {\n\t0: 13,\n\t1: 14,\n\t2: 15,\n\t4: 16,\n};\n\n/**\n * This contains mapping of number of bytes representing the corresponding length in which actual data(base64 string)\n * will be stored to Marker Codes.\n */\nconst binaryBytesToCodeMap = {\n\t0: 32,\n\t1: 33,\n\t2: 34,\n\t4: 35,\n\t8: 16,\n};\n\n/**\n * This contains mapping of number of bytes representing the corresponding const string id to Marker Codes.\n */\nconst constStringBytesToCodeMap = {\n\t1: 17,\n\t2: 18,\n\t4: 19,\n};\n\n/**\n * This contains mapping of number of bytes to Marker Codes representing the corresponding Integer.\n */\nconst integerBytesToCodeMap = {\n\t0: 1,\n\t1: 3,\n\t2: 5,\n\t4: 7,\n\t8: 9,\n};\n\n/**\n * This contains mapping of boolean to Marker Codes representing the corresponding bool value.\n */\nconst boolToCodeMap = [\n\t12, // false\n\t11, // true\n];\n\n/**\n * Calculate how many bytes are required to encode an integer. This is always power of 2.\n * So if 6 bytes are required to store an integer than it will return 8. 0 is a special case for which we\n * return 0 as it is usually just represented by marker code and we don't store the actual data.\n * @param num - number to encode.\n */\nexport function calcLength(numArg: number) {\n\tif (numArg === 0) {\n\t\treturn 0;\n\t}\n\tlet num = numArg;\n\tlet lengthLen = 0;\n\twhile (num > 0) {\n\t\tnum = Math.floor(num / 256);\n\t\tlengthLen++;\n\t}\n\tlet res = 1;\n\twhile (res < lengthLen) {\n\t\tres *= 2;\n\t}\n\treturn res;\n}\n\n/**\n * Implementation of serialization of blobs in buffer with Marker Codes etc.\n * @param buffer - Buffer to serialize to.\n * @param content - string to be serialized.\n * @param dictionary - Const strings dictionary to be used while serializing.\n */\nfunction serializeDictionaryString(\n\tbuffer: WriteBuffer,\n\tcontent: string,\n\tdictionary: Map<string, number>,\n) {\n\tlet id = dictionary.get(content);\n\tlet idLength: number;\n\tif (id === undefined) {\n\t\tconst data = IsoBuffer.from(content, \"utf8\");\n\t\tconst lengthOfDataLen = calcLength(data.length);\n\n\t\tid = dictionary.size + 1;\n\t\tidLength = calcLength(id);\n\t\tdictionary.set(content, id);\n\t\tconst code =\n\t\t\tlengthOfDataLen > 1 || idLength > 1\n\t\t\t\t? MarkerCodes.ConstStringDeclareBig\n\t\t\t\t: MarkerCodes.ConstStringDeclare;\n\t\t// Write marker code for const string.\n\t\tbuffer.write(code);\n\t\tconst bytes = getValueSafely(codeToBytesMap, code);\n\t\tassert(\n\t\t\tbytes >= lengthOfDataLen,\n\t\t\t0x283 /* \"Length of data len should fit in the bytes from the map\" */,\n\t\t);\n\t\tassert(bytes >= idLength, 0x284 /* \"Length of id should fit in the bytes from the map\" */);\n\t\t// Assign and write id for const string.\n\t\tbuffer.write(id, bytes);\n\t\t// Write length of const string.\n\t\tbuffer.write(data.length, bytes);\n\t\t// Write const string data.\n\t\tfor (const element of data) {\n\t\t\tbuffer.write(element);\n\t\t}\n\t} else {\n\t\tidLength = calcLength(id);\n\t}\n\t// Write Marker Code\n\tbuffer.write(getValueSafely(constStringBytesToCodeMap, idLength));\n\t// Write id of const string\n\tbuffer.write(id, idLength);\n}\n\nfunction serializeString(buffer: WriteBuffer, content: string, codeMap = binaryBytesToCodeMap) {\n\tserializeBlob(buffer, IsoBuffer.from(content, \"utf8\"), utf8StringBytesToCodeMap);\n}\n\n/**\n * Implementation of serialization of blobs in buffer with Marker Codes etc.\n * @param buffer - Buffer to serialize to.\n * @param blob - blob to be serialized.\n * @param dictionary - Const strings dictionary to be used while serializing.\n */\nfunction serializeBlob(\n\tbuffer: WriteBuffer,\n\tdata: Uint8Array,\n\tcodeMap: Record<number, number> = binaryBytesToCodeMap,\n) {\n\tconst lengthOfDataLen = calcLength(data.length);\n\t// Write Marker code.\n\tbuffer.write(getValueSafely(codeMap, lengthOfDataLen));\n\t// Write actual data if length greater than 0, otherwise Marker Code is enough.\n\tif (lengthOfDataLen > 0) {\n\t\tbuffer.write(data.length, lengthOfDataLen);\n\t\tfor (const element of data) {\n\t\t\tbuffer.write(element);\n\t\t}\n\t}\n}\n\n/**\n * Implementation of serialization of nodes with Marker Codes etc.\n * @param buffer - Buffer to serialize to.\n * @param nodeCore - Node to be serialized.\n * @param dictionary - Const strings dictionary to be used while serializing.\n */\nfunction serializeNodeCore(\n\tbuffer: WriteBuffer,\n\tnodeCore: NodeCore,\n\tdictionary: Map<string, number>,\n) {\n\tfor (const child of nodeCore.nodes) {\n\t\tif (child instanceof NodeCore) {\n\t\t\t// For a tree node start and end with set/list start and end marker codes.\n\t\t\tconst startCode = MarkerCodesStart[child.type];\n\t\t\tconst endCode = MarkerCodesEnd[child.type];\n\t\t\tassert(startCode !== undefined, 0x285 /* \"Start code should not undefined\" */);\n\t\t\tassert(endCode !== undefined, 0x286 /* \"End code should not undefined\" */);\n\t\t\tbuffer.write(startCode);\n\t\t\tserializeNodeCore(buffer, child, dictionary);\n\t\t\tbuffer.write(endCode);\n\t\t} else if (child instanceof BlobCore) {\n\t\t\tserializeBlob(buffer, child.buffer);\n\t\t} else if (typeof child === \"number\") {\n\t\t\t// Calculate length in which integer will be stored\n\t\t\tconst len = calcLength(child);\n\t\t\t// Write corresponding Marker code for length of integer.\n\t\t\tbuffer.write(getValueSafely(integerBytesToCodeMap, len));\n\t\t\t// Write actual number if greater than 0, otherwise Marker Code is enough.\n\t\t\tif (len > 0) {\n\t\t\t\tbuffer.write(child, len);\n\t\t\t}\n\t\t} else if (typeof child === \"boolean\") {\n\t\t\tbuffer.write(boolToCodeMap[child ? 1 : 0]);\n\t\t} else {\n\t\t\tassert(child._stringElement, 0x3dd /* Unsupported node type */);\n\t\t\tif (child.dictionary) {\n\t\t\t\tserializeDictionaryString(buffer, child.content, dictionary);\n\t\t\t} else {\n\t\t\t\tserializeString(buffer, child.content);\n\t\t\t}\n\t\t}\n\t}\n}\n\nclass NodeCoreSerializer extends NodeCore {\n\tconstructor() {\n\t\tsuper();\n\t}\n\n\tpublic serialize(buffer: WriteBuffer) {\n\t\tserializeNodeCore(buffer, this, new Map<string, number>());\n\t}\n}\n\nexport class TreeBuilderSerializer extends NodeCoreSerializer {\n\tconstructor() {\n\t\tsuper();\n\t}\n\n\tpublic serialize(): Uint8Array {\n\t\tconst buffer = new WriteBuffer();\n\t\tsuper.serialize(buffer);\n\t\treturn buffer.done();\n\t}\n}\n"]}
|
package/lib/checkUrl.d.mts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"checkUrl.d.mts","sourceRoot":"","sources":["../src/checkUrl.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,kBAAkB,EAAE,MAAM,oCAAoC;AAGvE;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,WAAW,EAAE,GAAG,GAAG,kBAAkB,GAAG,SAAS,CAmBzE"}
|
package/lib/checkUrl.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"checkUrl.mjs","sourceRoot":"","sources":["../src/checkUrl.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAGI,EAAE,qBAAqB,EAAE;AAEhC;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CAAC,WAAgB;IACxC,MAAM,OAAO,GAAG,qBAAqB,CAAC,WAAW,CAAC,CAAC;IAEnD,IAAI,CAAC,OAAO,EAAE;QACb,OAAO,SAAS,CAAC;KACjB;IAED,IAAI,UAA8B,CAAC;IACnC,IAAI;QACH,IAAI,OAAO,EAAE,OAAO,EAAE;YACrB,UAAU,GAAG,IAAI,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,MAAM,CAAC;SAC9C;KACD;IAAC,MAAM,GAAE;IAEV,OAAO;QACN,eAAe,EAAE,OAAO,EAAE,oBAAoB;QAC9C,uEAAuE;QACvE,mBAAmB,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS;KAC1D,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { DriverPreCheckInfo } from \"@fluidframework/driver-definitions\";\nimport { getLocatorFromOdspUrl } from \"./odspFluidFileLink\";\n\n/**\n * A check that returns DriverPreCheckInfo if the URL format is likely supported by this driver.\n * Note that returning information here is NOT a full guarantee that resolve will ultimately be successful.\n * Instead, this should be used as a lightweight check that can filter out easily detectable unsupported URLs\n * before the entire Fluid loading process needs to be kicked off.\n * @alpha\n */\nexport function checkUrl(documentUrl: URL): DriverPreCheckInfo | undefined {\n\tconst locator = getLocatorFromOdspUrl(documentUrl);\n\n\tif (!locator) {\n\t\treturn undefined;\n\t}\n\n\tlet siteOrigin: string | undefined;\n\ttry {\n\t\tif (locator?.siteUrl) {\n\t\t\tsiteOrigin = new URL(locator?.siteUrl).origin;\n\t\t}\n\t} catch {}\n\n\treturn {\n\t\tcodeDetailsHint: locator?.containerPackageName,\n\t\t// Add the snapshot endpoint, which has the same domain as the site URL\n\t\tcriticalBootDomains: siteOrigin ? [siteOrigin] : undefined,\n\t};\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compactSnapshotParser.d.mts","sourceRoot":"","sources":["../src/compactSnapshotParser.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAII,EAAE,mBAAmB,EAAE,MAAM,iCAAiC;OAC9D,EAAE,iBAAiB,EAAE;AAe5B,eAAO,MAAM,sBAAsB,QAAQ,CAAC;AAC5C,eAAO,MAAM,kBAAkB,QAAQ,CAAC;AAExC;;;;GAIG;AACH,MAAM,WAAW,0BAA2B,SAAQ,iBAAiB;IACpE,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACvC;AAsLD;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAC3C,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,mBAAmB,GACzB,0BAA0B,CA0C5B"}
|