@fluidframework/odsp-driver 1.4.0-121020 → 2.0.0-dev-rc.1.0.0.224419
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-lint.json +4 -0
- package/api-extractor.json +2 -2
- package/api-report/odsp-driver.api.md +310 -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 +497 -0
- package/dist/odsp-driver-beta.d.ts +159 -0
- package/dist/odsp-driver-public.d.ts +159 -0
- package/dist/odsp-driver-untrimmed.d.ts +566 -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 +16 -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.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} +3 -5
- 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} +1 -0
- 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} +3 -4
- 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} +6 -0
- 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} +17 -54
- 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} +15 -0
- 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} +5 -7
- 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} +2 -1
- package/lib/{createOdspUrl.d.ts.map → createOdspUrl.d.mts.map} +1 -1
- package/lib/{createOdspUrl.js → createOdspUrl.mjs} +2 -1
- package/lib/createOdspUrl.mjs.map +1 -0
- package/lib/{epochTracker.d.ts → epochTracker.d.mts} +34 -10
- 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} +1 -1
- package/lib/{fetch.d.ts.map → fetch.d.mts.map} +1 -1
- package/lib/{fetch.js → fetch.mjs} +1 -1
- package/lib/fetch.mjs.map +1 -0
- package/lib/{fetchSnapshot.d.ts → fetchSnapshot.d.mts} +14 -9
- 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} +4 -7
- 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} +0 -4
- 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.map → getUrlAndHeadersWithAuth.d.mts.map} +1 -1
- 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} +3 -2
- 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} +4 -5
- 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} +3 -3
- 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 +497 -0
- package/lib/odsp-driver-beta.d.mts +159 -0
- package/lib/odsp-driver-public.d.mts +159 -0
- package/lib/odsp-driver-untrimmed.d.mts +566 -0
- package/lib/{odspCache.d.ts → odspCache.d.mts} +19 -8
- 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} +9 -7
- 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} +33 -13
- 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} +14 -28
- 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} +5 -1
- 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} +17 -12
- 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} +6 -1
- 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} +17 -11
- 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} +8 -10
- 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} +12 -0
- 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} +6 -4
- 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} +1 -1
- 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} +11 -2
- 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} +6 -0
- 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} +2 -2
- 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} +8 -5
- 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} +5 -0
- 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} +36 -7
- 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} +3 -3
- 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} +1 -1
- package/lib/{packageVersion.d.ts.map → packageVersion.d.mts.map} +1 -1
- package/lib/{packageVersion.js → packageVersion.mjs} +2 -2
- package/lib/packageVersion.mjs.map +1 -0
- package/lib/{prefetchLatestSnapshot.d.ts → prefetchLatestSnapshot.d.mts} +13 -8
- 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} +5 -4
- 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} +2 -2
- 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} +6 -6
- 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} +48 -21
- 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 +89 -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 +325 -202
- 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.js.map +0 -1
- package/lib/epochTracker.d.ts.map +0 -1
- package/lib/epochTracker.js.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.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.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
- /package/lib/{ReadBufferUtils.d.ts → ReadBufferUtils.d.mts} +0 -0
- /package/lib/{getUrlAndHeadersWithAuth.d.ts → getUrlAndHeadersWithAuth.d.mts} +0 -0
|
@@ -2,7 +2,8 @@
|
|
|
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
|
+
import { ReadBuffer } from "./ReadBufferUtils.mjs";
|
|
6
7
|
/**
|
|
7
8
|
* Control codes used by tree serialization / decentralization code. Same as on server. These can be found on
|
|
8
9
|
* filestore code on server too at above link.
|
|
@@ -51,7 +52,7 @@ export declare enum MarkerCodesEnd {
|
|
|
51
52
|
/**
|
|
52
53
|
* This contains mapping of Marker Codes to number of bytes in which the corresponding data
|
|
53
54
|
* will be stored.
|
|
54
|
-
*/
|
|
55
|
+
*/
|
|
55
56
|
export declare const codeToBytesMap: {
|
|
56
57
|
1: number;
|
|
57
58
|
2: number;
|
|
@@ -80,7 +81,7 @@ export declare const codeToBytesMap: {
|
|
|
80
81
|
export declare function getValueSafely(map: {
|
|
81
82
|
[index: number]: number;
|
|
82
83
|
}, key: number): number;
|
|
83
|
-
export declare function
|
|
84
|
+
export declare function getNodeProps(node: NodeCore): Record<string, NodeTypes>;
|
|
84
85
|
export declare function iteratePairs<T>(it: IterableIterator<T>): IterableIterator<[T, T]>;
|
|
85
86
|
/**
|
|
86
87
|
* Helper function that returns iterator from an object
|
|
@@ -95,24 +96,19 @@ export declare function iterate<T>(obj: {
|
|
|
95
96
|
* Note: concrete implementations (derived classes) are not exposed from this module
|
|
96
97
|
*/
|
|
97
98
|
export declare abstract class BlobCore {
|
|
98
|
-
readonly constString: boolean;
|
|
99
|
-
readonly useUtf8Code: boolean;
|
|
100
99
|
abstract get buffer(): Uint8Array;
|
|
101
|
-
get arrayBuffer(): ArrayBufferLike;
|
|
100
|
+
abstract get arrayBuffer(): ArrayBufferLike;
|
|
102
101
|
/**
|
|
103
102
|
* Represents a blob.
|
|
104
|
-
* @param constString - Whether it contains const string declaration.
|
|
105
|
-
* @param useUtf8Code - Represents if the utf8 string marker code should be used when representing.
|
|
106
103
|
*/
|
|
107
|
-
constructor(
|
|
108
|
-
toString(): string;
|
|
104
|
+
constructor();
|
|
109
105
|
}
|
|
110
106
|
/**
|
|
111
107
|
* Shallow copy blob, keeps a reference to portion of ReadBuffer
|
|
112
108
|
* it was constructed from. It takes much less memory compared to BlobDeepCopy
|
|
113
109
|
*/
|
|
114
110
|
export declare class BlobShallowCopy extends BlobCore {
|
|
115
|
-
protected data:
|
|
111
|
+
protected data: Uint8Array;
|
|
116
112
|
protected start: number;
|
|
117
113
|
protected end: number;
|
|
118
114
|
/**
|
|
@@ -120,15 +116,26 @@ export declare class BlobShallowCopy extends BlobCore {
|
|
|
120
116
|
* @param data - Data array of the blob
|
|
121
117
|
* @param start - Start point of the blob in the buffer.
|
|
122
118
|
* @param end - End point of the blob in the buffer.
|
|
123
|
-
* @param constString - Whether it contains const string declaration.
|
|
124
119
|
*/
|
|
125
|
-
constructor(data:
|
|
120
|
+
constructor(data: Uint8Array, start: number, end: number);
|
|
126
121
|
get buffer(): Uint8Array;
|
|
127
|
-
|
|
122
|
+
get arrayBuffer(): ArrayBufferLike;
|
|
123
|
+
static read(buffer: ReadBuffer, lengthLen: number): BlobCore;
|
|
128
124
|
}
|
|
129
|
-
export declare const addStringProperty: (node: NodeCore, a: string, b: string
|
|
125
|
+
export declare const addStringProperty: (node: NodeCore, a: string, b: string) => void;
|
|
126
|
+
export declare const addDictionaryStringProperty: (node: NodeCore, a: string, b: string) => void;
|
|
130
127
|
export declare const addNumberProperty: (node: NodeCore, a: string, b: number) => void;
|
|
131
128
|
export declare const addBoolProperty: (node: NodeCore, a: string, b: boolean) => void;
|
|
129
|
+
export interface IStringElement {
|
|
130
|
+
content: string;
|
|
131
|
+
dictionary: boolean;
|
|
132
|
+
_stringElement: true;
|
|
133
|
+
}
|
|
134
|
+
export interface IStringElementInternal extends Omit<IStringElement, "content"> {
|
|
135
|
+
content?: string;
|
|
136
|
+
startPos: number;
|
|
137
|
+
endPos: number;
|
|
138
|
+
}
|
|
132
139
|
/**
|
|
133
140
|
* Three leaf types supported by tree:
|
|
134
141
|
* 1. Node (sub-tree)
|
|
@@ -136,8 +143,8 @@ export declare const addBoolProperty: (node: NodeCore, a: string, b: boolean) =>
|
|
|
136
143
|
* 3. integer
|
|
137
144
|
* 4. boolean
|
|
138
145
|
*/
|
|
139
|
-
export
|
|
140
|
-
export
|
|
146
|
+
export type NodeTypes = NodeCore | BlobCore | number | boolean | IStringElement;
|
|
147
|
+
export type NodeCoreTypes = "list" | "set";
|
|
141
148
|
/**
|
|
142
149
|
* Node - node in the tree (non-leaf element of the tree)
|
|
143
150
|
*/
|
|
@@ -151,28 +158,48 @@ export declare class NodeCore {
|
|
|
151
158
|
get length(): number;
|
|
152
159
|
get(index: number): NodeTypes;
|
|
153
160
|
getString(index: number): string;
|
|
161
|
+
getMaybeString(index: number): string | undefined;
|
|
154
162
|
getBlob(index: number): BlobCore;
|
|
155
163
|
getNode(index: number): NodeCore;
|
|
156
164
|
getNumber(index: number): number;
|
|
157
165
|
getBool(index: number): boolean;
|
|
158
166
|
addNode(type?: NodeCoreTypes): NodeCore;
|
|
159
|
-
addBlob(blob: Uint8Array
|
|
160
|
-
|
|
167
|
+
addBlob(blob: Uint8Array): void;
|
|
168
|
+
addDictionaryString(payload: string): void;
|
|
169
|
+
addString(payload: string): void;
|
|
161
170
|
addNumber(payload: number | undefined): void;
|
|
162
171
|
addBool(payload: boolean): void;
|
|
172
|
+
private static readString;
|
|
173
|
+
/**
|
|
174
|
+
* Load and parse the buffer into a tree.
|
|
175
|
+
* @param buffer - buffer to read from.
|
|
176
|
+
*/
|
|
177
|
+
protected load(buffer: ReadBuffer, logger: ITelemetryLoggerExt): {
|
|
178
|
+
durationStructure: number;
|
|
179
|
+
durationStrings: number;
|
|
180
|
+
};
|
|
163
181
|
/**
|
|
164
182
|
* Load and parse the buffer into a tree.
|
|
165
183
|
* @param buffer - buffer to read from.
|
|
166
184
|
*/
|
|
167
|
-
protected
|
|
185
|
+
protected loadStructure(buffer: ReadBuffer, logger: ITelemetryLoggerExt): IStringElementInternal[];
|
|
186
|
+
private loadStrings;
|
|
168
187
|
}
|
|
169
188
|
/**
|
|
170
189
|
* TreeBuilder - Root of the tree.
|
|
171
190
|
* Provides loading and serialization capabilities.
|
|
172
191
|
*/
|
|
173
192
|
export declare class TreeBuilder extends NodeCore {
|
|
174
|
-
static load(buffer: ReadBuffer):
|
|
193
|
+
static load(buffer: ReadBuffer, logger: ITelemetryLoggerExt): {
|
|
194
|
+
builder: TreeBuilder;
|
|
195
|
+
telemetryProps: {
|
|
196
|
+
durationStructure: number;
|
|
197
|
+
durationStrings: number;
|
|
198
|
+
};
|
|
199
|
+
};
|
|
175
200
|
}
|
|
201
|
+
export declare function getMaybeStringInstance(node: NodeTypes): string | undefined;
|
|
202
|
+
export declare function getStringInstance(node: NodeTypes, message: string): string;
|
|
176
203
|
export declare function assertBlobCoreInstance(node: NodeTypes, message: string): asserts node is BlobCore;
|
|
177
204
|
export declare function assertNodeCoreInstance(node: NodeTypes, message: string): asserts node is NodeCore;
|
|
178
205
|
export declare function assertNumberInstance(node: NodeTypes, message: string): asserts node is number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zipItDataRepresentationUtils.d.ts","sourceRoot":"","sources":["../src/zipItDataRepresentationUtils.ts"],"names":[],"mappings":"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"}
|
|
@@ -2,15 +2,12 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
* https://microsoft.sharepoint-df.com/:w:/t/ODSPFileStore/ER06b64K_XdDjEyAKl-UT60BJiId39SCVkYSyo_2pvH9gQ?e=KYQ0c5
|
|
8
|
-
*/
|
|
9
|
-
import { assert, IsoBuffer, Uint8ArrayToArrayBuffer, Uint8ArrayToString } from "@fluidframework/common-utils";
|
|
5
|
+
import { Uint8ArrayToArrayBuffer, Uint8ArrayToString } from "@fluid-internal/client-utils";
|
|
6
|
+
import { assert } from "@fluidframework/core-utils";
|
|
10
7
|
import { NonRetryableError } from "@fluidframework/driver-utils";
|
|
11
8
|
import { DriverErrorType } from "@fluidframework/driver-definitions";
|
|
12
|
-
import { pkgVersion as driverVersion } from "./packageVersion";
|
|
13
|
-
|
|
9
|
+
import { pkgVersion as driverVersion } from "./packageVersion.mjs";
|
|
10
|
+
import { measure } from "./odspUtils.mjs";
|
|
14
11
|
// https://onedrive.visualstudio.com/SharePoint%20Online/_git/SPO?path=/cobalt/Base/Property/BinaryEncodedPropertyReader.cs&version=GBmaster&_a=contents
|
|
15
12
|
/**
|
|
16
13
|
* Control codes used by tree serialization / decentralization code. Same as on server. These can be found on
|
|
@@ -63,7 +60,7 @@ export var MarkerCodesEnd;
|
|
|
63
60
|
/**
|
|
64
61
|
* This contains mapping of Marker Codes to number of bytes in which the corresponding data
|
|
65
62
|
* will be stored.
|
|
66
|
-
*/
|
|
63
|
+
*/
|
|
67
64
|
export const codeToBytesMap = {
|
|
68
65
|
// Integer code to bytes
|
|
69
66
|
1: 0,
|
|
@@ -97,19 +94,11 @@ export function getValueSafely(map, key) {
|
|
|
97
94
|
assert(val !== undefined, 0x287 /* key must exist in the map */);
|
|
98
95
|
return val;
|
|
99
96
|
}
|
|
100
|
-
export function
|
|
101
|
-
const propSet = new Set(props);
|
|
97
|
+
export function getNodeProps(node) {
|
|
102
98
|
const res = {};
|
|
103
99
|
for (const [keyNode, valueNode] of node.iteratePairs()) {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
if (propSet.has(keyStr)) {
|
|
107
|
-
propSet.delete(keyStr);
|
|
108
|
-
res[keyStr] = valueNode;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
if (enforceAllProps) {
|
|
112
|
-
assert(propSet.size === 0, 0x288 /* All properties should exist */);
|
|
100
|
+
const id = getStringInstance(keyNode, "keynode should be a string");
|
|
101
|
+
res[id] = valueNode;
|
|
113
102
|
}
|
|
114
103
|
return res;
|
|
115
104
|
}
|
|
@@ -124,7 +113,9 @@ export function iteratePairs(it) {
|
|
|
124
113
|
assert(b.done !== true, 0x22b /* "Should be a pair" */);
|
|
125
114
|
return { value: [a.value, b.value], done: b.done };
|
|
126
115
|
},
|
|
127
|
-
[Symbol.iterator]: () => {
|
|
116
|
+
[Symbol.iterator]: () => {
|
|
117
|
+
return res;
|
|
118
|
+
},
|
|
128
119
|
};
|
|
129
120
|
return res;
|
|
130
121
|
}
|
|
@@ -143,46 +134,36 @@ export function iterate(obj) {
|
|
|
143
134
|
export class BlobCore {
|
|
144
135
|
/**
|
|
145
136
|
* Represents a blob.
|
|
146
|
-
* @param constString - Whether it contains const string declaration.
|
|
147
|
-
* @param useUtf8Code - Represents if the utf8 string marker code should be used when representing.
|
|
148
137
|
*/
|
|
149
|
-
constructor(
|
|
150
|
-
this.constString = constString;
|
|
151
|
-
this.useUtf8Code = useUtf8Code;
|
|
152
|
-
}
|
|
153
|
-
get arrayBuffer() {
|
|
154
|
-
return Uint8ArrayToArrayBuffer(this.buffer);
|
|
155
|
-
}
|
|
156
|
-
toString() {
|
|
157
|
-
return Uint8ArrayToString(this.buffer, "utf-8");
|
|
158
|
-
}
|
|
138
|
+
constructor() { }
|
|
159
139
|
}
|
|
160
140
|
/**
|
|
161
141
|
* "deep copy" blob, holds to binary data passed in
|
|
162
142
|
* It is called deep copy as a counter-part to BlobShallowCopy, which
|
|
163
143
|
* is a reference to underlying binary stream (ReadBuffer).
|
|
164
|
-
*/
|
|
144
|
+
*/
|
|
165
145
|
class BlobDeepCopy extends BlobCore {
|
|
166
146
|
/**
|
|
167
147
|
* Represents a deep copy of the blob.
|
|
168
148
|
* @param data - Data array of the blob
|
|
169
|
-
* @param constString - Whether it contains const string declaration.
|
|
170
|
-
* @param useUtf8Code - Represents if the utf8 string marker code should be used when representing.
|
|
171
149
|
*/
|
|
172
|
-
constructor(data
|
|
173
|
-
super(
|
|
150
|
+
constructor(data) {
|
|
151
|
+
super();
|
|
174
152
|
this.data = data;
|
|
175
153
|
}
|
|
176
154
|
get buffer() {
|
|
177
155
|
return this.data;
|
|
178
156
|
}
|
|
179
|
-
|
|
157
|
+
get arrayBuffer() {
|
|
158
|
+
return Uint8ArrayToArrayBuffer(this.buffer);
|
|
159
|
+
}
|
|
160
|
+
static read(buffer, lengthLen) {
|
|
180
161
|
const length = buffer.read(lengthLen);
|
|
181
162
|
const data = new Uint8Array(length);
|
|
182
163
|
for (let counter = 0; counter < length; counter++) {
|
|
183
164
|
data[counter] = buffer.read();
|
|
184
165
|
}
|
|
185
|
-
return new BlobDeepCopy(data
|
|
166
|
+
return new BlobDeepCopy(data);
|
|
186
167
|
}
|
|
187
168
|
}
|
|
188
169
|
/**
|
|
@@ -195,61 +176,76 @@ export class BlobShallowCopy extends BlobCore {
|
|
|
195
176
|
* @param data - Data array of the blob
|
|
196
177
|
* @param start - Start point of the blob in the buffer.
|
|
197
178
|
* @param end - End point of the blob in the buffer.
|
|
198
|
-
* @param constString - Whether it contains const string declaration.
|
|
199
179
|
*/
|
|
200
|
-
constructor(data, start, end
|
|
201
|
-
super(
|
|
180
|
+
constructor(data, start, end) {
|
|
181
|
+
super();
|
|
202
182
|
this.data = data;
|
|
203
183
|
this.start = start;
|
|
204
184
|
this.end = end;
|
|
205
185
|
}
|
|
206
186
|
get buffer() {
|
|
207
|
-
return this.data.
|
|
187
|
+
return this.data.subarray(this.start, this.end);
|
|
208
188
|
}
|
|
209
|
-
|
|
189
|
+
// Equivalent to Uint8ArrayToArrayBuffer(this.buffer)
|
|
190
|
+
get arrayBuffer() {
|
|
191
|
+
const offset = this.data.byteOffset;
|
|
192
|
+
return this.data.buffer.slice(this.start + offset, this.end + offset);
|
|
193
|
+
}
|
|
194
|
+
static read(buffer, lengthLen) {
|
|
210
195
|
const length = buffer.read(lengthLen);
|
|
211
196
|
const pos = buffer.pos;
|
|
212
197
|
buffer.skip(length);
|
|
213
|
-
return new BlobShallowCopy(buffer, pos, pos + length
|
|
198
|
+
return new BlobShallowCopy(buffer.buffer, pos, pos + length);
|
|
214
199
|
}
|
|
215
200
|
}
|
|
216
|
-
export const addStringProperty = (node, a, b
|
|
217
|
-
node.
|
|
218
|
-
node.addString(b
|
|
201
|
+
export const addStringProperty = (node, a, b) => {
|
|
202
|
+
node.addDictionaryString(a);
|
|
203
|
+
node.addString(b);
|
|
204
|
+
};
|
|
205
|
+
export const addDictionaryStringProperty = (node, a, b) => {
|
|
206
|
+
node.addDictionaryString(a);
|
|
207
|
+
node.addString(b);
|
|
219
208
|
};
|
|
220
209
|
export const addNumberProperty = (node, a, b) => {
|
|
221
|
-
node.
|
|
210
|
+
node.addDictionaryString(a);
|
|
222
211
|
node.addNumber(b);
|
|
223
212
|
};
|
|
224
213
|
export const addBoolProperty = (node, a, b) => {
|
|
225
|
-
node.
|
|
214
|
+
node.addDictionaryString(a);
|
|
226
215
|
node.addBool(b);
|
|
227
216
|
};
|
|
228
217
|
/**
|
|
229
218
|
* Node - node in the tree (non-leaf element of the tree)
|
|
230
219
|
*/
|
|
231
220
|
export class NodeCore {
|
|
221
|
+
get nodes() {
|
|
222
|
+
return this.children;
|
|
223
|
+
}
|
|
232
224
|
constructor(type = "set") {
|
|
233
225
|
this.type = type;
|
|
234
226
|
// It is an array of nodes.
|
|
235
227
|
this.children = [];
|
|
236
228
|
}
|
|
237
|
-
get nodes() {
|
|
238
|
-
return this.children;
|
|
239
|
-
}
|
|
240
229
|
[Symbol.iterator]() {
|
|
241
230
|
return this.children[Symbol.iterator]();
|
|
242
231
|
}
|
|
243
232
|
iteratePairs() {
|
|
244
|
-
assert(
|
|
233
|
+
assert(this.length % 2 === 0, 0x22c /* "reading pairs" */);
|
|
245
234
|
return iteratePairs(iterate(this));
|
|
246
235
|
}
|
|
247
|
-
get length() {
|
|
248
|
-
|
|
236
|
+
get length() {
|
|
237
|
+
return this.children.length;
|
|
238
|
+
}
|
|
239
|
+
get(index) {
|
|
240
|
+
return this.children[index];
|
|
241
|
+
}
|
|
249
242
|
getString(index) {
|
|
250
243
|
const node = this.children[index];
|
|
251
|
-
|
|
252
|
-
|
|
244
|
+
return getStringInstance(node, "getString should return string");
|
|
245
|
+
}
|
|
246
|
+
getMaybeString(index) {
|
|
247
|
+
const node = this.children[index];
|
|
248
|
+
return getMaybeStringInstance(node);
|
|
253
249
|
}
|
|
254
250
|
getBlob(index) {
|
|
255
251
|
const node = this.children[index];
|
|
@@ -276,11 +272,22 @@ export class NodeCore {
|
|
|
276
272
|
this.children.push(node);
|
|
277
273
|
return node;
|
|
278
274
|
}
|
|
279
|
-
addBlob(blob
|
|
280
|
-
this.children.push(new BlobDeepCopy(blob
|
|
275
|
+
addBlob(blob) {
|
|
276
|
+
this.children.push(new BlobDeepCopy(blob));
|
|
277
|
+
}
|
|
278
|
+
addDictionaryString(payload) {
|
|
279
|
+
this.children.push({
|
|
280
|
+
content: payload,
|
|
281
|
+
dictionary: true,
|
|
282
|
+
_stringElement: true,
|
|
283
|
+
});
|
|
281
284
|
}
|
|
282
|
-
addString(payload
|
|
283
|
-
this.
|
|
285
|
+
addString(payload) {
|
|
286
|
+
this.children.push({
|
|
287
|
+
content: payload,
|
|
288
|
+
dictionary: false,
|
|
289
|
+
_stringElement: true,
|
|
290
|
+
});
|
|
284
291
|
}
|
|
285
292
|
addNumber(payload) {
|
|
286
293
|
assert(Number.isInteger(payload), 0x231 /* "Number should be an integer" */);
|
|
@@ -290,60 +297,93 @@ export class NodeCore {
|
|
|
290
297
|
addBool(payload) {
|
|
291
298
|
this.children.push(payload);
|
|
292
299
|
}
|
|
300
|
+
// Can we do more efficiently here, without extra objects somehow??
|
|
301
|
+
static readString(buffer, code, dictionary) {
|
|
302
|
+
const lengthLen = getValueSafely(codeToBytesMap, code);
|
|
303
|
+
const length = buffer.read(lengthLen);
|
|
304
|
+
const startPos = buffer.pos;
|
|
305
|
+
buffer.skip(length);
|
|
306
|
+
const result = {
|
|
307
|
+
// Note: Setting here property 'content: undefined' makes code substantially slower!
|
|
308
|
+
dictionary,
|
|
309
|
+
_stringElement: true,
|
|
310
|
+
startPos,
|
|
311
|
+
endPos: buffer.pos,
|
|
312
|
+
};
|
|
313
|
+
// We are lying here in terms of presence of `content` property.
|
|
314
|
+
// This will be addressed at the bottom of NodeCore.load() by resolving all strings at once!
|
|
315
|
+
// It's equivalent (but much slower!) to do it here via
|
|
316
|
+
// result.content = Uint8ArrayToString(buffer.buffer.subarray(startPos, buffer.pos), "utf-8");
|
|
317
|
+
return result;
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* Load and parse the buffer into a tree.
|
|
321
|
+
* @param buffer - buffer to read from.
|
|
322
|
+
*/
|
|
323
|
+
load(buffer, logger) {
|
|
324
|
+
const [stringsToResolve, durationStructure] = measure(() => this.loadStructure(buffer, logger));
|
|
325
|
+
const [, durationStrings] = measure(() => this.loadStrings(buffer, stringsToResolve, logger));
|
|
326
|
+
return { durationStructure, durationStrings };
|
|
327
|
+
}
|
|
293
328
|
/**
|
|
294
329
|
* Load and parse the buffer into a tree.
|
|
295
330
|
* @param buffer - buffer to read from.
|
|
296
331
|
*/
|
|
297
|
-
|
|
332
|
+
loadStructure(buffer, logger) {
|
|
333
|
+
const stack = [];
|
|
334
|
+
const stringsToResolve = [];
|
|
335
|
+
const dictionary = [];
|
|
336
|
+
let children = this.children;
|
|
298
337
|
for (; !buffer.eof;) {
|
|
299
|
-
let childValue;
|
|
300
338
|
const code = buffer.read();
|
|
301
339
|
switch (code) {
|
|
302
340
|
case MarkerCodesStart.list:
|
|
303
341
|
case MarkerCodesStart.set: {
|
|
304
|
-
childValue = new NodeCore(code === MarkerCodesStart.set ? "set" : "list");
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
342
|
+
const childValue = new NodeCore(code === MarkerCodesStart.set ? "set" : "list");
|
|
343
|
+
children.push(childValue);
|
|
344
|
+
stack.push(children);
|
|
345
|
+
children = childValue.children;
|
|
346
|
+
continue;
|
|
308
347
|
}
|
|
309
348
|
case MarkerCodes.ConstStringDeclare:
|
|
310
|
-
case MarkerCodes.ConstStringDeclareBig:
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
349
|
+
case MarkerCodes.ConstStringDeclareBig: {
|
|
350
|
+
const stringId = buffer.read(getValueSafely(codeToBytesMap, code));
|
|
351
|
+
const constString = NodeCore.readString(buffer, code, true /* dictionary */);
|
|
352
|
+
stringsToResolve.push(constString);
|
|
353
|
+
dictionary[stringId] = constString;
|
|
354
|
+
continue;
|
|
355
|
+
}
|
|
317
356
|
case MarkerCodes.ConstString8Id:
|
|
318
357
|
case MarkerCodes.ConstString16Id:
|
|
319
|
-
case MarkerCodes.ConstString32Id:
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
358
|
+
case MarkerCodes.ConstString32Id: {
|
|
359
|
+
const stringId = buffer.read(getValueSafely(codeToBytesMap, code));
|
|
360
|
+
const content = dictionary[stringId];
|
|
361
|
+
assert(content !== undefined, 0x3de /* const string not found */);
|
|
362
|
+
children.push(content);
|
|
363
|
+
continue;
|
|
364
|
+
}
|
|
326
365
|
case MarkerCodes.StringEmpty:
|
|
327
366
|
case MarkerCodes.String8Length:
|
|
328
367
|
case MarkerCodes.String16Length:
|
|
329
|
-
case MarkerCodes.String32Length:
|
|
368
|
+
case MarkerCodes.String32Length: {
|
|
369
|
+
const str = NodeCore.readString(buffer, code, false /* dictionary */);
|
|
370
|
+
stringsToResolve.push(str);
|
|
371
|
+
children.push(str);
|
|
372
|
+
continue;
|
|
373
|
+
}
|
|
330
374
|
case MarkerCodes.BinaryEmpty:
|
|
331
375
|
case MarkerCodes.BinarySingle8:
|
|
332
376
|
case MarkerCodes.BinarySingle16:
|
|
333
377
|
case MarkerCodes.BinarySingle32:
|
|
334
|
-
case MarkerCodes.BinarySingle64:
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
break;
|
|
339
|
-
}
|
|
378
|
+
case MarkerCodes.BinarySingle64: {
|
|
379
|
+
children.push(BlobShallowCopy.read(buffer, getValueSafely(codeToBytesMap, code)));
|
|
380
|
+
continue;
|
|
381
|
+
}
|
|
340
382
|
// If integer is 0.
|
|
341
|
-
case MarkerCodes.Int0:
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
break;
|
|
346
|
-
}
|
|
383
|
+
case MarkerCodes.Int0: {
|
|
384
|
+
children.push(0);
|
|
385
|
+
continue;
|
|
386
|
+
}
|
|
347
387
|
case MarkerCodes.UInt8:
|
|
348
388
|
case MarkerCodes.UInt16:
|
|
349
389
|
case MarkerCodes.UInt32:
|
|
@@ -351,25 +391,72 @@ export class NodeCore {
|
|
|
351
391
|
case MarkerCodes.Int8:
|
|
352
392
|
case MarkerCodes.Int16:
|
|
353
393
|
case MarkerCodes.Int32:
|
|
354
|
-
case MarkerCodes.Int64:
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
break;
|
|
359
|
-
}
|
|
394
|
+
case MarkerCodes.Int64: {
|
|
395
|
+
children.push(buffer.read(getValueSafely(codeToBytesMap, code)));
|
|
396
|
+
continue;
|
|
397
|
+
}
|
|
360
398
|
case MarkerCodes.BoolTrue:
|
|
361
|
-
|
|
362
|
-
|
|
399
|
+
children.push(true);
|
|
400
|
+
continue;
|
|
363
401
|
case MarkerCodes.BoolFalse:
|
|
364
|
-
|
|
365
|
-
|
|
402
|
+
children.push(false);
|
|
403
|
+
continue;
|
|
366
404
|
case MarkerCodesEnd.list:
|
|
367
405
|
case MarkerCodesEnd.set:
|
|
368
|
-
|
|
406
|
+
// Note: We are not checking that end marker matches start marker.
|
|
407
|
+
// I.e. that we do not have a case where we start a 'list' but end with a 'set'
|
|
408
|
+
// Checking it would require more state tracking that seems not very useful, given
|
|
409
|
+
// our code does not care.
|
|
410
|
+
children = stack.pop();
|
|
411
|
+
// To my surprise, checking children !== undefined adds measurable cost!
|
|
412
|
+
// We will rely on children.push() crashing in case of mismatch, and check below
|
|
413
|
+
// (outside of the loop)
|
|
414
|
+
continue;
|
|
369
415
|
default:
|
|
370
416
|
throw new Error(`Invalid code: ${code}`);
|
|
371
417
|
}
|
|
372
418
|
}
|
|
419
|
+
// This also ensures that stack.length === 0.
|
|
420
|
+
assert(children === this.children, 0x3e7 /* Unpaired start/end list/set markers! */);
|
|
421
|
+
return stringsToResolve;
|
|
422
|
+
}
|
|
423
|
+
loadStrings(buffer, stringsToResolve, logger) {
|
|
424
|
+
/**
|
|
425
|
+
* Process all the strings at once!
|
|
426
|
+
*/
|
|
427
|
+
let length = 0;
|
|
428
|
+
for (const el of stringsToResolve) {
|
|
429
|
+
length += el.endPos - el.startPos + 1;
|
|
430
|
+
}
|
|
431
|
+
const stringBuffer = new Uint8Array(length);
|
|
432
|
+
length = 0;
|
|
433
|
+
const input = buffer.buffer;
|
|
434
|
+
assert(input.byteOffset === 0, 0x3e8 /* code below assumes no offset */);
|
|
435
|
+
for (const el of stringsToResolve) {
|
|
436
|
+
for (let it = el.startPos; it < el.endPos; it++) {
|
|
437
|
+
stringBuffer[length] = input[it];
|
|
438
|
+
length++;
|
|
439
|
+
}
|
|
440
|
+
stringBuffer[length] = 0;
|
|
441
|
+
length++;
|
|
442
|
+
}
|
|
443
|
+
assert(length === stringBuffer.length, 0x418 /* properly encoded */);
|
|
444
|
+
const result = Uint8ArrayToString(stringBuffer, "utf-8").split(String.fromCharCode(0));
|
|
445
|
+
if (result.length === stringsToResolve.length + 1) {
|
|
446
|
+
// All is good, we expect all the cases to get here
|
|
447
|
+
for (let i = 0; i < stringsToResolve.length; i++) {
|
|
448
|
+
stringsToResolve[i].content = result[i];
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
else {
|
|
452
|
+
// String content has \0 chars!
|
|
453
|
+
// Recovery code
|
|
454
|
+
logger.sendErrorEvent({ eventName: "StringParsingError" });
|
|
455
|
+
for (const el of stringsToResolve) {
|
|
456
|
+
assert(el.content ===
|
|
457
|
+
Uint8ArrayToString(input.subarray(el.startPos, el.endPos), "utf-8"), 0x3ea /* test */);
|
|
458
|
+
}
|
|
459
|
+
}
|
|
373
460
|
}
|
|
374
461
|
}
|
|
375
462
|
/**
|
|
@@ -377,14 +464,26 @@ export class NodeCore {
|
|
|
377
464
|
* Provides loading and serialization capabilities.
|
|
378
465
|
*/
|
|
379
466
|
export class TreeBuilder extends NodeCore {
|
|
380
|
-
static load(buffer) {
|
|
467
|
+
static load(buffer, logger) {
|
|
381
468
|
const builder = new TreeBuilder();
|
|
382
|
-
const
|
|
383
|
-
builder.load(buffer, dictionary);
|
|
469
|
+
const telemetryProps = builder.load(buffer, logger);
|
|
384
470
|
assert(buffer.eof, 0x233 /* "Unexpected data at the end of buffer" */);
|
|
385
|
-
return builder;
|
|
471
|
+
return { builder, telemetryProps };
|
|
386
472
|
}
|
|
387
473
|
}
|
|
474
|
+
export function getMaybeStringInstance(node) {
|
|
475
|
+
const maybeString = node;
|
|
476
|
+
if (maybeString._stringElement) {
|
|
477
|
+
return maybeString.content;
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
export function getStringInstance(node, message) {
|
|
481
|
+
const maybeString = node;
|
|
482
|
+
if (maybeString._stringElement) {
|
|
483
|
+
return maybeString.content;
|
|
484
|
+
}
|
|
485
|
+
throwBufferParseException(node, "BlobCore", message);
|
|
486
|
+
}
|
|
388
487
|
export function assertBlobCoreInstance(node, message) {
|
|
389
488
|
if (node instanceof BlobCore) {
|
|
390
489
|
return;
|
|
@@ -429,6 +528,9 @@ function getNodeType(value) {
|
|
|
429
528
|
else if (typeof value === "boolean") {
|
|
430
529
|
return "Boolean";
|
|
431
530
|
}
|
|
531
|
+
else if (value._stringElement) {
|
|
532
|
+
return "String";
|
|
533
|
+
}
|
|
432
534
|
return "UnknownType";
|
|
433
535
|
}
|
|
434
|
-
//# sourceMappingURL=zipItDataRepresentationUtils.
|
|
536
|
+
//# sourceMappingURL=zipItDataRepresentationUtils.mjs.map
|