@fluidframework/odsp-driver 1.4.0-121020 → 2.0.0-dev-rc.1.0.0.225277
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.js +12 -12
- package/.mocharc.js +12 -0
- package/CHANGELOG.md +162 -0
- package/README.md +56 -0
- package/api-extractor-esm.json +4 -0
- package/api-extractor-lint.json +4 -0
- package/api-extractor.json +2 -2
- package/api-report/odsp-driver.api.md +309 -0
- package/dist/{ReadBufferUtils.js → ReadBufferUtils.cjs} +16 -9
- package/dist/ReadBufferUtils.cjs.map +1 -0
- package/dist/ReadBufferUtils.d.ts.map +1 -1
- package/dist/{WriteBufferUtils.js → WriteBufferUtils.cjs} +73 -69
- package/dist/WriteBufferUtils.cjs.map +1 -0
- package/dist/WriteBufferUtils.d.ts +3 -5
- package/dist/WriteBufferUtils.d.ts.map +1 -1
- package/dist/{checkUrl.js → checkUrl.cjs} +7 -6
- package/dist/checkUrl.cjs.map +1 -0
- package/dist/checkUrl.d.ts +1 -0
- package/dist/checkUrl.d.ts.map +1 -1
- package/dist/compactSnapshotParser.cjs +207 -0
- package/dist/compactSnapshotParser.cjs.map +1 -0
- package/dist/compactSnapshotParser.d.ts +12 -3
- package/dist/compactSnapshotParser.d.ts.map +1 -1
- package/dist/{compactSnapshotWriter.js → compactSnapshotWriter.cjs} +43 -33
- package/dist/compactSnapshotWriter.cjs.map +1 -0
- package/dist/compactSnapshotWriter.d.ts +2 -3
- package/dist/compactSnapshotWriter.d.ts.map +1 -1
- package/dist/{constants.js → constants.cjs} +7 -1
- package/dist/constants.cjs.map +1 -0
- package/dist/constants.d.ts +6 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/{contracts.js → contracts.cjs} +1 -1
- package/dist/contracts.cjs.map +1 -0
- package/dist/contracts.d.ts +16 -53
- package/dist/contracts.d.ts.map +1 -1
- package/dist/{contractsPublic.js → contractsPublic.cjs} +9 -3
- package/dist/contractsPublic.cjs.map +1 -0
- package/dist/contractsPublic.d.ts +15 -0
- package/dist/contractsPublic.d.ts.map +1 -1
- package/dist/createFile.cjs +177 -0
- package/dist/createFile.cjs.map +1 -0
- package/dist/createFile.d.ts +6 -10
- package/dist/createFile.d.ts.map +1 -1
- package/dist/createNewContainerOnExistingFile.cjs +60 -0
- package/dist/createNewContainerOnExistingFile.cjs.map +1 -0
- package/dist/createNewContainerOnExistingFile.d.ts +22 -0
- package/dist/createNewContainerOnExistingFile.d.ts.map +1 -0
- package/dist/createNewModule.cjs +12 -0
- package/dist/createNewModule.cjs.map +1 -0
- package/dist/createNewModule.d.ts +7 -0
- package/dist/createNewModule.d.ts.map +1 -0
- package/dist/createNewUtils.cjs +203 -0
- package/dist/createNewUtils.cjs.map +1 -0
- package/dist/createNewUtils.d.ts +16 -0
- package/dist/createNewUtils.d.ts.map +1 -1
- package/dist/{createOdspCreateContainerRequest.js → createOdspCreateContainerRequest.cjs} +8 -4
- package/dist/createOdspCreateContainerRequest.cjs.map +1 -0
- package/dist/createOdspCreateContainerRequest.d.ts +5 -3
- package/dist/createOdspCreateContainerRequest.d.ts.map +1 -1
- package/dist/{createOdspUrl.js → createOdspUrl.cjs} +2 -1
- package/dist/createOdspUrl.cjs.map +1 -0
- package/dist/createOdspUrl.d.ts +1 -0
- package/dist/createOdspUrl.d.ts.map +1 -1
- package/dist/{epochTracker.js → epochTracker.cjs} +102 -48
- package/dist/epochTracker.cjs.map +1 -0
- package/dist/epochTracker.d.ts +32 -8
- package/dist/epochTracker.d.ts.map +1 -1
- package/dist/{fetch.js → fetch.cjs} +1 -1
- package/dist/fetch.cjs.map +1 -0
- package/dist/fetch.d.ts +1 -1
- package/dist/fetch.d.ts.map +1 -1
- package/dist/{fetchSnapshot.js → fetchSnapshot.cjs} +192 -176
- package/dist/fetchSnapshot.cjs.map +1 -0
- package/dist/fetchSnapshot.d.ts +10 -5
- package/dist/fetchSnapshot.d.ts.map +1 -1
- package/dist/{getFileLink.js → getFileLink.cjs} +52 -41
- package/dist/getFileLink.cjs.map +1 -0
- package/dist/getFileLink.d.ts +4 -7
- package/dist/getFileLink.d.ts.map +1 -1
- package/dist/{getQueryString.js → getQueryString.cjs} +1 -1
- package/dist/getQueryString.cjs.map +1 -0
- package/dist/getQueryString.d.ts.map +1 -1
- package/dist/{getUrlAndHeadersWithAuth.js → getUrlAndHeadersWithAuth.cjs} +4 -2
- package/dist/getUrlAndHeadersWithAuth.cjs.map +1 -0
- package/dist/getUrlAndHeadersWithAuth.d.ts.map +1 -1
- package/dist/index.cjs +59 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +19 -16
- package/dist/index.d.ts.map +1 -1
- package/dist/localOdspDriver/localOdspDeltaStorageService.cjs +35 -0
- package/dist/localOdspDriver/localOdspDeltaStorageService.cjs.map +1 -0
- package/dist/localOdspDriver/localOdspDeltaStorageService.d.ts +17 -0
- package/dist/localOdspDriver/localOdspDeltaStorageService.d.ts.map +1 -0
- package/dist/localOdspDriver/{localOdspDocumentService.js → localOdspDocumentService.cjs} +7 -5
- package/dist/localOdspDriver/localOdspDocumentService.cjs.map +1 -0
- package/dist/localOdspDriver/localOdspDocumentService.d.ts +3 -2
- package/dist/localOdspDriver/localOdspDocumentService.d.ts.map +1 -1
- package/dist/localOdspDriver/{localOdspDocumentServiceFactory.js → localOdspDocumentServiceFactory.cjs} +9 -10
- package/dist/localOdspDriver/localOdspDocumentServiceFactory.cjs.map +1 -0
- package/dist/localOdspDriver/localOdspDocumentServiceFactory.d.ts +2 -3
- package/dist/localOdspDriver/localOdspDocumentServiceFactory.d.ts.map +1 -1
- package/dist/localOdspDriver/{localOdspDocumentStorageManager.js → localOdspDocumentStorageManager.cjs} +13 -11
- package/dist/localOdspDriver/localOdspDocumentStorageManager.cjs.map +1 -0
- package/dist/localOdspDriver/localOdspDocumentStorageManager.d.ts +2 -2
- package/dist/localOdspDriver/localOdspDocumentStorageManager.d.ts.map +1 -1
- package/dist/odsp-driver-alpha.d.ts +496 -0
- package/dist/odsp-driver-beta.d.ts +160 -0
- package/dist/odsp-driver-public.d.ts +160 -0
- package/dist/odsp-driver-untrimmed.d.ts +565 -0
- package/dist/{odspCache.js → odspCache.cjs} +9 -10
- package/dist/odspCache.cjs.map +1 -0
- package/dist/odspCache.d.ts +19 -4
- package/dist/odspCache.d.ts.map +1 -1
- package/dist/odspDelayLoadedDeltaStream.cjs +291 -0
- package/dist/odspDelayLoadedDeltaStream.cjs.map +1 -0
- package/dist/odspDelayLoadedDeltaStream.d.ts +75 -0
- package/dist/odspDelayLoadedDeltaStream.d.ts.map +1 -0
- package/dist/{odspDeltaStorageService.js → odspDeltaStorageService.cjs} +70 -71
- package/dist/odspDeltaStorageService.cjs.map +1 -0
- package/dist/odspDeltaStorageService.d.ts +8 -6
- package/dist/odspDeltaStorageService.d.ts.map +1 -1
- package/dist/{odspDocumentDeltaConnection.js → odspDocumentDeltaConnection.cjs} +224 -113
- package/dist/odspDocumentDeltaConnection.cjs.map +1 -0
- package/dist/odspDocumentDeltaConnection.d.ts +32 -12
- package/dist/odspDocumentDeltaConnection.d.ts.map +1 -1
- package/dist/odspDocumentService.cjs +225 -0
- package/dist/odspDocumentService.cjs.map +1 -0
- package/dist/odspDocumentService.d.ts +11 -25
- package/dist/odspDocumentService.d.ts.map +1 -1
- package/dist/{odspDocumentServiceFactory.js → odspDocumentServiceFactory.cjs} +8 -5
- package/dist/odspDocumentServiceFactory.cjs.map +1 -0
- package/dist/odspDocumentServiceFactory.d.ts +4 -0
- package/dist/odspDocumentServiceFactory.d.ts.map +1 -1
- package/dist/odspDocumentServiceFactoryCore.cjs +196 -0
- package/dist/odspDocumentServiceFactoryCore.cjs.map +1 -0
- package/dist/odspDocumentServiceFactoryCore.d.ts +18 -11
- package/dist/odspDocumentServiceFactoryCore.d.ts.map +1 -1
- package/dist/odspDocumentServiceFactoryWithCodeSplit.cjs +20 -0
- package/dist/odspDocumentServiceFactoryWithCodeSplit.cjs.map +1 -0
- package/dist/odspDocumentServiceFactoryWithCodeSplit.d.ts +5 -0
- package/dist/odspDocumentServiceFactoryWithCodeSplit.d.ts.map +1 -1
- package/dist/odspDocumentStorageManager.cjs +490 -0
- package/dist/odspDocumentStorageManager.cjs.map +1 -0
- package/dist/odspDocumentStorageManager.d.ts +11 -5
- package/dist/odspDocumentStorageManager.d.ts.map +1 -1
- package/dist/{odspDocumentStorageServiceBase.js → odspDocumentStorageServiceBase.cjs} +32 -34
- package/dist/odspDocumentStorageServiceBase.cjs.map +1 -0
- package/dist/odspDocumentStorageServiceBase.d.ts +7 -9
- package/dist/odspDocumentStorageServiceBase.d.ts.map +1 -1
- package/dist/{odspDriverUrlResolver.js → odspDriverUrlResolver.cjs} +50 -36
- package/dist/odspDriverUrlResolver.cjs.map +1 -0
- package/dist/odspDriverUrlResolver.d.ts +12 -0
- package/dist/odspDriverUrlResolver.d.ts.map +1 -1
- package/dist/{odspDriverUrlResolverForShareLink.js → odspDriverUrlResolverForShareLink.cjs} +37 -26
- package/dist/odspDriverUrlResolverForShareLink.cjs.map +1 -0
- package/dist/odspDriverUrlResolverForShareLink.d.ts +5 -3
- package/dist/odspDriverUrlResolverForShareLink.d.ts.map +1 -1
- package/dist/{odspError.js → odspError.cjs} +7 -3
- package/dist/odspError.cjs.map +1 -0
- package/dist/odspError.d.ts.map +1 -1
- package/dist/{odspFluidFileLink.js → odspFluidFileLink.cjs} +25 -18
- package/dist/odspFluidFileLink.cjs.map +1 -0
- package/dist/odspFluidFileLink.d.ts +10 -1
- package/dist/odspFluidFileLink.d.ts.map +1 -1
- package/dist/odspLocationRedirection.cjs +24 -0
- package/dist/odspLocationRedirection.cjs.map +1 -0
- package/dist/odspLocationRedirection.d.ts +14 -0
- package/dist/odspLocationRedirection.d.ts.map +1 -0
- package/dist/{odspPublicUtils.js → odspPublicUtils.cjs} +7 -4
- package/dist/odspPublicUtils.cjs.map +1 -0
- package/dist/odspPublicUtils.d.ts +6 -0
- package/dist/odspPublicUtils.d.ts.map +1 -1
- package/dist/{odspSnapshotParser.js → odspSnapshotParser.cjs} +11 -12
- package/dist/odspSnapshotParser.cjs.map +1 -0
- package/dist/odspSnapshotParser.d.ts.map +1 -1
- package/dist/{odspSummaryUploadManager.js → odspSummaryUploadManager.cjs} +47 -34
- package/dist/odspSummaryUploadManager.cjs.map +1 -0
- package/dist/odspSummaryUploadManager.d.ts +7 -4
- package/dist/odspSummaryUploadManager.d.ts.map +1 -1
- package/dist/{odspUrlHelper.js → odspUrlHelper.cjs} +9 -3
- package/dist/odspUrlHelper.cjs.map +1 -0
- package/dist/odspUrlHelper.d.ts +5 -0
- package/dist/odspUrlHelper.d.ts.map +1 -1
- package/dist/{odspUtils.js → odspUtils.cjs} +118 -30
- package/dist/odspUtils.cjs.map +1 -0
- package/dist/odspUtils.d.ts +35 -6
- package/dist/odspUtils.d.ts.map +1 -1
- package/dist/{opsCaching.js → opsCaching.cjs} +25 -9
- package/dist/opsCaching.cjs.map +1 -0
- package/dist/opsCaching.d.ts +3 -3
- package/dist/opsCaching.d.ts.map +1 -1
- package/dist/{packageVersion.js → packageVersion.cjs} +2 -2
- package/dist/packageVersion.cjs.map +1 -0
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/prefetchLatestSnapshot.cjs +100 -0
- package/dist/prefetchLatestSnapshot.cjs.map +1 -0
- package/dist/prefetchLatestSnapshot.d.ts +12 -7
- package/dist/prefetchLatestSnapshot.d.ts.map +1 -1
- package/dist/{retryErrorsStorageAdapter.js → retryErrorsStorageAdapter.cjs} +13 -6
- package/dist/retryErrorsStorageAdapter.cjs.map +1 -0
- package/dist/retryErrorsStorageAdapter.d.ts +5 -4
- package/dist/retryErrorsStorageAdapter.d.ts.map +1 -1
- package/dist/{retryUtils.js → retryUtils.cjs} +30 -14
- package/dist/retryUtils.cjs.map +1 -0
- package/dist/retryUtils.d.ts +2 -2
- package/dist/retryUtils.d.ts.map +1 -1
- package/dist/socketModule.cjs +10 -0
- package/dist/socketModule.cjs.map +1 -0
- package/dist/socketModule.d.ts +7 -0
- package/dist/socketModule.d.ts.map +1 -0
- package/dist/tsdoc-metadata.json +11 -0
- package/dist/{vroom.js → vroom.cjs} +24 -9
- package/dist/vroom.cjs.map +1 -0
- package/dist/vroom.d.ts +4 -4
- package/dist/vroom.d.ts.map +1 -1
- package/dist/{zipItDataRepresentationUtils.js → zipItDataRepresentationUtils.cjs} +227 -118
- package/dist/zipItDataRepresentationUtils.cjs.map +1 -0
- package/dist/zipItDataRepresentationUtils.d.ts +47 -20
- package/dist/zipItDataRepresentationUtils.d.ts.map +1 -1
- package/lib/{ReadBufferUtils.d.ts → ReadBufferUtils.d.mts} +1 -1
- package/lib/ReadBufferUtils.d.mts.map +1 -0
- package/lib/{ReadBufferUtils.js → ReadBufferUtils.mjs} +14 -7
- package/lib/ReadBufferUtils.mjs.map +1 -0
- package/lib/{WriteBufferUtils.d.ts → WriteBufferUtils.d.mts} +4 -6
- package/lib/WriteBufferUtils.d.mts.map +1 -0
- package/lib/{WriteBufferUtils.js → WriteBufferUtils.mjs} +68 -64
- package/lib/WriteBufferUtils.mjs.map +1 -0
- package/lib/{checkUrl.d.ts → checkUrl.d.mts} +2 -1
- package/lib/checkUrl.d.mts.map +1 -0
- package/lib/{checkUrl.js → checkUrl.mjs} +7 -6
- package/lib/checkUrl.mjs.map +1 -0
- package/lib/compactSnapshotParser.d.mts +24 -0
- package/lib/compactSnapshotParser.d.mts.map +1 -0
- package/lib/compactSnapshotParser.mjs +203 -0
- package/lib/compactSnapshotParser.mjs.map +1 -0
- package/lib/{compactSnapshotWriter.d.ts → compactSnapshotWriter.d.mts} +4 -5
- package/lib/compactSnapshotWriter.d.mts.map +1 -0
- package/lib/{compactSnapshotWriter.js → compactSnapshotWriter.mjs} +41 -31
- package/lib/compactSnapshotWriter.mjs.map +1 -0
- package/lib/{constants.d.ts → constants.d.mts} +7 -1
- package/lib/constants.d.mts.map +1 -0
- package/lib/{constants.js → constants.mjs} +7 -1
- package/lib/constants.mjs.map +1 -0
- package/lib/{contracts.d.ts → contracts.d.mts} +18 -55
- package/lib/contracts.d.mts.map +1 -0
- package/lib/{contracts.js → contracts.mjs} +1 -1
- package/lib/contracts.mjs.map +1 -0
- package/lib/{contractsPublic.d.ts → contractsPublic.d.mts} +16 -1
- package/lib/contractsPublic.d.mts.map +1 -0
- package/lib/{contractsPublic.js → contractsPublic.mjs} +7 -1
- package/lib/contractsPublic.mjs.map +1 -0
- package/lib/createFile.d.mts +18 -0
- package/lib/createFile.d.mts.map +1 -0
- package/lib/createFile.mjs +171 -0
- package/lib/createFile.mjs.map +1 -0
- package/lib/createNewContainerOnExistingFile.d.mts +22 -0
- package/lib/createNewContainerOnExistingFile.d.mts.map +1 -0
- package/lib/createNewContainerOnExistingFile.mjs +56 -0
- package/lib/createNewContainerOnExistingFile.mjs.map +1 -0
- package/lib/createNewModule.d.mts +7 -0
- package/lib/createNewModule.d.mts.map +1 -0
- package/lib/createNewModule.mjs +7 -0
- package/lib/createNewModule.mjs.map +1 -0
- package/lib/createNewUtils.d.mts +27 -0
- package/lib/createNewUtils.d.mts.map +1 -0
- package/lib/createNewUtils.mjs +197 -0
- package/lib/createNewUtils.mjs.map +1 -0
- package/lib/{createOdspCreateContainerRequest.d.ts → createOdspCreateContainerRequest.d.mts} +6 -8
- package/lib/createOdspCreateContainerRequest.d.mts.map +1 -0
- package/lib/{createOdspCreateContainerRequest.js → createOdspCreateContainerRequest.mjs} +8 -4
- package/lib/createOdspCreateContainerRequest.mjs.map +1 -0
- package/lib/{createOdspUrl.d.ts → createOdspUrl.d.mts} +3 -2
- package/lib/createOdspUrl.d.mts.map +1 -0
- package/lib/{createOdspUrl.js → createOdspUrl.mjs} +2 -1
- package/lib/createOdspUrl.mjs.map +1 -0
- package/lib/{epochTracker.d.ts → epochTracker.d.mts} +35 -11
- package/lib/epochTracker.d.mts.map +1 -0
- package/lib/{epochTracker.js → epochTracker.mjs} +97 -43
- package/lib/epochTracker.mjs.map +1 -0
- package/lib/{fetch.d.ts → fetch.d.mts} +2 -2
- package/lib/fetch.d.mts.map +1 -0
- package/lib/{fetch.js → fetch.mjs} +1 -1
- package/lib/fetch.mjs.map +1 -0
- package/lib/{fetchSnapshot.d.ts → fetchSnapshot.d.mts} +15 -10
- package/lib/fetchSnapshot.d.mts.map +1 -0
- package/lib/{fetchSnapshot.js → fetchSnapshot.mjs} +185 -167
- package/lib/fetchSnapshot.mjs.map +1 -0
- package/lib/{getFileLink.d.ts → getFileLink.d.mts} +5 -8
- package/lib/getFileLink.d.mts.map +1 -0
- package/lib/{getFileLink.js → getFileLink.mjs} +49 -38
- package/lib/getFileLink.mjs.map +1 -0
- package/lib/{getQueryString.d.ts → getQueryString.d.mts} +1 -5
- package/lib/getQueryString.d.mts.map +1 -0
- package/lib/{getQueryString.js → getQueryString.mjs} +1 -1
- package/lib/getQueryString.mjs.map +1 -0
- package/lib/{getUrlAndHeadersWithAuth.d.ts → getUrlAndHeadersWithAuth.d.mts} +1 -1
- package/lib/getUrlAndHeadersWithAuth.d.mts.map +1 -0
- package/lib/{getUrlAndHeadersWithAuth.js → getUrlAndHeadersWithAuth.mjs} +4 -2
- package/lib/getUrlAndHeadersWithAuth.mjs.map +1 -0
- package/lib/index.d.mts +24 -0
- package/lib/index.d.mts.map +1 -0
- package/lib/index.mjs +22 -0
- package/lib/index.mjs.map +1 -0
- package/lib/localOdspDriver/localOdspDeltaStorageService.d.mts +17 -0
- package/lib/localOdspDriver/localOdspDeltaStorageService.d.mts.map +1 -0
- package/lib/localOdspDriver/localOdspDeltaStorageService.mjs +31 -0
- package/lib/localOdspDriver/localOdspDeltaStorageService.mjs.map +1 -0
- package/lib/localOdspDriver/{localOdspDocumentService.d.ts → localOdspDocumentService.d.mts} +4 -3
- package/lib/localOdspDriver/localOdspDocumentService.d.mts.map +1 -0
- package/lib/localOdspDriver/{localOdspDocumentService.js → localOdspDocumentService.mjs} +8 -6
- package/lib/localOdspDriver/localOdspDocumentService.mjs.map +1 -0
- package/lib/localOdspDriver/{localOdspDocumentServiceFactory.d.ts → localOdspDocumentServiceFactory.d.mts} +5 -6
- package/lib/localOdspDriver/localOdspDocumentServiceFactory.d.mts.map +1 -0
- package/lib/localOdspDriver/{localOdspDocumentServiceFactory.js → localOdspDocumentServiceFactory.mjs} +9 -10
- package/lib/localOdspDriver/localOdspDocumentServiceFactory.mjs.map +1 -0
- package/lib/localOdspDriver/{localOdspDocumentStorageManager.d.ts → localOdspDocumentStorageManager.d.mts} +4 -4
- package/lib/localOdspDriver/localOdspDocumentStorageManager.d.mts.map +1 -0
- package/lib/localOdspDriver/{localOdspDocumentStorageManager.js → localOdspDocumentStorageManager.mjs} +11 -9
- package/lib/localOdspDriver/localOdspDocumentStorageManager.mjs.map +1 -0
- package/lib/odsp-driver-alpha.d.mts +496 -0
- package/lib/odsp-driver-beta.d.mts +160 -0
- package/lib/odsp-driver-public.d.mts +160 -0
- package/lib/odsp-driver-untrimmed.d.mts +565 -0
- package/lib/{odspCache.d.ts → odspCache.d.mts} +20 -9
- package/lib/odspCache.d.mts.map +1 -0
- package/lib/{odspCache.js → odspCache.mjs} +6 -11
- package/lib/odspCache.mjs.map +1 -0
- package/lib/odspDelayLoadedDeltaStream.d.mts +75 -0
- package/lib/odspDelayLoadedDeltaStream.d.mts.map +1 -0
- package/lib/odspDelayLoadedDeltaStream.mjs +287 -0
- package/lib/odspDelayLoadedDeltaStream.mjs.map +1 -0
- package/lib/{odspDeltaStorageService.d.ts → odspDeltaStorageService.d.mts} +10 -8
- package/lib/odspDeltaStorageService.d.mts.map +1 -0
- package/lib/{odspDeltaStorageService.js → odspDeltaStorageService.mjs} +70 -68
- package/lib/odspDeltaStorageService.mjs.map +1 -0
- package/lib/{odspDocumentDeltaConnection.d.ts → odspDocumentDeltaConnection.d.mts} +34 -14
- package/lib/odspDocumentDeltaConnection.d.mts.map +1 -0
- package/lib/{odspDocumentDeltaConnection.js → odspDocumentDeltaConnection.mjs} +214 -103
- package/lib/odspDocumentDeltaConnection.mjs.map +1 -0
- package/lib/{odspDocumentService.d.ts → odspDocumentService.d.mts} +15 -29
- package/lib/odspDocumentService.d.mts.map +1 -0
- package/lib/odspDocumentService.mjs +221 -0
- package/lib/odspDocumentService.mjs.map +1 -0
- package/lib/{odspDocumentServiceFactory.d.ts → odspDocumentServiceFactory.d.mts} +6 -2
- package/lib/odspDocumentServiceFactory.d.mts.map +1 -0
- package/lib/{odspDocumentServiceFactory.js → odspDocumentServiceFactory.mjs} +8 -6
- package/lib/odspDocumentServiceFactory.mjs.map +1 -0
- package/lib/{odspDocumentServiceFactoryCore.d.ts → odspDocumentServiceFactoryCore.d.mts} +20 -13
- package/lib/odspDocumentServiceFactoryCore.d.mts.map +1 -0
- package/lib/odspDocumentServiceFactoryCore.mjs +192 -0
- package/lib/odspDocumentServiceFactoryCore.mjs.map +1 -0
- package/lib/{odspDocumentServiceFactoryWithCodeSplit.d.ts → odspDocumentServiceFactoryWithCodeSplit.d.mts} +7 -2
- package/lib/odspDocumentServiceFactoryWithCodeSplit.d.mts.map +1 -0
- package/lib/{odspDocumentServiceFactoryWithCodeSplit.js → odspDocumentServiceFactoryWithCodeSplit.mjs} +8 -3
- package/lib/odspDocumentServiceFactoryWithCodeSplit.mjs.map +1 -0
- package/lib/{odspDocumentStorageManager.d.ts → odspDocumentStorageManager.d.mts} +18 -12
- package/lib/odspDocumentStorageManager.d.mts.map +1 -0
- package/lib/odspDocumentStorageManager.mjs +486 -0
- package/lib/odspDocumentStorageManager.mjs.map +1 -0
- package/lib/{odspDocumentStorageServiceBase.d.ts → odspDocumentStorageServiceBase.d.mts} +9 -11
- package/lib/odspDocumentStorageServiceBase.d.mts.map +1 -0
- package/lib/{odspDocumentStorageServiceBase.js → odspDocumentStorageServiceBase.mjs} +31 -33
- package/lib/odspDocumentStorageServiceBase.mjs.map +1 -0
- package/lib/{odspDriverUrlResolver.d.ts → odspDriverUrlResolver.d.mts} +13 -1
- package/lib/odspDriverUrlResolver.d.mts.map +1 -0
- package/lib/{odspDriverUrlResolver.js → odspDriverUrlResolver.mjs} +50 -40
- package/lib/odspDriverUrlResolver.mjs.map +1 -0
- package/lib/{odspDriverUrlResolverForShareLink.d.ts → odspDriverUrlResolverForShareLink.d.mts} +7 -5
- package/lib/odspDriverUrlResolverForShareLink.d.mts.map +1 -0
- package/lib/{odspDriverUrlResolverForShareLink.js → odspDriverUrlResolverForShareLink.mjs} +36 -29
- package/lib/odspDriverUrlResolverForShareLink.mjs.map +1 -0
- package/lib/{odspError.d.ts → odspError.d.mts} +2 -2
- package/lib/odspError.d.mts.map +1 -0
- package/lib/{odspError.js → odspError.mjs} +7 -3
- package/lib/odspError.mjs.map +1 -0
- package/lib/{odspFluidFileLink.d.ts → odspFluidFileLink.d.mts} +12 -3
- package/lib/odspFluidFileLink.d.mts.map +1 -0
- package/lib/{odspFluidFileLink.js → odspFluidFileLink.mjs} +23 -16
- package/lib/odspFluidFileLink.mjs.map +1 -0
- package/lib/odspLocationRedirection.d.mts +14 -0
- package/lib/odspLocationRedirection.d.mts.map +1 -0
- package/lib/odspLocationRedirection.mjs +20 -0
- package/lib/odspLocationRedirection.mjs.map +1 -0
- package/lib/{odspPublicUtils.d.ts → odspPublicUtils.d.mts} +7 -1
- package/lib/odspPublicUtils.d.mts.map +1 -0
- package/lib/{odspPublicUtils.js → odspPublicUtils.mjs} +5 -2
- package/lib/odspPublicUtils.mjs.map +1 -0
- package/lib/{odspSnapshotParser.d.ts → odspSnapshotParser.d.mts} +3 -3
- package/lib/odspSnapshotParser.d.mts.map +1 -0
- package/lib/{odspSnapshotParser.js → odspSnapshotParser.mjs} +10 -11
- package/lib/odspSnapshotParser.mjs.map +1 -0
- package/lib/{odspSummaryUploadManager.d.ts → odspSummaryUploadManager.d.mts} +9 -6
- package/lib/odspSummaryUploadManager.d.mts.map +1 -0
- package/lib/{odspSummaryUploadManager.js → odspSummaryUploadManager.mjs} +41 -32
- package/lib/odspSummaryUploadManager.mjs.map +1 -0
- package/lib/{odspUrlHelper.d.ts → odspUrlHelper.d.mts} +6 -1
- package/lib/odspUrlHelper.d.mts.map +1 -0
- package/lib/{odspUrlHelper.js → odspUrlHelper.mjs} +9 -3
- package/lib/odspUrlHelper.mjs.map +1 -0
- package/lib/{odspUtils.d.ts → odspUtils.d.mts} +37 -8
- package/lib/odspUtils.d.mts.map +1 -0
- package/lib/{odspUtils.js → odspUtils.mjs} +109 -27
- package/lib/odspUtils.mjs.map +1 -0
- package/lib/{opsCaching.d.ts → opsCaching.d.mts} +4 -4
- package/lib/opsCaching.d.mts.map +1 -0
- package/lib/{opsCaching.js → opsCaching.mjs} +23 -7
- package/lib/opsCaching.mjs.map +1 -0
- package/lib/{packageVersion.d.ts → packageVersion.d.mts} +2 -2
- package/lib/packageVersion.d.mts.map +1 -0
- package/lib/{packageVersion.js → packageVersion.mjs} +2 -2
- package/lib/packageVersion.mjs.map +1 -0
- package/lib/{prefetchLatestSnapshot.d.ts → prefetchLatestSnapshot.d.mts} +14 -9
- package/lib/prefetchLatestSnapshot.d.mts.map +1 -0
- package/lib/prefetchLatestSnapshot.mjs +96 -0
- package/lib/prefetchLatestSnapshot.mjs.map +1 -0
- package/lib/{retryErrorsStorageAdapter.d.ts → retryErrorsStorageAdapter.d.mts} +6 -5
- package/lib/retryErrorsStorageAdapter.d.mts.map +1 -0
- package/lib/{retryErrorsStorageAdapter.js → retryErrorsStorageAdapter.mjs} +13 -6
- package/lib/retryErrorsStorageAdapter.mjs.map +1 -0
- package/lib/{retryUtils.d.ts → retryUtils.d.mts} +3 -3
- package/lib/retryUtils.d.mts.map +1 -0
- package/lib/{retryUtils.js → retryUtils.mjs} +27 -11
- package/lib/retryUtils.mjs.map +1 -0
- package/lib/socketModule.d.mts +7 -0
- package/lib/socketModule.d.mts.map +1 -0
- package/lib/socketModule.mjs +7 -0
- package/lib/socketModule.mjs.map +1 -0
- package/lib/{vroom.d.ts → vroom.d.mts} +7 -7
- package/lib/vroom.d.mts.map +1 -0
- package/lib/{vroom.js → vroom.mjs} +24 -9
- package/lib/vroom.mjs.map +1 -0
- package/lib/{zipItDataRepresentationUtils.d.ts → zipItDataRepresentationUtils.d.mts} +49 -22
- package/lib/zipItDataRepresentationUtils.d.mts.map +1 -0
- package/lib/{zipItDataRepresentationUtils.js → zipItDataRepresentationUtils.mjs} +213 -111
- package/lib/zipItDataRepresentationUtils.mjs.map +1 -0
- package/package.json +87 -69
- package/prettier.config.cjs +8 -0
- package/src/ReadBufferUtils.ts +51 -44
- package/src/WriteBufferUtils.ts +203 -181
- package/src/checkUrl.ts +16 -15
- package/src/compactSnapshotParser.ts +219 -103
- package/src/compactSnapshotWriter.ts +118 -97
- package/src/constants.ts +7 -0
- package/src/contracts.ts +96 -136
- package/src/contractsPublic.ts +31 -16
- package/src/createFile.ts +243 -305
- package/src/createNewContainerOnExistingFile.ts +93 -0
- package/src/createNewModule.ts +7 -0
- package/src/createNewUtils.ts +266 -56
- package/src/createOdspCreateContainerRequest.ts +22 -18
- package/src/createOdspUrl.ts +12 -13
- package/src/epochTracker.ts +596 -457
- package/src/fetch.ts +4 -4
- package/src/fetchSnapshot.ts +583 -508
- package/src/getFileLink.ts +194 -155
- package/src/getQueryString.ts +11 -9
- package/src/getUrlAndHeadersWithAuth.ts +34 -33
- package/src/index.ts +42 -18
- package/src/localOdspDriver/localOdspDeltaStorageService.ts +49 -0
- package/src/localOdspDriver/localOdspDocumentService.ts +40 -38
- package/src/localOdspDriver/localOdspDocumentServiceFactory.ts +46 -43
- package/src/localOdspDriver/localOdspDocumentStorageManager.ts +55 -50
- package/src/odspCache.ts +112 -90
- package/src/odspDelayLoadedDeltaStream.ts +459 -0
- package/src/odspDeltaStorageService.ts +232 -221
- package/src/odspDocumentDeltaConnection.ts +751 -563
- package/src/odspDocumentService.ts +324 -523
- package/src/odspDocumentServiceFactory.ts +20 -21
- package/src/odspDocumentServiceFactoryCore.ts +329 -200
- package/src/odspDocumentServiceFactoryWithCodeSplit.ts +20 -20
- package/src/odspDocumentStorageManager.ts +730 -534
- package/src/odspDocumentStorageServiceBase.ts +279 -254
- package/src/odspDriverUrlResolver.ts +230 -188
- package/src/odspDriverUrlResolverForShareLink.ts +223 -203
- package/src/odspError.ts +27 -19
- package/src/odspFluidFileLink.ts +106 -87
- package/src/odspLocationRedirection.ts +26 -0
- package/src/odspPublicUtils.ts +20 -14
- package/src/odspSnapshotParser.ts +53 -46
- package/src/odspSummaryUploadManager.ts +243 -218
- package/src/odspUrlHelper.ts +81 -71
- package/src/odspUtils.ts +401 -259
- package/src/opsCaching.ts +214 -193
- package/src/packageVersion.ts +1 -1
- package/src/prefetchLatestSnapshot.ts +142 -80
- package/src/retryErrorsStorageAdapter.ts +92 -77
- package/src/retryUtils.ts +80 -57
- package/src/socketModule.ts +8 -0
- package/src/vroom.ts +92 -83
- package/src/zipItDataRepresentationUtils.ts +534 -394
- package/tsc-multi.test.json +4 -0
- package/tsconfig.json +11 -13
- package/.editorconfig +0 -7
- package/dist/ReadBufferUtils.js.map +0 -1
- package/dist/WriteBufferUtils.js.map +0 -1
- package/dist/checkUrl.js.map +0 -1
- package/dist/compactSnapshotParser.js +0 -115
- package/dist/compactSnapshotParser.js.map +0 -1
- package/dist/compactSnapshotWriter.js.map +0 -1
- package/dist/constants.js.map +0 -1
- package/dist/contracts.js.map +0 -1
- package/dist/contractsPublic.js.map +0 -1
- package/dist/createFile.js +0 -242
- package/dist/createFile.js.map +0 -1
- package/dist/createNewUtils.js +0 -67
- package/dist/createNewUtils.js.map +0 -1
- package/dist/createOdspCreateContainerRequest.js.map +0 -1
- package/dist/createOdspUrl.js.map +0 -1
- package/dist/epochTracker.js.map +0 -1
- package/dist/fetch.js.map +0 -1
- package/dist/fetchSnapshot.js.map +0 -1
- package/dist/getFileLink.js.map +0 -1
- package/dist/getQueryString.js.map +0 -1
- package/dist/getSocketIo.d.ts +0 -11
- package/dist/getSocketIo.d.ts.map +0 -1
- package/dist/getSocketIo.js +0 -20
- package/dist/getSocketIo.js.map +0 -1
- package/dist/getUrlAndHeadersWithAuth.js.map +0 -1
- package/dist/index.js +0 -41
- package/dist/index.js.map +0 -1
- package/dist/localOdspDriver/localOdspDocumentService.js.map +0 -1
- package/dist/localOdspDriver/localOdspDocumentServiceFactory.js.map +0 -1
- package/dist/localOdspDriver/localOdspDocumentStorageManager.js.map +0 -1
- package/dist/odspCache.js.map +0 -1
- package/dist/odspDeltaStorageService.js.map +0 -1
- package/dist/odspDocumentDeltaConnection.js.map +0 -1
- package/dist/odspDocumentService.js +0 -364
- package/dist/odspDocumentService.js.map +0 -1
- package/dist/odspDocumentServiceFactory.js.map +0 -1
- package/dist/odspDocumentServiceFactoryCore.js +0 -118
- package/dist/odspDocumentServiceFactoryCore.js.map +0 -1
- package/dist/odspDocumentServiceFactoryWithCodeSplit.js +0 -34
- package/dist/odspDocumentServiceFactoryWithCodeSplit.js.map +0 -1
- package/dist/odspDocumentStorageManager.js +0 -356
- package/dist/odspDocumentStorageManager.js.map +0 -1
- package/dist/odspDocumentStorageServiceBase.js.map +0 -1
- package/dist/odspDriverUrlResolver.js.map +0 -1
- package/dist/odspDriverUrlResolverForShareLink.js.map +0 -1
- package/dist/odspError.js.map +0 -1
- package/dist/odspFluidFileLink.js.map +0 -1
- package/dist/odspPublicUtils.js.map +0 -1
- package/dist/odspSnapshotParser.js.map +0 -1
- package/dist/odspSummaryUploadManager.js.map +0 -1
- package/dist/odspUrlHelper.js.map +0 -1
- package/dist/odspUtils.js.map +0 -1
- package/dist/opsCaching.js.map +0 -1
- package/dist/packageVersion.js.map +0 -1
- package/dist/prefetchLatestSnapshot.js +0 -57
- package/dist/prefetchLatestSnapshot.js.map +0 -1
- package/dist/retryErrorsStorageAdapter.js.map +0 -1
- package/dist/retryUtils.js.map +0 -1
- package/dist/vroom.js.map +0 -1
- package/dist/zipItDataRepresentationUtils.js.map +0 -1
- package/lib/ReadBufferUtils.d.ts.map +0 -1
- package/lib/ReadBufferUtils.js.map +0 -1
- package/lib/WriteBufferUtils.d.ts.map +0 -1
- package/lib/WriteBufferUtils.js.map +0 -1
- package/lib/checkUrl.d.ts.map +0 -1
- package/lib/checkUrl.js.map +0 -1
- package/lib/compactSnapshotParser.d.ts +0 -15
- package/lib/compactSnapshotParser.d.ts.map +0 -1
- package/lib/compactSnapshotParser.js +0 -111
- package/lib/compactSnapshotParser.js.map +0 -1
- package/lib/compactSnapshotWriter.d.ts.map +0 -1
- package/lib/compactSnapshotWriter.js.map +0 -1
- package/lib/constants.d.ts.map +0 -1
- package/lib/constants.js.map +0 -1
- package/lib/contracts.d.ts.map +0 -1
- package/lib/contracts.js.map +0 -1
- package/lib/contractsPublic.d.ts.map +0 -1
- package/lib/contractsPublic.js.map +0 -1
- package/lib/createFile.d.ts +0 -22
- package/lib/createFile.d.ts.map +0 -1
- package/lib/createFile.js +0 -235
- package/lib/createFile.js.map +0 -1
- package/lib/createNewUtils.d.ts +0 -11
- package/lib/createNewUtils.d.ts.map +0 -1
- package/lib/createNewUtils.js +0 -63
- package/lib/createNewUtils.js.map +0 -1
- package/lib/createOdspCreateContainerRequest.d.ts.map +0 -1
- package/lib/createOdspCreateContainerRequest.js.map +0 -1
- package/lib/createOdspUrl.d.ts.map +0 -1
- package/lib/createOdspUrl.js.map +0 -1
- package/lib/epochTracker.d.ts.map +0 -1
- package/lib/epochTracker.js.map +0 -1
- package/lib/fetch.d.ts.map +0 -1
- package/lib/fetch.js.map +0 -1
- package/lib/fetchSnapshot.d.ts.map +0 -1
- package/lib/fetchSnapshot.js.map +0 -1
- package/lib/getFileLink.d.ts.map +0 -1
- package/lib/getFileLink.js.map +0 -1
- package/lib/getQueryString.d.ts.map +0 -1
- package/lib/getQueryString.js.map +0 -1
- package/lib/getSocketIo.d.ts +0 -11
- package/lib/getSocketIo.d.ts.map +0 -1
- package/lib/getSocketIo.js +0 -13
- package/lib/getSocketIo.js.map +0 -1
- package/lib/getUrlAndHeadersWithAuth.d.ts.map +0 -1
- package/lib/getUrlAndHeadersWithAuth.js.map +0 -1
- package/lib/index.d.ts +0 -21
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -29
- package/lib/index.js.map +0 -1
- package/lib/localOdspDriver/localOdspDocumentService.d.ts.map +0 -1
- package/lib/localOdspDriver/localOdspDocumentService.js.map +0 -1
- package/lib/localOdspDriver/localOdspDocumentServiceFactory.d.ts.map +0 -1
- package/lib/localOdspDriver/localOdspDocumentServiceFactory.js.map +0 -1
- package/lib/localOdspDriver/localOdspDocumentStorageManager.d.ts.map +0 -1
- package/lib/localOdspDriver/localOdspDocumentStorageManager.js.map +0 -1
- package/lib/odspCache.d.ts.map +0 -1
- package/lib/odspCache.js.map +0 -1
- package/lib/odspDeltaStorageService.d.ts.map +0 -1
- package/lib/odspDeltaStorageService.js.map +0 -1
- package/lib/odspDocumentDeltaConnection.d.ts.map +0 -1
- package/lib/odspDocumentDeltaConnection.js.map +0 -1
- package/lib/odspDocumentService.d.ts.map +0 -1
- package/lib/odspDocumentService.js +0 -360
- package/lib/odspDocumentService.js.map +0 -1
- package/lib/odspDocumentServiceFactory.d.ts.map +0 -1
- package/lib/odspDocumentServiceFactory.js.map +0 -1
- package/lib/odspDocumentServiceFactoryCore.d.ts.map +0 -1
- package/lib/odspDocumentServiceFactoryCore.js +0 -114
- package/lib/odspDocumentServiceFactoryCore.js.map +0 -1
- package/lib/odspDocumentServiceFactoryWithCodeSplit.d.ts.map +0 -1
- package/lib/odspDocumentServiceFactoryWithCodeSplit.js.map +0 -1
- package/lib/odspDocumentStorageManager.d.ts.map +0 -1
- package/lib/odspDocumentStorageManager.js +0 -352
- package/lib/odspDocumentStorageManager.js.map +0 -1
- package/lib/odspDocumentStorageServiceBase.d.ts.map +0 -1
- package/lib/odspDocumentStorageServiceBase.js.map +0 -1
- package/lib/odspDriverUrlResolver.d.ts.map +0 -1
- package/lib/odspDriverUrlResolver.js.map +0 -1
- package/lib/odspDriverUrlResolverForShareLink.d.ts.map +0 -1
- package/lib/odspDriverUrlResolverForShareLink.js.map +0 -1
- package/lib/odspError.d.ts.map +0 -1
- package/lib/odspError.js.map +0 -1
- package/lib/odspFluidFileLink.d.ts.map +0 -1
- package/lib/odspFluidFileLink.js.map +0 -1
- package/lib/odspPublicUtils.d.ts.map +0 -1
- package/lib/odspPublicUtils.js.map +0 -1
- package/lib/odspSnapshotParser.d.ts.map +0 -1
- package/lib/odspSnapshotParser.js.map +0 -1
- package/lib/odspSummaryUploadManager.d.ts.map +0 -1
- package/lib/odspSummaryUploadManager.js.map +0 -1
- package/lib/odspUrlHelper.d.ts.map +0 -1
- package/lib/odspUrlHelper.js.map +0 -1
- package/lib/odspUtils.d.ts.map +0 -1
- package/lib/odspUtils.js.map +0 -1
- package/lib/opsCaching.d.ts.map +0 -1
- package/lib/opsCaching.js.map +0 -1
- package/lib/packageVersion.d.ts.map +0 -1
- package/lib/packageVersion.js.map +0 -1
- package/lib/prefetchLatestSnapshot.d.ts.map +0 -1
- package/lib/prefetchLatestSnapshot.js +0 -53
- package/lib/prefetchLatestSnapshot.js.map +0 -1
- package/lib/retryErrorsStorageAdapter.d.ts.map +0 -1
- package/lib/retryErrorsStorageAdapter.js.map +0 -1
- package/lib/retryUtils.d.ts.map +0 -1
- package/lib/retryUtils.js.map +0 -1
- package/lib/vroom.d.ts.map +0 -1
- package/lib/vroom.js.map +0 -1
- package/lib/zipItDataRepresentationUtils.d.ts.map +0 -1
- package/lib/zipItDataRepresentationUtils.js.map +0 -1
- package/src/getSocketIo.ts +0 -14
- package/tsconfig.esnext.json +0 -7
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import { PerformanceEvent } from "@fluidframework/telemetry-utils";
|
|
6
|
+
import { getDocAttributesFromProtocolSummary, isCombinedAppAndProtocolSummary, } from "@fluidframework/driver-utils";
|
|
7
|
+
import { SharingLinkScope, SharingLinkRole, ShareLinkTypes, } from "@fluidframework/odsp-driver-definitions";
|
|
8
|
+
import { v4 as uuid } from "uuid";
|
|
9
|
+
import { LocalPersistentCache, NonPersistentCache, } from "./odspCache.mjs";
|
|
10
|
+
import { createOdspCacheAndTracker } from "./epochTracker.mjs";
|
|
11
|
+
import { OdspDocumentService } from "./odspDocumentService.mjs";
|
|
12
|
+
import { getOdspResolvedUrl, createOdspLogger, toInstrumentedOdspTokenFetcher, isNewFileInfo, getJoinSessionCacheKey, } from "./odspUtils.mjs";
|
|
13
|
+
/**
|
|
14
|
+
* Factory for creating the sharepoint document service. Use this if you want to
|
|
15
|
+
* use the sharepoint implementation.
|
|
16
|
+
*
|
|
17
|
+
* This constructor should be used by environments that support dynamic imports and that wish
|
|
18
|
+
* to leverage code splitting as a means to keep bundles as small as possible.
|
|
19
|
+
* @alpha
|
|
20
|
+
*/
|
|
21
|
+
export class OdspDocumentServiceFactoryCore {
|
|
22
|
+
get snapshotPrefetchResultCache() {
|
|
23
|
+
return this.nonPersistentCache.snapshotPrefetchResultCache;
|
|
24
|
+
}
|
|
25
|
+
get IRelaySessionAwareDriverFactory() {
|
|
26
|
+
return this;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* This function would return info about relay service session only if this factory established (or attempted to
|
|
30
|
+
* establish) connection very recently. Otherwise, it will return undefined.
|
|
31
|
+
* @param resolvedUrl - resolved url for container
|
|
32
|
+
* @returns The current join session response stored in cache. `undefined` if not present.
|
|
33
|
+
*/
|
|
34
|
+
async getRelayServiceSessionInfo(resolvedUrl) {
|
|
35
|
+
const odspResolvedUrl = getOdspResolvedUrl(resolvedUrl);
|
|
36
|
+
const joinSessionResponse = await this.nonPersistentCache.sessionJoinCache.get(getJoinSessionCacheKey(odspResolvedUrl));
|
|
37
|
+
return joinSessionResponse?.joinSessionResponse;
|
|
38
|
+
}
|
|
39
|
+
async createContainer(createNewSummary, createNewResolvedUrl, logger, clientIsSummarizer) {
|
|
40
|
+
let odspResolvedUrl = getOdspResolvedUrl(createNewResolvedUrl);
|
|
41
|
+
const resolvedUrlData = {
|
|
42
|
+
siteUrl: odspResolvedUrl.siteUrl,
|
|
43
|
+
driveId: odspResolvedUrl.driveId,
|
|
44
|
+
itemId: odspResolvedUrl.itemId,
|
|
45
|
+
};
|
|
46
|
+
let fileInfo;
|
|
47
|
+
let createShareLinkParam;
|
|
48
|
+
if (odspResolvedUrl.itemId) {
|
|
49
|
+
fileInfo = {
|
|
50
|
+
type: "Existing",
|
|
51
|
+
driveId: odspResolvedUrl.driveId,
|
|
52
|
+
siteUrl: odspResolvedUrl.siteUrl,
|
|
53
|
+
itemId: odspResolvedUrl.itemId,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
else if (odspResolvedUrl.fileName) {
|
|
57
|
+
const [, queryString] = odspResolvedUrl.url.split("?");
|
|
58
|
+
const searchParams = new URLSearchParams(queryString);
|
|
59
|
+
const filePath = searchParams.get("path");
|
|
60
|
+
if (filePath === undefined || filePath === null) {
|
|
61
|
+
throw new Error("File path should be provided!!");
|
|
62
|
+
}
|
|
63
|
+
createShareLinkParam = getSharingLinkParams(this.hostPolicy, searchParams);
|
|
64
|
+
fileInfo = {
|
|
65
|
+
type: "New",
|
|
66
|
+
driveId: odspResolvedUrl.driveId,
|
|
67
|
+
siteUrl: odspResolvedUrl.siteUrl,
|
|
68
|
+
filePath,
|
|
69
|
+
filename: odspResolvedUrl.fileName,
|
|
70
|
+
createLinkType: createShareLinkParam,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
throw new Error("A new or existing file must be specified to create container!");
|
|
75
|
+
}
|
|
76
|
+
if (isCombinedAppAndProtocolSummary(createNewSummary)) {
|
|
77
|
+
const documentAttributes = getDocAttributesFromProtocolSummary(createNewSummary.tree[".protocol"]);
|
|
78
|
+
if (documentAttributes?.sequenceNumber !== 0) {
|
|
79
|
+
throw new Error("Seq number in detached ODSP container should be 0");
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
const odspLogger = createOdspLogger(logger);
|
|
83
|
+
const fileEntry = {
|
|
84
|
+
resolvedUrl: odspResolvedUrl,
|
|
85
|
+
docId: odspResolvedUrl.hashedDocumentId,
|
|
86
|
+
};
|
|
87
|
+
const cacheAndTracker = createOdspCacheAndTracker(this.persistedCache, this.nonPersistentCache, fileEntry, odspLogger, clientIsSummarizer);
|
|
88
|
+
return PerformanceEvent.timedExecAsync(odspLogger, {
|
|
89
|
+
eventName: "CreateNew",
|
|
90
|
+
isWithSummaryUpload: true,
|
|
91
|
+
createShareLinkParam: createShareLinkParam
|
|
92
|
+
? JSON.stringify(createShareLinkParam)
|
|
93
|
+
: undefined,
|
|
94
|
+
enableShareLinkWithCreate: this.hostPolicy.enableShareLinkWithCreate,
|
|
95
|
+
enableSingleRequestForShareLinkWithCreate: this.hostPolicy.enableSingleRequestForShareLinkWithCreate,
|
|
96
|
+
}, async (event) => {
|
|
97
|
+
const getStorageToken = toInstrumentedOdspTokenFetcher(odspLogger, resolvedUrlData, this.getStorageToken, true /* throwOnNullToken */);
|
|
98
|
+
// We can delay load this module as this path will not be executed in load flows and create flow
|
|
99
|
+
// while only happens once in lifetime of a document happens in the background after creation of
|
|
100
|
+
// detached container.
|
|
101
|
+
const module = await import("./createNewModule.mjs").then((m) => {
|
|
102
|
+
odspLogger.sendTelemetryEvent({ eventName: "createNewModuleLoaded" });
|
|
103
|
+
return m;
|
|
104
|
+
})
|
|
105
|
+
.catch((error) => {
|
|
106
|
+
odspLogger.sendErrorEvent({ eventName: "createNewModuleLoadFailed" }, error);
|
|
107
|
+
throw error;
|
|
108
|
+
});
|
|
109
|
+
odspResolvedUrl = isNewFileInfo(fileInfo)
|
|
110
|
+
? await module.createNewFluidFile(getStorageToken, fileInfo, odspLogger, createNewSummary, cacheAndTracker.epochTracker, fileEntry, this.hostPolicy.cacheCreateNewSummary ?? true, !!this.hostPolicy.sessionOptions
|
|
111
|
+
?.forceAccessTokenViaAuthorizationHeader, odspResolvedUrl.isClpCompliantApp, this.hostPolicy.enableSingleRequestForShareLinkWithCreate, this.hostPolicy.enableShareLinkWithCreate)
|
|
112
|
+
: await module.createNewContainerOnExistingFile(getStorageToken, fileInfo, odspLogger, createNewSummary, cacheAndTracker.epochTracker, fileEntry, this.hostPolicy.cacheCreateNewSummary ?? true, !!this.hostPolicy.sessionOptions
|
|
113
|
+
?.forceAccessTokenViaAuthorizationHeader, odspResolvedUrl.isClpCompliantApp);
|
|
114
|
+
const docService = this.createDocumentServiceCore(odspResolvedUrl, odspLogger, cacheAndTracker, clientIsSummarizer);
|
|
115
|
+
event.end({
|
|
116
|
+
docId: odspResolvedUrl.hashedDocumentId,
|
|
117
|
+
});
|
|
118
|
+
return docService;
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* @param getStorageToken - function that can provide the storage token for a given site. This is
|
|
123
|
+
* is also referred to as the "Vroom" token in SPO.
|
|
124
|
+
* @param getWebsocketToken - function that can provide a token for accessing the web socket. This is also
|
|
125
|
+
* to as the "Push" token in SPO. If undefined then websocket token is expected to be returned with joinSession
|
|
126
|
+
* response payload.
|
|
127
|
+
* @param persistedCache - PersistedCache provided by host for use in this session.
|
|
128
|
+
* @param hostPolicy - Policy for storage provided by host.
|
|
129
|
+
*/
|
|
130
|
+
constructor(getStorageToken, getWebsocketToken, persistedCache = new LocalPersistentCache(), hostPolicy = {}) {
|
|
131
|
+
this.getStorageToken = getStorageToken;
|
|
132
|
+
this.getWebsocketToken = getWebsocketToken;
|
|
133
|
+
this.persistedCache = persistedCache;
|
|
134
|
+
this.hostPolicy = hostPolicy;
|
|
135
|
+
this.nonPersistentCache = new NonPersistentCache();
|
|
136
|
+
if (this.hostPolicy.isolateSocketCache === true) {
|
|
137
|
+
// create the key to separate the socket reuse cache
|
|
138
|
+
this.socketReferenceKeyPrefix = uuid();
|
|
139
|
+
}
|
|
140
|
+
// Set enableRedeemFallback by default as true.
|
|
141
|
+
this.hostPolicy.enableRedeemFallback = this.hostPolicy.enableRedeemFallback ?? true;
|
|
142
|
+
this.hostPolicy.sessionOptions = {
|
|
143
|
+
forceAccessTokenViaAuthorizationHeader: true,
|
|
144
|
+
...this.hostPolicy.sessionOptions,
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
async createDocumentService(resolvedUrl, logger, clientIsSummarizer) {
|
|
148
|
+
return this.createDocumentServiceCore(resolvedUrl, createOdspLogger(logger), undefined, clientIsSummarizer);
|
|
149
|
+
}
|
|
150
|
+
async createDocumentServiceCore(resolvedUrl, odspLogger, cacheAndTrackerArg, clientIsSummarizer) {
|
|
151
|
+
const odspResolvedUrl = getOdspResolvedUrl(resolvedUrl);
|
|
152
|
+
const resolvedUrlData = {
|
|
153
|
+
siteUrl: odspResolvedUrl.siteUrl,
|
|
154
|
+
driveId: odspResolvedUrl.driveId,
|
|
155
|
+
itemId: odspResolvedUrl.itemId,
|
|
156
|
+
};
|
|
157
|
+
const cacheAndTracker = cacheAndTrackerArg ??
|
|
158
|
+
createOdspCacheAndTracker(this.persistedCache, this.nonPersistentCache, { resolvedUrl: odspResolvedUrl, docId: odspResolvedUrl.hashedDocumentId }, odspLogger, clientIsSummarizer);
|
|
159
|
+
const storageTokenFetcher = toInstrumentedOdspTokenFetcher(odspLogger, resolvedUrlData, this.getStorageToken, true /* throwOnNullToken */);
|
|
160
|
+
const webSocketTokenFetcher = this.getWebsocketToken === undefined
|
|
161
|
+
? undefined
|
|
162
|
+
: async (options) => toInstrumentedOdspTokenFetcher(odspLogger, resolvedUrlData, this.getWebsocketToken, false /* throwOnNullToken */)(options, "GetWebsocketToken");
|
|
163
|
+
return OdspDocumentService.create(resolvedUrl, storageTokenFetcher, webSocketTokenFetcher, odspLogger, cacheAndTracker.cache, this.hostPolicy, cacheAndTracker.epochTracker, this.socketReferenceKeyPrefix, clientIsSummarizer);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Extract the sharing link kind from the resolved URL's query paramerters
|
|
168
|
+
*/
|
|
169
|
+
function getSharingLinkParams(hostPolicy, searchParams) {
|
|
170
|
+
// extract request parameters for creation of sharing link (if provided) if the feature is enabled
|
|
171
|
+
let createShareLinkParam;
|
|
172
|
+
if (hostPolicy.enableSingleRequestForShareLinkWithCreate) {
|
|
173
|
+
const createLinkScope = searchParams.get("createLinkScope");
|
|
174
|
+
const createLinkRole = searchParams.get("createLinkRole");
|
|
175
|
+
if (createLinkScope && SharingLinkScope[createLinkScope]) {
|
|
176
|
+
createShareLinkParam = {
|
|
177
|
+
scope: SharingLinkScope[createLinkScope],
|
|
178
|
+
...(createLinkRole && SharingLinkRole[createLinkRole]
|
|
179
|
+
? { role: SharingLinkRole[createLinkRole] }
|
|
180
|
+
: {}),
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
else if (hostPolicy.enableShareLinkWithCreate) {
|
|
185
|
+
const createLinkType = searchParams.get("createLinkType");
|
|
186
|
+
if (createLinkType && ShareLinkTypes[createLinkType]) {
|
|
187
|
+
createShareLinkParam = ShareLinkTypes[createLinkType || ""];
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
return createShareLinkParam;
|
|
191
|
+
}
|
|
192
|
+
//# sourceMappingURL=odspDocumentServiceFactoryCore.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"odspDocumentServiceFactoryCore.mjs","sourceRoot":"","sources":["../src/odspDocumentServiceFactoryCore.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAUI,EAAE,gBAAgB,EAAE,MAAM,iCAAiC;OAC3D,EACN,mCAAmC,EACnC,+BAA+B,GAC/B,MAAM,8BAA8B;OAC9B,EAQN,gBAAgB,EAChB,eAAe,EACf,cAAc,GAId,MAAM,yCAAyC;OACzC,EAAE,EAAE,IAAI,IAAI,EAAE,MAAM,MAAM;OAC1B,EAGN,oBAAoB,EACpB,kBAAkB,GAClB;OACM,EAAE,yBAAyB,EAAoB;OAC/C,EAAE,mBAAmB,EAAE;OACvB,EAEN,kB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B,CAAC;IACH,CAAC;CACD;AAED;;GAEG;AACH,SAAS,oBAAoB,CAC5B,UAA6B,EAC7B,YAA6B;IAE7B,kGAAkG;IAClG,IAAI,oBAAmE,CAAC;IACxE,IAAI,UAAU,CAAC,yCAAyC,EAAE;QACzD,MAAM,eAAe,GAAG,YAAY,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC5D,MAAM,cAAc,GAAG,YAAY,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;QAC1D,IAAI,eAAe,IAAI,gBAAgB,CAAC,eAAe,CAAC,EAAE;YACzD,oBAAoB,GAAG;gBACtB,KAAK,EAAE,gBAAgB,CAAC,eAAe,CAAC;gBACxC,GAAG,CAAC,cAAc,IAAI,eAAe,CAAC,cAAc,CAAC;oBACpD,CAAC,CAAC,EAAE,IAAI,EAAE,eAAe,CAAC,cAAc,CAAC,EAAE;oBAC3C,CAAC,CAAC,EAAE,CAAC;aACN,CAAC;SACF;KACD;SAAM,IAAI,UAAU,CAAC,yBAAyB,EAAE;QAChD,MAAM,cAAc,GAAG,YAAY,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;QAC1D,IAAI,cAAc,IAAI,cAAc,CAAC,cAAc,CAAC,EAAE;YACrD,oBAAoB,GAAG,cAAc,CAAC,cAAc,IAAI,EAAE,CAAC,CAAC;SAC5D;KACD;IACD,OAAO,oBAAoB,CAAC;AAC7B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryBaseLogger, ITelemetryLogger } from \"@fluidframework/core-interfaces\";\nimport { PromiseCache } from \"@fluidframework/core-utils\";\nimport {\n\tIDocumentService,\n\tIDocumentServiceFactory,\n\tIResolvedUrl,\n} from \"@fluidframework/driver-definitions\";\nimport { ISummaryTree } from \"@fluidframework/protocol-definitions\";\nimport { PerformanceEvent } from \"@fluidframework/telemetry-utils\";\nimport {\n\tgetDocAttributesFromProtocolSummary,\n\tisCombinedAppAndProtocolSummary,\n} from \"@fluidframework/driver-utils\";\nimport {\n\tTokenFetchOptions,\n\tOdspResourceTokenFetchOptions,\n\tTokenFetcher,\n\tIPersistedCache,\n\tHostStoragePolicy,\n\tIFileEntry,\n\tIOdspUrlParts,\n\tSharingLinkScope,\n\tSharingLinkRole,\n\tShareLinkTypes,\n\tISharingLinkKind,\n\tISocketStorageDiscovery,\n\tIRelaySessionAwareDriverFactory,\n} from \"@fluidframework/odsp-driver-definitions\";\nimport { v4 as uuid } from \"uuid\";\nimport {\n\tINonPersistentCache,\n\tIPrefetchSnapshotContents,\n\tLocalPersistentCache,\n\tNonPersistentCache,\n} from \"./odspCache\";\nimport { createOdspCacheAndTracker, ICacheAndTracker } from \"./epochTracker\";\nimport { OdspDocumentService } from \"./odspDocumentService\";\nimport {\n\tINewFileInfo,\n\tgetOdspResolvedUrl,\n\tcreateOdspLogger,\n\ttoInstrumentedOdspTokenFetcher,\n\tIExistingFileInfo,\n\tisNewFileInfo,\n\tgetJoinSessionCacheKey,\n} from \"./odspUtils\";\n\n/**\n * Factory for creating the sharepoint document service. Use this if you want to\n * use the sharepoint implementation.\n *\n * This constructor should be used by environments that support dynamic imports and that wish\n * to leverage code splitting as a means to keep bundles as small as possible.\n * @alpha\n */\nexport class OdspDocumentServiceFactoryCore\n\timplements IDocumentServiceFactory, IRelaySessionAwareDriverFactory\n{\n\tprivate readonly nonPersistentCache: INonPersistentCache = new NonPersistentCache();\n\tprivate readonly socketReferenceKeyPrefix?: string;\n\n\tpublic get snapshotPrefetchResultCache(): PromiseCache<string, IPrefetchSnapshotContents> {\n\t\treturn this.nonPersistentCache.snapshotPrefetchResultCache;\n\t}\n\n\tpublic get IRelaySessionAwareDriverFactory() {\n\t\treturn this;\n\t}\n\n\t/**\n\t * This function would return info about relay service session only if this factory established (or attempted to\n\t * establish) connection very recently. Otherwise, it will return undefined.\n\t * @param resolvedUrl - resolved url for container\n\t * @returns The current join session response stored in cache. `undefined` if not present.\n\t */\n\tpublic async getRelayServiceSessionInfo(\n\t\tresolvedUrl: IResolvedUrl,\n\t): Promise<ISocketStorageDiscovery | undefined> {\n\t\tconst odspResolvedUrl = getOdspResolvedUrl(resolvedUrl);\n\t\tconst joinSessionResponse = await this.nonPersistentCache.sessionJoinCache.get(\n\t\t\tgetJoinSessionCacheKey(odspResolvedUrl),\n\t\t);\n\t\treturn joinSessionResponse?.joinSessionResponse;\n\t}\n\n\tpublic async createContainer(\n\t\tcreateNewSummary: ISummaryTree | undefined,\n\t\tcreateNewResolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\tlet odspResolvedUrl = getOdspResolvedUrl(createNewResolvedUrl);\n\t\tconst resolvedUrlData: IOdspUrlParts = {\n\t\t\tsiteUrl: odspResolvedUrl.siteUrl,\n\t\t\tdriveId: odspResolvedUrl.driveId,\n\t\t\titemId: odspResolvedUrl.itemId,\n\t\t};\n\n\t\tlet fileInfo: INewFileInfo | IExistingFileInfo;\n\t\tlet createShareLinkParam: ShareLinkTypes | ISharingLinkKind | undefined;\n\t\tif (odspResolvedUrl.itemId) {\n\t\t\tfileInfo = {\n\t\t\t\ttype: \"Existing\",\n\t\t\t\tdriveId: odspResolvedUrl.driveId,\n\t\t\t\tsiteUrl: odspResolvedUrl.siteUrl,\n\t\t\t\titemId: odspResolvedUrl.itemId,\n\t\t\t};\n\t\t} else if (odspResolvedUrl.fileName) {\n\t\t\tconst [, queryString] = odspResolvedUrl.url.split(\"?\");\n\t\t\tconst searchParams = new URLSearchParams(queryString);\n\t\t\tconst filePath = searchParams.get(\"path\");\n\t\t\tif (filePath === undefined || filePath === null) {\n\t\t\t\tthrow new Error(\"File path should be provided!!\");\n\t\t\t}\n\t\t\tcreateShareLinkParam = getSharingLinkParams(this.hostPolicy, searchParams);\n\t\t\tfileInfo = {\n\t\t\t\ttype: \"New\",\n\t\t\t\tdriveId: odspResolvedUrl.driveId,\n\t\t\t\tsiteUrl: odspResolvedUrl.siteUrl,\n\t\t\t\tfilePath,\n\t\t\t\tfilename: odspResolvedUrl.fileName,\n\t\t\t\tcreateLinkType: createShareLinkParam,\n\t\t\t};\n\t\t} else {\n\t\t\tthrow new Error(\"A new or existing file must be specified to create container!\");\n\t\t}\n\n\t\tif (isCombinedAppAndProtocolSummary(createNewSummary)) {\n\t\t\tconst documentAttributes = getDocAttributesFromProtocolSummary(\n\t\t\t\tcreateNewSummary.tree[\".protocol\"],\n\t\t\t);\n\t\t\tif (documentAttributes?.sequenceNumber !== 0) {\n\t\t\t\tthrow new Error(\"Seq number in detached ODSP container should be 0\");\n\t\t\t}\n\t\t}\n\n\t\tconst odspLogger = createOdspLogger(logger);\n\n\t\tconst fileEntry: IFileEntry = {\n\t\t\tresolvedUrl: odspResolvedUrl,\n\t\t\tdocId: odspResolvedUrl.hashedDocumentId,\n\t\t};\n\t\tconst cacheAndTracker = createOdspCacheAndTracker(\n\t\t\tthis.persistedCache,\n\t\t\tthis.nonPersistentCache,\n\t\t\tfileEntry,\n\t\t\todspLogger,\n\t\t\tclientIsSummarizer,\n\t\t);\n\n\t\treturn PerformanceEvent.timedExecAsync(\n\t\t\todspLogger,\n\t\t\t{\n\t\t\t\teventName: \"CreateNew\",\n\t\t\t\tisWithSummaryUpload: true,\n\t\t\t\tcreateShareLinkParam: createShareLinkParam\n\t\t\t\t\t? JSON.stringify(createShareLinkParam)\n\t\t\t\t\t: undefined,\n\t\t\t\tenableShareLinkWithCreate: this.hostPolicy.enableShareLinkWithCreate,\n\t\t\t\tenableSingleRequestForShareLinkWithCreate:\n\t\t\t\t\tthis.hostPolicy.enableSingleRequestForShareLinkWithCreate,\n\t\t\t},\n\t\t\tasync (event) => {\n\t\t\t\tconst getStorageToken = toInstrumentedOdspTokenFetcher(\n\t\t\t\t\todspLogger,\n\t\t\t\t\tresolvedUrlData,\n\t\t\t\t\tthis.getStorageToken,\n\t\t\t\t\ttrue /* throwOnNullToken */,\n\t\t\t\t);\n\t\t\t\t// We can delay load this module as this path will not be executed in load flows and create flow\n\t\t\t\t// while only happens once in lifetime of a document happens in the background after creation of\n\t\t\t\t// detached container.\n\t\t\t\tconst module = await import(\n\t\t\t\t\t/* webpackChunkName: \"createNewModule\" */ \"./createNewModule.js\"\n\t\t\t\t)\n\t\t\t\t\t.then((m) => {\n\t\t\t\t\t\todspLogger.sendTelemetryEvent({ eventName: \"createNewModuleLoaded\" });\n\t\t\t\t\t\treturn m;\n\t\t\t\t\t})\n\t\t\t\t\t.catch((error) => {\n\t\t\t\t\t\todspLogger.sendErrorEvent(\n\t\t\t\t\t\t\t{ eventName: \"createNewModuleLoadFailed\" },\n\t\t\t\t\t\t\terror,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tthrow error;\n\t\t\t\t\t});\n\t\t\t\todspResolvedUrl = isNewFileInfo(fileInfo)\n\t\t\t\t\t? await module.createNewFluidFile(\n\t\t\t\t\t\t\tgetStorageToken,\n\t\t\t\t\t\t\tfileInfo,\n\t\t\t\t\t\t\todspLogger,\n\t\t\t\t\t\t\tcreateNewSummary,\n\t\t\t\t\t\t\tcacheAndTracker.epochTracker,\n\t\t\t\t\t\t\tfileEntry,\n\t\t\t\t\t\t\tthis.hostPolicy.cacheCreateNewSummary ?? true,\n\t\t\t\t\t\t\t!!this.hostPolicy.sessionOptions\n\t\t\t\t\t\t\t\t?.forceAccessTokenViaAuthorizationHeader,\n\t\t\t\t\t\t\todspResolvedUrl.isClpCompliantApp,\n\t\t\t\t\t\t\tthis.hostPolicy.enableSingleRequestForShareLinkWithCreate,\n\t\t\t\t\t\t\tthis.hostPolicy.enableShareLinkWithCreate,\n\t\t\t\t\t )\n\t\t\t\t\t: await module.createNewContainerOnExistingFile(\n\t\t\t\t\t\t\tgetStorageToken,\n\t\t\t\t\t\t\tfileInfo,\n\t\t\t\t\t\t\todspLogger,\n\t\t\t\t\t\t\tcreateNewSummary,\n\t\t\t\t\t\t\tcacheAndTracker.epochTracker,\n\t\t\t\t\t\t\tfileEntry,\n\t\t\t\t\t\t\tthis.hostPolicy.cacheCreateNewSummary ?? true,\n\t\t\t\t\t\t\t!!this.hostPolicy.sessionOptions\n\t\t\t\t\t\t\t\t?.forceAccessTokenViaAuthorizationHeader,\n\t\t\t\t\t\t\todspResolvedUrl.isClpCompliantApp,\n\t\t\t\t\t );\n\t\t\t\tconst docService = this.createDocumentServiceCore(\n\t\t\t\t\todspResolvedUrl,\n\t\t\t\t\todspLogger,\n\t\t\t\t\tcacheAndTracker,\n\t\t\t\t\tclientIsSummarizer,\n\t\t\t\t);\n\t\t\t\tevent.end({\n\t\t\t\t\tdocId: odspResolvedUrl.hashedDocumentId,\n\t\t\t\t});\n\t\t\t\treturn docService;\n\t\t\t},\n\t\t);\n\t}\n\n\t/**\n\t * @param getStorageToken - function that can provide the storage token for a given site. This is\n\t * is also referred to as the \"Vroom\" token in SPO.\n\t * @param getWebsocketToken - function that can provide a token for accessing the web socket. This is also\n\t * to as the \"Push\" token in SPO. If undefined then websocket token is expected to be returned with joinSession\n\t * response payload.\n\t * @param persistedCache - PersistedCache provided by host for use in this session.\n\t * @param hostPolicy - Policy for storage provided by host.\n\t */\n\tconstructor(\n\t\tprivate readonly getStorageToken: TokenFetcher<OdspResourceTokenFetchOptions>,\n\t\tprivate readonly getWebsocketToken: TokenFetcher<OdspResourceTokenFetchOptions> | undefined,\n\t\tprotected persistedCache: IPersistedCache = new LocalPersistentCache(),\n\t\tprivate readonly hostPolicy: HostStoragePolicy = {},\n\t) {\n\t\tif (this.hostPolicy.isolateSocketCache === true) {\n\t\t\t// create the key to separate the socket reuse cache\n\t\t\tthis.socketReferenceKeyPrefix = uuid();\n\t\t}\n\t\t// Set enableRedeemFallback by default as true.\n\t\tthis.hostPolicy.enableRedeemFallback = this.hostPolicy.enableRedeemFallback ?? true;\n\t\tthis.hostPolicy.sessionOptions = {\n\t\t\tforceAccessTokenViaAuthorizationHeader: true,\n\t\t\t...this.hostPolicy.sessionOptions,\n\t\t};\n\t}\n\n\tpublic async createDocumentService(\n\t\tresolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\treturn this.createDocumentServiceCore(\n\t\t\tresolvedUrl,\n\t\t\tcreateOdspLogger(logger),\n\t\t\tundefined,\n\t\t\tclientIsSummarizer,\n\t\t);\n\t}\n\n\tprotected async createDocumentServiceCore(\n\t\tresolvedUrl: IResolvedUrl,\n\t\todspLogger: ITelemetryLogger,\n\t\tcacheAndTrackerArg?: ICacheAndTracker,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\tconst odspResolvedUrl = getOdspResolvedUrl(resolvedUrl);\n\t\tconst resolvedUrlData: IOdspUrlParts = {\n\t\t\tsiteUrl: odspResolvedUrl.siteUrl,\n\t\t\tdriveId: odspResolvedUrl.driveId,\n\t\t\titemId: odspResolvedUrl.itemId,\n\t\t};\n\t\tconst cacheAndTracker =\n\t\t\tcacheAndTrackerArg ??\n\t\t\tcreateOdspCacheAndTracker(\n\t\t\t\tthis.persistedCache,\n\t\t\t\tthis.nonPersistentCache,\n\t\t\t\t{ resolvedUrl: odspResolvedUrl, docId: odspResolvedUrl.hashedDocumentId },\n\t\t\t\todspLogger,\n\t\t\t\tclientIsSummarizer,\n\t\t\t);\n\n\t\tconst storageTokenFetcher = toInstrumentedOdspTokenFetcher(\n\t\t\todspLogger,\n\t\t\tresolvedUrlData,\n\t\t\tthis.getStorageToken,\n\t\t\ttrue /* throwOnNullToken */,\n\t\t);\n\n\t\tconst webSocketTokenFetcher =\n\t\t\tthis.getWebsocketToken === undefined\n\t\t\t\t? undefined\n\t\t\t\t: async (options: TokenFetchOptions) =>\n\t\t\t\t\t\ttoInstrumentedOdspTokenFetcher(\n\t\t\t\t\t\t\todspLogger,\n\t\t\t\t\t\t\tresolvedUrlData,\n\t\t\t\t\t\t\tthis.getWebsocketToken!,\n\t\t\t\t\t\t\tfalse /* throwOnNullToken */,\n\t\t\t\t\t\t)(options, \"GetWebsocketToken\");\n\n\t\treturn OdspDocumentService.create(\n\t\t\tresolvedUrl,\n\t\t\tstorageTokenFetcher,\n\t\t\twebSocketTokenFetcher,\n\t\t\todspLogger,\n\t\t\tcacheAndTracker.cache,\n\t\t\tthis.hostPolicy,\n\t\t\tcacheAndTracker.epochTracker,\n\t\t\tthis.socketReferenceKeyPrefix,\n\t\t\tclientIsSummarizer,\n\t\t);\n\t}\n}\n\n/**\n * Extract the sharing link kind from the resolved URL's query paramerters\n */\nfunction getSharingLinkParams(\n\thostPolicy: HostStoragePolicy,\n\tsearchParams: URLSearchParams,\n): ShareLinkTypes | ISharingLinkKind | undefined {\n\t// extract request parameters for creation of sharing link (if provided) if the feature is enabled\n\tlet createShareLinkParam: ShareLinkTypes | ISharingLinkKind | undefined;\n\tif (hostPolicy.enableSingleRequestForShareLinkWithCreate) {\n\t\tconst createLinkScope = searchParams.get(\"createLinkScope\");\n\t\tconst createLinkRole = searchParams.get(\"createLinkRole\");\n\t\tif (createLinkScope && SharingLinkScope[createLinkScope]) {\n\t\t\tcreateShareLinkParam = {\n\t\t\t\tscope: SharingLinkScope[createLinkScope],\n\t\t\t\t...(createLinkRole && SharingLinkRole[createLinkRole]\n\t\t\t\t\t? { role: SharingLinkRole[createLinkRole] }\n\t\t\t\t\t: {}),\n\t\t\t};\n\t\t}\n\t} else if (hostPolicy.enableShareLinkWithCreate) {\n\t\tconst createLinkType = searchParams.get(\"createLinkType\");\n\t\tif (createLinkType && ShareLinkTypes[createLinkType]) {\n\t\t\tcreateShareLinkParam = ShareLinkTypes[createLinkType || \"\"];\n\t\t}\n\t}\n\treturn createShareLinkParam;\n}\n"]}
|
|
@@ -4,8 +4,13 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { IDocumentServiceFactory } from "@fluidframework/driver-definitions";
|
|
6
6
|
import { OdspResourceTokenFetchOptions, TokenFetcher, IPersistedCache, HostStoragePolicy } from "@fluidframework/odsp-driver-definitions";
|
|
7
|
-
import { OdspDocumentServiceFactoryCore } from "./odspDocumentServiceFactoryCore";
|
|
7
|
+
import { OdspDocumentServiceFactoryCore } from "./odspDocumentServiceFactoryCore.mjs";
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated This is deprecated in favour of OdspDocumentServiceFactory as the socket io is now loaded inside the
|
|
10
|
+
* other dynamically imported module.
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
8
13
|
export declare class OdspDocumentServiceFactoryWithCodeSplit extends OdspDocumentServiceFactoryCore implements IDocumentServiceFactory {
|
|
9
14
|
constructor(getStorageToken: TokenFetcher<OdspResourceTokenFetchOptions>, getWebsocketToken: TokenFetcher<OdspResourceTokenFetchOptions> | undefined, persistedCache?: IPersistedCache, hostPolicy?: HostStoragePolicy);
|
|
10
15
|
}
|
|
11
|
-
//# sourceMappingURL=odspDocumentServiceFactoryWithCodeSplit.d.
|
|
16
|
+
//# sourceMappingURL=odspDocumentServiceFactoryWithCodeSplit.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"odspDocumentServiceFactoryWithCodeSplit.d.mts","sourceRoot":"","sources":["../src/odspDocumentServiceFactoryWithCodeSplit.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,uBAAuB,EAAE,MAAM,oCAAoC;OACrE,EACN,6BAA6B,EAC7B,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,MAAM,yCAAyC;OACzC,EAAE,8BAA8B,EAAE;AAEzC;;;;GAIG;AACH,qBAAa,uCACZ,SAAQ,8BACR,YAAW,uBAAuB;gBAGjC,eAAe,EAAE,YAAY,CAAC,6BAA6B,CAAC,EAC5D,iBAAiB,EAAE,YAAY,CAAC,6BAA6B,CAAC,GAAG,SAAS,EAC1E,cAAc,CAAC,EAAE,eAAe,EAChC,UAAU,CAAC,EAAE,iBAAiB;CAI/B"}
|
|
@@ -2,10 +2,15 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { OdspDocumentServiceFactoryCore } from "./odspDocumentServiceFactoryCore";
|
|
5
|
+
import { OdspDocumentServiceFactoryCore } from "./odspDocumentServiceFactoryCore.mjs";
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated This is deprecated in favour of OdspDocumentServiceFactory as the socket io is now loaded inside the
|
|
8
|
+
* other dynamically imported module.
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
6
11
|
export class OdspDocumentServiceFactoryWithCodeSplit extends OdspDocumentServiceFactoryCore {
|
|
7
12
|
constructor(getStorageToken, getWebsocketToken, persistedCache, hostPolicy) {
|
|
8
|
-
super(getStorageToken, getWebsocketToken,
|
|
13
|
+
super(getStorageToken, getWebsocketToken, persistedCache, hostPolicy);
|
|
9
14
|
}
|
|
10
15
|
}
|
|
11
|
-
//# sourceMappingURL=odspDocumentServiceFactoryWithCodeSplit.
|
|
16
|
+
//# sourceMappingURL=odspDocumentServiceFactoryWithCodeSplit.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"odspDocumentServiceFactoryWithCodeSplit.mjs","sourceRoot":"","sources":["../src/odspDocumentServiceFactoryWithCodeSplit.ts"],"names":[],"mappings":"AAAA;;;GAGG;OASI,EAAE,8BAA8B,EAAE;AAEzC;;;;GAIG;AACH,MAAM,OAAO,uCACZ,SAAQ,8BAA8B;IAGtC,YACC,eAA4D,EAC5D,iBAA0E,EAC1E,cAAgC,EAChC,UAA8B;QAE9B,KAAK,CAAC,eAAe,EAAE,iBAAiB,EAAE,cAAc,EAAE,UAAU,CAAC,CAAC;IACvE,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IDocumentServiceFactory } from \"@fluidframework/driver-definitions\";\nimport {\n\tOdspResourceTokenFetchOptions,\n\tTokenFetcher,\n\tIPersistedCache,\n\tHostStoragePolicy,\n} from \"@fluidframework/odsp-driver-definitions\";\nimport { OdspDocumentServiceFactoryCore } from \"./odspDocumentServiceFactoryCore\";\n\n/**\n * @deprecated This is deprecated in favour of OdspDocumentServiceFactory as the socket io is now loaded inside the\n * other dynamically imported module.\n * @internal\n */\nexport class OdspDocumentServiceFactoryWithCodeSplit\n\textends OdspDocumentServiceFactoryCore\n\timplements IDocumentServiceFactory\n{\n\tconstructor(\n\t\tgetStorageToken: TokenFetcher<OdspResourceTokenFetchOptions>,\n\t\tgetWebsocketToken: TokenFetcher<OdspResourceTokenFetchOptions> | undefined,\n\t\tpersistedCache?: IPersistedCache,\n\t\thostPolicy?: HostStoragePolicy,\n\t) {\n\t\tsuper(getStorageToken, getWebsocketToken, persistedCache, hostPolicy);\n\t}\n}\n"]}
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
|
|
6
6
|
import * as api from "@fluidframework/protocol-definitions";
|
|
7
|
-
import { ISummaryContext } from "@fluidframework/driver-definitions";
|
|
7
|
+
import { ISummaryContext, FetchSource } from "@fluidframework/driver-definitions";
|
|
8
8
|
import { IOdspResolvedUrl, InstrumentedStorageTokenFetcher } from "@fluidframework/odsp-driver-definitions";
|
|
9
|
-
import { HostStoragePolicyInternal } from "./contracts";
|
|
10
|
-
import { SnapshotFormatSupportType } from "./fetchSnapshot";
|
|
11
|
-
import { IOdspCache } from "./odspCache";
|
|
12
|
-
import { EpochTracker } from "./epochTracker";
|
|
13
|
-
import { FlushResult } from "./odspDocumentDeltaConnection";
|
|
14
|
-
import { OdspDocumentStorageServiceBase } from "./odspDocumentStorageServiceBase";
|
|
9
|
+
import { HostStoragePolicyInternal } from "./contracts.mjs";
|
|
10
|
+
import { SnapshotFormatSupportType } from "./fetchSnapshot.mjs";
|
|
11
|
+
import { IOdspCache } from "./odspCache.mjs";
|
|
12
|
+
import { EpochTracker } from "./epochTracker.mjs";
|
|
13
|
+
import { FlushResult } from "./odspDocumentDeltaConnection.mjs";
|
|
14
|
+
import { OdspDocumentStorageServiceBase } from "./odspDocumentStorageServiceBase.mjs";
|
|
15
15
|
export declare const defaultSummarizerCacheExpiryTimeout: number;
|
|
16
16
|
export declare class OdspDocumentStorageService extends OdspDocumentStorageServiceBase {
|
|
17
17
|
private readonly odspResolvedUrl;
|
|
@@ -22,9 +22,13 @@ export declare class OdspDocumentStorageService extends OdspDocumentStorageServi
|
|
|
22
22
|
private readonly hostPolicy;
|
|
23
23
|
private readonly epochTracker;
|
|
24
24
|
private readonly flushCallback;
|
|
25
|
+
private readonly relayServiceTenantAndSessionId;
|
|
25
26
|
private readonly snapshotFormatFetchType?;
|
|
26
|
-
private
|
|
27
|
+
private odspSummaryModuleLoaded;
|
|
28
|
+
private summaryModuleP;
|
|
29
|
+
private odspSummaryUploadManager;
|
|
27
30
|
private firstVersionCall;
|
|
31
|
+
private _isFirstSnapshotFromNetwork;
|
|
28
32
|
private readonly documentId;
|
|
29
33
|
private readonly snapshotUrl;
|
|
30
34
|
private readonly attachmentPOSTUrl;
|
|
@@ -37,17 +41,19 @@ export declare class OdspDocumentStorageService extends OdspDocumentStorageServi
|
|
|
37
41
|
private readonly maxSnapshotSizeLimit;
|
|
38
42
|
private readonly maxSnapshotFetchTimeout;
|
|
39
43
|
private readonly createBlobRateLimiter;
|
|
40
|
-
constructor(odspResolvedUrl: IOdspResolvedUrl, getStorageToken: InstrumentedStorageTokenFetcher, logger:
|
|
44
|
+
constructor(odspResolvedUrl: IOdspResolvedUrl, getStorageToken: InstrumentedStorageTokenFetcher, logger: ITelemetryLoggerExt, fetchFullSnapshot: boolean, cache: IOdspCache, hostPolicy: HostStoragePolicyInternal, epochTracker: EpochTracker, flushCallback: () => Promise<FlushResult>, relayServiceTenantAndSessionId: () => string | undefined, snapshotFormatFetchType?: SnapshotFormatSupportType | undefined);
|
|
45
|
+
get isFirstSnapshotFromNetwork(): boolean | undefined;
|
|
41
46
|
createBlob(file: ArrayBufferLike): Promise<api.ICreateBlobResponse>;
|
|
42
47
|
protected fetchBlobFromStorage(blobId: string, evicted: boolean): Promise<ArrayBuffer>;
|
|
43
48
|
getSnapshotTree(version?: api.IVersion, scenarioName?: string): Promise<api.ISnapshotTree | null>;
|
|
44
|
-
getVersions(blobid: string | null, count: number, scenarioName?: string): Promise<api.IVersion[]>;
|
|
49
|
+
getVersions(blobid: string | null, count: number, scenarioName?: string, fetchSource?: FetchSource): Promise<api.IVersion[]>;
|
|
45
50
|
private fetchSnapshot;
|
|
46
51
|
private fetchSnapshotCore;
|
|
47
52
|
uploadSummaryWithContext(summary: api.ISummaryTree, context: ISummaryContext): Promise<string>;
|
|
53
|
+
private getDelayLoadedSummaryManager;
|
|
48
54
|
private checkSnapshotUrl;
|
|
49
55
|
private checkAttachmentPOSTUrl;
|
|
50
56
|
private checkAttachmentGETUrl;
|
|
51
57
|
protected fetchTreeFromSnapshot(id: string, scenarioName?: string): Promise<api.ISnapshotTree | undefined>;
|
|
52
58
|
}
|
|
53
|
-
//# sourceMappingURL=odspDocumentStorageManager.d.
|
|
59
|
+
//# sourceMappingURL=odspDocumentStorageManager.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"odspDocumentStorageManager.d.mts","sourceRoot":"","sources":["../src/odspDocumentStorageManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAEN,mBAAmB,EAKnB,MAAM,iCAAiC;OAIjC,KAAK,GAAG,MAAM,sCAAsC;OAEpD,EAAE,eAAe,EAAmB,WAAW,EAAE,MAAM,oCAAoC;OAE3F,EACN,gBAAgB,EAGhB,+BAA+B,EAE/B,MAAM,yCAAyC;OACzC,EAEN,yBAAyB,EAGzB;OACM,EAKN,yBAAyB,EACzB;OAEM,EAAE,UA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