@fluidframework/driver-utils 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 +17 -7
- package/.mocharc.js +12 -0
- package/CHANGELOG.md +141 -0
- package/README.md +68 -1
- package/api-extractor-lint.json +4 -0
- package/api-extractor.json +2 -2
- package/api-report/driver-utils.api.md +401 -0
- package/dist/adapters/compression/compressionTypes.cjs +20 -0
- package/dist/adapters/compression/compressionTypes.cjs.map +1 -0
- package/dist/adapters/compression/compressionTypes.d.ts +23 -0
- package/dist/adapters/compression/compressionTypes.d.ts.map +1 -0
- package/dist/adapters/compression/documentServiceCompressionAdapter.cjs +23 -0
- package/dist/adapters/compression/documentServiceCompressionAdapter.cjs.map +1 -0
- package/dist/adapters/compression/documentServiceCompressionAdapter.d.ts +13 -0
- package/dist/adapters/compression/documentServiceCompressionAdapter.d.ts.map +1 -0
- package/dist/adapters/compression/documentServiceFactoryCompressionAdapter.cjs +31 -0
- package/dist/adapters/compression/documentServiceFactoryCompressionAdapter.cjs.map +1 -0
- package/dist/adapters/compression/documentServiceFactoryCompressionAdapter.d.ts +16 -0
- package/dist/adapters/compression/documentServiceFactoryCompressionAdapter.d.ts.map +1 -0
- package/dist/adapters/compression/index.cjs +15 -0
- package/dist/adapters/compression/index.cjs.map +1 -0
- package/dist/adapters/compression/index.d.ts +8 -0
- package/dist/adapters/compression/index.d.ts.map +1 -0
- package/dist/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.cjs +370 -0
- package/dist/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.cjs.map +1 -0
- package/dist/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.d.ts +165 -0
- package/dist/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.d.ts.map +1 -0
- package/dist/adapters/compression/summaryblob/index.cjs +11 -0
- package/dist/adapters/compression/summaryblob/index.cjs.map +1 -0
- package/dist/adapters/compression/summaryblob/index.d.ts +6 -0
- package/dist/adapters/compression/summaryblob/index.d.ts.map +1 -0
- package/dist/adapters/index.cjs +14 -0
- package/dist/adapters/index.cjs.map +1 -0
- package/dist/adapters/index.d.ts +7 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/predefinedAdapters.cjs +52 -0
- package/dist/adapters/predefinedAdapters.cjs.map +1 -0
- package/dist/adapters/predefinedAdapters.d.ts +21 -0
- package/dist/adapters/predefinedAdapters.d.ts.map +1 -0
- package/dist/blob.cjs +65 -0
- package/dist/blob.cjs.map +1 -0
- package/dist/blob.d.ts +56 -0
- package/dist/blob.d.ts.map +1 -0
- package/dist/{buildSnapshotTree.js → buildSnapshotTree.cjs} +7 -5
- package/dist/buildSnapshotTree.cjs.map +1 -0
- package/dist/buildSnapshotTree.d.ts +1 -0
- package/dist/buildSnapshotTree.d.ts.map +1 -1
- package/dist/documentServiceFactoryProxy.cjs +27 -0
- package/dist/documentServiceFactoryProxy.cjs.map +1 -0
- package/dist/documentServiceFactoryProxy.d.ts +19 -0
- package/dist/documentServiceFactoryProxy.d.ts.map +1 -0
- package/dist/documentServiceProxy.cjs +36 -0
- package/dist/documentServiceProxy.cjs.map +1 -0
- package/dist/documentServiceProxy.d.ts +21 -0
- package/dist/documentServiceProxy.d.ts.map +1 -0
- package/dist/{documentStorageServiceProxy.js → documentStorageServiceProxy.cjs} +10 -8
- package/dist/documentStorageServiceProxy.cjs.map +1 -0
- package/dist/documentStorageServiceProxy.d.ts +5 -2
- package/dist/documentStorageServiceProxy.d.ts.map +1 -1
- package/dist/driver-utils-alpha.d.ts +163 -0
- package/dist/driver-utils-beta.d.ts +178 -0
- package/dist/driver-utils-public.d.ts +178 -0
- package/dist/driver-utils-untrimmed.d.ts +590 -0
- package/dist/{error.js → error.cjs} +10 -3
- package/dist/error.cjs.map +1 -0
- package/dist/error.d.ts +8 -3
- package/dist/error.d.ts.map +1 -1
- package/dist/index.cjs +69 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +16 -21
- package/dist/index.d.ts.map +1 -1
- package/dist/{insecureUrlResolver.js → insecureUrlResolver.cjs} +10 -11
- package/dist/insecureUrlResolver.cjs.map +1 -0
- package/dist/insecureUrlResolver.d.ts +1 -0
- package/dist/insecureUrlResolver.d.ts.map +1 -1
- package/dist/messageRecognition.cjs +38 -0
- package/dist/messageRecognition.cjs.map +1 -0
- package/dist/messageRecognition.d.ts +16 -26
- package/dist/messageRecognition.d.ts.map +1 -1
- package/dist/{network.js → network.cjs} +86 -24
- package/dist/network.cjs.map +1 -0
- package/dist/network.d.ts +69 -20
- package/dist/network.d.ts.map +1 -1
- package/dist/networkUtils.cjs +29 -0
- package/dist/networkUtils.cjs.map +1 -0
- package/dist/networkUtils.d.ts +4 -10
- package/dist/networkUtils.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/{parallelRequests.js → parallelRequests.cjs} +146 -74
- package/dist/parallelRequests.cjs.map +1 -0
- package/dist/parallelRequests.d.ts +19 -6
- package/dist/parallelRequests.d.ts.map +1 -1
- package/dist/{prefetchDocumentStorageService.js → prefetchDocumentStorageService.cjs} +7 -4
- package/dist/prefetchDocumentStorageService.cjs.map +1 -0
- package/dist/prefetchDocumentStorageService.d.ts +4 -2
- package/dist/prefetchDocumentStorageService.d.ts.map +1 -1
- package/dist/{rateLimiter.js → rateLimiter.cjs} +6 -3
- package/dist/rateLimiter.cjs.map +1 -0
- package/dist/rateLimiter.d.ts +3 -0
- package/dist/rateLimiter.d.ts.map +1 -1
- package/dist/readAndParse.cjs +28 -0
- package/dist/readAndParse.cjs.map +1 -0
- package/dist/readAndParse.d.ts +10 -4
- package/dist/readAndParse.d.ts.map +1 -1
- package/dist/runWithRetry.cjs +108 -0
- package/dist/runWithRetry.cjs.map +1 -0
- package/dist/runWithRetry.d.ts +26 -7
- package/dist/runWithRetry.d.ts.map +1 -1
- package/dist/{summaryForCreateNew.js → summaryForCreateNew.cjs} +20 -19
- package/dist/summaryForCreateNew.cjs.map +1 -0
- package/dist/summaryForCreateNew.d.ts +17 -4
- package/dist/summaryForCreateNew.d.ts.map +1 -1
- package/dist/{treeConversions.js → treeConversions.cjs} +16 -18
- package/dist/treeConversions.cjs.map +1 -0
- package/dist/treeConversions.d.ts +1 -0
- package/dist/treeConversions.d.ts.map +1 -1
- package/dist/tsdoc-metadata.json +11 -0
- package/lib/adapters/compression/compressionTypes.d.mts +23 -0
- package/lib/adapters/compression/compressionTypes.d.mts.map +1 -0
- package/lib/adapters/compression/compressionTypes.mjs +17 -0
- package/lib/adapters/compression/compressionTypes.mjs.map +1 -0
- package/lib/adapters/compression/documentServiceCompressionAdapter.d.mts +13 -0
- package/lib/adapters/compression/documentServiceCompressionAdapter.d.mts.map +1 -0
- package/lib/adapters/compression/documentServiceCompressionAdapter.mjs +19 -0
- package/lib/adapters/compression/documentServiceCompressionAdapter.mjs.map +1 -0
- package/lib/adapters/compression/documentServiceFactoryCompressionAdapter.d.mts +16 -0
- package/lib/adapters/compression/documentServiceFactoryCompressionAdapter.d.mts.map +1 -0
- package/lib/adapters/compression/documentServiceFactoryCompressionAdapter.mjs +27 -0
- package/lib/adapters/compression/documentServiceFactoryCompressionAdapter.mjs.map +1 -0
- package/lib/adapters/compression/index.d.mts +8 -0
- package/lib/adapters/compression/index.d.mts.map +1 -0
- package/lib/adapters/compression/index.mjs +8 -0
- package/lib/adapters/compression/index.mjs.map +1 -0
- package/lib/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.d.mts +165 -0
- package/lib/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.d.mts.map +1 -0
- package/lib/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.mjs +366 -0
- package/lib/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.mjs.map +1 -0
- package/lib/adapters/compression/summaryblob/index.d.mts +6 -0
- package/lib/adapters/compression/summaryblob/index.d.mts.map +1 -0
- package/lib/adapters/compression/summaryblob/index.mjs +6 -0
- package/lib/adapters/compression/summaryblob/index.mjs.map +1 -0
- package/lib/adapters/index.d.mts +7 -0
- package/lib/adapters/index.d.mts.map +1 -0
- package/lib/adapters/index.mjs +7 -0
- package/lib/adapters/index.mjs.map +1 -0
- package/lib/adapters/predefinedAdapters.d.mts +21 -0
- package/lib/adapters/predefinedAdapters.d.mts.map +1 -0
- package/lib/adapters/predefinedAdapters.mjs +47 -0
- package/lib/adapters/predefinedAdapters.mjs.map +1 -0
- package/lib/blob.d.mts +56 -0
- package/lib/blob.d.mts.map +1 -0
- package/lib/blob.mjs +59 -0
- package/lib/blob.mjs.map +1 -0
- package/lib/{buildSnapshotTree.d.ts → buildSnapshotTree.d.mts} +1 -0
- package/lib/buildSnapshotTree.d.mts.map +1 -0
- package/lib/{buildSnapshotTree.js → buildSnapshotTree.mjs} +6 -4
- package/lib/buildSnapshotTree.mjs.map +1 -0
- package/lib/documentServiceFactoryProxy.d.mts +19 -0
- package/lib/documentServiceFactoryProxy.d.mts.map +1 -0
- package/lib/documentServiceFactoryProxy.mjs +23 -0
- package/lib/documentServiceFactoryProxy.mjs.map +1 -0
- package/lib/documentServiceProxy.d.mts +21 -0
- package/lib/documentServiceProxy.d.mts.map +1 -0
- package/lib/documentServiceProxy.mjs +32 -0
- package/lib/documentServiceProxy.mjs.map +1 -0
- package/lib/{documentStorageServiceProxy.d.ts → documentStorageServiceProxy.d.mts} +5 -2
- package/lib/documentStorageServiceProxy.d.mts.map +1 -0
- package/lib/{documentStorageServiceProxy.js → documentStorageServiceProxy.mjs} +10 -8
- package/lib/documentStorageServiceProxy.mjs.map +1 -0
- package/lib/driver-utils-alpha.d.mts +163 -0
- package/lib/driver-utils-beta.d.mts +178 -0
- package/lib/driver-utils-public.d.mts +178 -0
- package/lib/driver-utils-untrimmed.d.mts +590 -0
- package/lib/error.d.mts +16 -0
- package/lib/error.d.mts.map +1 -0
- package/lib/error.mjs +19 -0
- package/lib/error.mjs.map +1 -0
- package/lib/index.d.mts +21 -0
- package/lib/index.d.mts.map +1 -0
- package/lib/index.mjs +21 -0
- package/lib/index.mjs.map +1 -0
- package/lib/{insecureUrlResolver.d.ts → insecureUrlResolver.d.mts} +1 -0
- package/lib/insecureUrlResolver.d.mts.map +1 -0
- package/lib/{insecureUrlResolver.js → insecureUrlResolver.mjs} +10 -11
- package/lib/insecureUrlResolver.mjs.map +1 -0
- package/lib/messageRecognition.d.mts +24 -0
- package/lib/messageRecognition.d.mts.map +1 -0
- package/lib/messageRecognition.mjs +29 -0
- package/lib/messageRecognition.mjs.map +1 -0
- package/lib/{network.d.ts → network.d.mts} +69 -20
- package/lib/network.d.mts.map +1 -0
- package/lib/{network.js → network.mjs} +85 -23
- package/lib/network.mjs.map +1 -0
- package/lib/networkUtils.d.mts +11 -0
- package/lib/networkUtils.d.mts.map +1 -0
- package/lib/networkUtils.mjs +25 -0
- package/lib/networkUtils.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/{parallelRequests.d.ts → parallelRequests.d.mts} +19 -6
- package/lib/parallelRequests.d.mts.map +1 -0
- package/lib/{parallelRequests.js → parallelRequests.mjs} +119 -52
- package/lib/parallelRequests.mjs.map +1 -0
- package/lib/{prefetchDocumentStorageService.d.ts → prefetchDocumentStorageService.d.mts} +5 -7
- package/lib/prefetchDocumentStorageService.d.mts.map +1 -0
- package/lib/{prefetchDocumentStorageService.js → prefetchDocumentStorageService.mjs} +7 -8
- package/lib/prefetchDocumentStorageService.mjs.map +1 -0
- package/lib/{rateLimiter.d.ts → rateLimiter.d.mts} +3 -0
- package/lib/rateLimiter.d.mts.map +1 -0
- package/lib/{rateLimiter.js → rateLimiter.mjs} +5 -2
- package/lib/rateLimiter.mjs.map +1 -0
- package/lib/readAndParse.d.mts +20 -0
- package/lib/readAndParse.d.mts.map +1 -0
- package/lib/readAndParse.mjs +24 -0
- package/lib/readAndParse.mjs.map +1 -0
- package/lib/{runWithRetry.d.ts → runWithRetry.d.mts} +26 -7
- package/lib/runWithRetry.d.mts.map +1 -0
- package/lib/runWithRetry.mjs +103 -0
- package/lib/runWithRetry.mjs.map +1 -0
- package/lib/{summaryForCreateNew.d.ts → summaryForCreateNew.d.mts} +17 -4
- package/lib/summaryForCreateNew.d.mts.map +1 -0
- package/lib/{summaryForCreateNew.js → summaryForCreateNew.mjs} +18 -17
- package/lib/summaryForCreateNew.mjs.map +1 -0
- package/lib/{treeConversions.d.ts → treeConversions.d.mts} +1 -0
- package/lib/treeConversions.d.mts.map +1 -0
- package/lib/{treeConversions.js → treeConversions.mjs} +12 -14
- package/lib/treeConversions.mjs.map +1 -0
- package/package.json +88 -64
- package/prettier.config.cjs +8 -0
- package/src/adapters/compression/compressionTypes.ts +25 -0
- package/src/adapters/compression/documentServiceCompressionAdapter.ts +28 -0
- package/src/adapters/compression/documentServiceFactoryCompressionAdapter.ts +54 -0
- package/src/adapters/compression/index.ts +12 -0
- package/src/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.ts +451 -0
- package/src/adapters/compression/summaryblob/index.ts +9 -0
- package/src/adapters/index.ts +13 -0
- package/src/adapters/predefinedAdapters.ts +74 -0
- package/src/blob.ts +77 -0
- package/src/buildSnapshotTree.ts +58 -53
- package/src/documentServiceFactoryProxy.ts +47 -0
- package/src/documentServiceProxy.ts +46 -0
- package/src/documentStorageServiceProxy.ts +52 -37
- package/src/error.ts +13 -8
- package/src/index.ts +51 -21
- package/src/insecureUrlResolver.ts +125 -120
- package/src/messageRecognition.ts +24 -53
- package/src/network.ts +189 -111
- package/src/networkUtils.ts +24 -49
- package/src/packageVersion.ts +1 -1
- package/src/parallelRequests.ts +630 -519
- package/src/prefetchDocumentStorageService.ts +79 -74
- package/src/rateLimiter.ts +33 -30
- package/src/readAndParse.ts +18 -9
- package/src/runWithRetry.ts +145 -85
- package/src/summaryForCreateNew.ts +48 -29
- package/src/treeConversions.ts +49 -70
- package/tsc-multi.test.json +4 -0
- package/tsconfig.json +10 -12
- package/dist/blobAggregationStorage.d.ts +0 -43
- package/dist/blobAggregationStorage.d.ts.map +0 -1
- package/dist/blobAggregationStorage.js +0 -318
- package/dist/blobAggregationStorage.js.map +0 -1
- package/dist/blobCacheStorageService.d.ts +0 -16
- package/dist/blobCacheStorageService.d.ts.map +0 -1
- package/dist/blobCacheStorageService.js +0 -29
- package/dist/blobCacheStorageService.js.map +0 -1
- package/dist/buildSnapshotTree.js.map +0 -1
- package/dist/documentStorageServiceProxy.js.map +0 -1
- package/dist/emptyDocumentDeltaStorageService.d.ts +0 -13
- package/dist/emptyDocumentDeltaStorageService.d.ts.map +0 -1
- package/dist/emptyDocumentDeltaStorageService.js +0 -20
- package/dist/emptyDocumentDeltaStorageService.js.map +0 -1
- package/dist/error.js.map +0 -1
- package/dist/fluidResolvedUrl.d.ts +0 -8
- package/dist/fluidResolvedUrl.d.ts.map +0 -1
- package/dist/fluidResolvedUrl.js +0 -16
- package/dist/fluidResolvedUrl.js.map +0 -1
- package/dist/index.js +0 -38
- package/dist/index.js.map +0 -1
- package/dist/insecureUrlResolver.js.map +0 -1
- package/dist/messageRecognition.js +0 -73
- package/dist/messageRecognition.js.map +0 -1
- package/dist/multiDocumentServiceFactory.d.ts +0 -16
- package/dist/multiDocumentServiceFactory.d.ts.map +0 -1
- package/dist/multiDocumentServiceFactory.js +0 -63
- package/dist/multiDocumentServiceFactory.js.map +0 -1
- package/dist/multiUrlResolver.d.ts +0 -20
- package/dist/multiUrlResolver.d.ts.map +0 -1
- package/dist/multiUrlResolver.js +0 -45
- package/dist/multiUrlResolver.js.map +0 -1
- package/dist/network.js.map +0 -1
- package/dist/networkUtils.js +0 -59
- package/dist/networkUtils.js.map +0 -1
- package/dist/packageVersion.js.map +0 -1
- package/dist/parallelRequests.js.map +0 -1
- package/dist/prefetchDocumentStorageService.js.map +0 -1
- package/dist/rateLimiter.js.map +0 -1
- package/dist/readAndParse.js +0 -22
- package/dist/readAndParse.js.map +0 -1
- package/dist/runWithRetry.js +0 -69
- package/dist/runWithRetry.js.map +0 -1
- package/dist/summaryForCreateNew.js.map +0 -1
- package/dist/treeConversions.js.map +0 -1
- package/dist/treeUtils.d.ts +0 -51
- package/dist/treeUtils.d.ts.map +0 -1
- package/dist/treeUtils.js +0 -85
- package/dist/treeUtils.js.map +0 -1
- package/lib/blobAggregationStorage.d.ts +0 -43
- package/lib/blobAggregationStorage.d.ts.map +0 -1
- package/lib/blobAggregationStorage.js +0 -313
- package/lib/blobAggregationStorage.js.map +0 -1
- package/lib/blobCacheStorageService.d.ts +0 -16
- package/lib/blobCacheStorageService.d.ts.map +0 -1
- package/lib/blobCacheStorageService.js +0 -25
- package/lib/blobCacheStorageService.js.map +0 -1
- package/lib/buildSnapshotTree.d.ts.map +0 -1
- package/lib/buildSnapshotTree.js.map +0 -1
- package/lib/documentStorageServiceProxy.d.ts.map +0 -1
- package/lib/documentStorageServiceProxy.js.map +0 -1
- package/lib/emptyDocumentDeltaStorageService.d.ts +0 -13
- package/lib/emptyDocumentDeltaStorageService.d.ts.map +0 -1
- package/lib/emptyDocumentDeltaStorageService.js +0 -16
- package/lib/emptyDocumentDeltaStorageService.js.map +0 -1
- package/lib/error.d.ts +0 -11
- package/lib/error.d.ts.map +0 -1
- package/lib/error.js +0 -13
- package/lib/error.js.map +0 -1
- package/lib/fluidResolvedUrl.d.ts +0 -8
- package/lib/fluidResolvedUrl.d.ts.map +0 -1
- package/lib/fluidResolvedUrl.js +0 -11
- package/lib/fluidResolvedUrl.js.map +0 -1
- package/lib/index.d.ts +0 -26
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -26
- package/lib/index.js.map +0 -1
- package/lib/insecureUrlResolver.d.ts.map +0 -1
- package/lib/insecureUrlResolver.js.map +0 -1
- package/lib/messageRecognition.d.ts +0 -38
- package/lib/messageRecognition.d.ts.map +0 -1
- package/lib/messageRecognition.js +0 -67
- package/lib/messageRecognition.js.map +0 -1
- package/lib/multiDocumentServiceFactory.d.ts +0 -16
- package/lib/multiDocumentServiceFactory.d.ts.map +0 -1
- package/lib/multiDocumentServiceFactory.js +0 -59
- package/lib/multiDocumentServiceFactory.js.map +0 -1
- package/lib/multiUrlResolver.d.ts +0 -20
- package/lib/multiUrlResolver.d.ts.map +0 -1
- package/lib/multiUrlResolver.js +0 -40
- package/lib/multiUrlResolver.js.map +0 -1
- package/lib/network.d.ts.map +0 -1
- package/lib/network.js.map +0 -1
- package/lib/networkUtils.d.ts +0 -17
- package/lib/networkUtils.d.ts.map +0 -1
- package/lib/networkUtils.js +0 -54
- package/lib/networkUtils.js.map +0 -1
- package/lib/packageVersion.js.map +0 -1
- package/lib/parallelRequests.d.ts.map +0 -1
- package/lib/parallelRequests.js.map +0 -1
- package/lib/prefetchDocumentStorageService.d.ts.map +0 -1
- package/lib/prefetchDocumentStorageService.js.map +0 -1
- package/lib/rateLimiter.d.ts.map +0 -1
- package/lib/rateLimiter.js.map +0 -1
- package/lib/readAndParse.d.ts +0 -14
- package/lib/readAndParse.d.ts.map +0 -1
- package/lib/readAndParse.js +0 -18
- package/lib/readAndParse.js.map +0 -1
- package/lib/runWithRetry.d.ts.map +0 -1
- package/lib/runWithRetry.js +0 -65
- package/lib/runWithRetry.js.map +0 -1
- package/lib/summaryForCreateNew.d.ts.map +0 -1
- package/lib/summaryForCreateNew.js.map +0 -1
- package/lib/treeConversions.d.ts.map +0 -1
- package/lib/treeConversions.js.map +0 -1
- package/lib/treeUtils.d.ts +0 -51
- package/lib/treeUtils.d.ts.map +0 -1
- package/lib/treeUtils.js +0 -80
- package/lib/treeUtils.js.map +0 -1
- package/src/blobAggregationStorage.ts +0 -374
- package/src/blobCacheStorageService.ts +0 -32
- package/src/emptyDocumentDeltaStorageService.ts +0 -24
- package/src/fluidResolvedUrl.ts +0 -15
- package/src/multiDocumentServiceFactory.ts +0 -80
- package/src/multiUrlResolver.ts +0 -51
- package/src/treeUtils.ts +0 -111
- package/tsconfig.esnext.json +0 -7
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import { IDocumentStorageService, ISummaryContext } from "@fluidframework/driver-definitions";
|
|
6
|
+
import { ISnapshotTree, ISummaryHandle, ISummaryTree, IVersion } from "@fluidframework/protocol-definitions";
|
|
7
|
+
import { DocumentStorageServiceProxy } from "../../../documentStorageServiceProxy";
|
|
8
|
+
import { ICompressionStorageConfig } from "../";
|
|
9
|
+
/**
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export declare const blobHeadersBlobName = ".metadata.blobHeaders";
|
|
13
|
+
/**
|
|
14
|
+
* This class is a proxy for the IDocumentStorageService that compresses and decompresses blobs in the summary.
|
|
15
|
+
* The identification of the compressed blobs is done by adding a compression markup blob to the summary.
|
|
16
|
+
* Even if the markup blob is present, it does not mean that all blobs are compressed. The blob,
|
|
17
|
+
* which is compressed also contain the compression algorithm enumerated value from the
|
|
18
|
+
* SummaryCompressionAlgorithm enumeration in the first byte . If the blob is not
|
|
19
|
+
* commpressed, it contains the first byte equals to SummaryCompressionAlgorithm.None .
|
|
20
|
+
* In case, the markup blob is present, it is expected that the first byte of the markup blob
|
|
21
|
+
* will contain the info about the compression. If the first byte is not present, it is assumed
|
|
22
|
+
* that the compression is not enabled and no first prefix byte is present in the blobs.
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
export declare class DocumentStorageServiceCompressionAdapter extends DocumentStorageServiceProxy {
|
|
26
|
+
private readonly _config;
|
|
27
|
+
private _isCompressionEnabled;
|
|
28
|
+
constructor(service: IDocumentStorageService, _config: ICompressionStorageConfig);
|
|
29
|
+
get service(): IDocumentStorageService;
|
|
30
|
+
/**
|
|
31
|
+
* This method returns `true` if there is a compression markup byte in the blob, otherwise `false`.
|
|
32
|
+
* @param blob - The blob to compress.
|
|
33
|
+
* @returns `true` if there is a compression markup byte in the blob, otherwise `false`.
|
|
34
|
+
*/
|
|
35
|
+
private static hasPrefix;
|
|
36
|
+
/**
|
|
37
|
+
* This method reads the first byte from the given blob and maps that byte to the compression algorithm.
|
|
38
|
+
* @param blob - The maybe compressed blob.
|
|
39
|
+
*/
|
|
40
|
+
private static readAlgorithmFromBlob;
|
|
41
|
+
/**
|
|
42
|
+
* This method writes the given algorithm to the blob as the first byte.
|
|
43
|
+
* @param blob - The blob to write the algorithm to.
|
|
44
|
+
* @param algorithm - The algorithm to write.
|
|
45
|
+
* @returns The blob with the algorithm as the first byte.
|
|
46
|
+
*/
|
|
47
|
+
private static writeAlgorithmToBlob;
|
|
48
|
+
/**
|
|
49
|
+
* This method removes the algorithm markup prefix from the blob (1 byte)
|
|
50
|
+
* @param blob - The blob to remove the prefix from.
|
|
51
|
+
* @returns The blob without the prefix.
|
|
52
|
+
*/
|
|
53
|
+
private static removePrefixFromBlobIfPresent;
|
|
54
|
+
/**
|
|
55
|
+
* This method converts the given argument to Uint8Array. If the parameter is already Uint8Array,
|
|
56
|
+
* it is just returned as is. If the parameter is string, it is converted to Uint8Array using
|
|
57
|
+
* TextEncoder.
|
|
58
|
+
* @param input - The input to convert to Uint8Array.
|
|
59
|
+
* @returns The Uint8Array representation of the input.
|
|
60
|
+
*/
|
|
61
|
+
private static toBinaryArray;
|
|
62
|
+
/**
|
|
63
|
+
* This method encodes the blob inside the given summary object of the SummaryType.Blob type using the given config
|
|
64
|
+
* containing the compression algorithm.
|
|
65
|
+
* @param input - The summary object to encode.
|
|
66
|
+
* @param config - The config containing the compression algorithm.
|
|
67
|
+
* @returns The summary object with the encoded blob.
|
|
68
|
+
*/
|
|
69
|
+
private static readonly blobEncoder;
|
|
70
|
+
/**
|
|
71
|
+
* This method decodes the blob inside the given summary object of the SummaryType.Blob type.
|
|
72
|
+
* @param input - The summary object to decode.
|
|
73
|
+
* @returns The summary object with the decoded blob.
|
|
74
|
+
*/
|
|
75
|
+
private static readonly blobDecoder;
|
|
76
|
+
/**
|
|
77
|
+
* This method encodes the given blob according to the given config.
|
|
78
|
+
* @param file - The blob to encode.
|
|
79
|
+
* @param config - The config to use for encoding.
|
|
80
|
+
* @returns The encoded blob.
|
|
81
|
+
*/
|
|
82
|
+
private static encodeBlob;
|
|
83
|
+
/**
|
|
84
|
+
* This method decodes the given blob.
|
|
85
|
+
* @param file - The blob to decode.
|
|
86
|
+
* @returns The decoded blob.
|
|
87
|
+
*/
|
|
88
|
+
private static decodeBlob;
|
|
89
|
+
/**
|
|
90
|
+
* This method traverses the SummaryObject recursively. If it finds the ISummaryBlob object,
|
|
91
|
+
* it applies encoding/decoding on it according to the given isEncode flag.
|
|
92
|
+
* @param isEncode - True if the encoding should be applied, false if the decoding should be applied.
|
|
93
|
+
* @param input - The summary object to traverse.
|
|
94
|
+
* @param encoder - The encoder function to use.
|
|
95
|
+
* @param decoder - The decoder function to use.
|
|
96
|
+
* @param config - The config to use for encoding.
|
|
97
|
+
* @param context - The summary context.
|
|
98
|
+
* @returns The summary object with the encoded/decoded blob.
|
|
99
|
+
*/
|
|
100
|
+
private static recursivelyReplace;
|
|
101
|
+
/**
|
|
102
|
+
* This method traverses the SummaryTree recursively. If it finds the ISummaryBlob object with the key '.metadata',
|
|
103
|
+
* it returns the summary tree containing that blob.
|
|
104
|
+
*
|
|
105
|
+
* @param summary - The summary tree to traverse.
|
|
106
|
+
* @returns The summary tree containing the metadata blob.
|
|
107
|
+
*/
|
|
108
|
+
private static findMetadataHolderSummary;
|
|
109
|
+
/**
|
|
110
|
+
* This method obtains the summary tree containing the metadata blob. It returns the content
|
|
111
|
+
* of the tree atribute.
|
|
112
|
+
* @param summary - The summary tree to traverse.
|
|
113
|
+
* @returns The content of the tree attribute of the summary tree containing the metadata blob.
|
|
114
|
+
*/
|
|
115
|
+
private static getMetadataHolderTree;
|
|
116
|
+
/**
|
|
117
|
+
* This method adds the compression markup blob to the nested summary tree containing the metadata blob.
|
|
118
|
+
* @param summary - The top summary tree to put the compression markup blob into.
|
|
119
|
+
*/
|
|
120
|
+
private static putCompressionMarkup;
|
|
121
|
+
/**
|
|
122
|
+
* This method traverses the SnapshotTree recursively. If it finds the ISummaryBlob object with the key '.metadata',
|
|
123
|
+
* it checks, if the SummaryTree holder of that object also contains the compression markup blob. If it is found,
|
|
124
|
+
* it returns true, otherwise false.
|
|
125
|
+
* @param snapshot - The snapshot tree to traverse.
|
|
126
|
+
* @returns True if the compression markup blob is found, otherwise false.
|
|
127
|
+
*/
|
|
128
|
+
private static hasCompressionMarkup;
|
|
129
|
+
/**
|
|
130
|
+
* This method performs compression of the blobs in the summary tree.
|
|
131
|
+
* @param summary - The summary tree to compress.
|
|
132
|
+
* @param config - The compression config.
|
|
133
|
+
* @returns The compressed summary tree.
|
|
134
|
+
*/
|
|
135
|
+
static compressSummary(summary: ISummaryTree, config: ICompressionStorageConfig): ISummaryTree;
|
|
136
|
+
/**
|
|
137
|
+
* This method read blob from the storage and decompresses it if it is compressed.
|
|
138
|
+
* @param id - The id of the blob to read.
|
|
139
|
+
* @returns The decompressed blob.
|
|
140
|
+
*/
|
|
141
|
+
readBlob(id: string): Promise<ArrayBufferLike>;
|
|
142
|
+
/**
|
|
143
|
+
* This method loads the snapshot tree from the server. It also checks, if the compression markup blob is present
|
|
144
|
+
* and setups the compression flag accordingly. It also identifies the blobs that are not compressed and do not contain
|
|
145
|
+
* algorithm byte prefix and store them.
|
|
146
|
+
* @param version - The version of the snapshot tree to load.
|
|
147
|
+
* @param scenarioName - The scenario name of the snapshot tree to load.
|
|
148
|
+
* @returns The snapshot tree.
|
|
149
|
+
*/
|
|
150
|
+
getSnapshotTree(version?: IVersion | undefined, scenarioName?: string | undefined): Promise<ISnapshotTree | null>;
|
|
151
|
+
/**
|
|
152
|
+
* This method uploads the summary to the storage. It performs compression of the blobs in the summary tree.
|
|
153
|
+
* @param summary - The summary tree to upload.
|
|
154
|
+
* @param context - The summary context.
|
|
155
|
+
* @returns The ID of the uploaded summary.
|
|
156
|
+
*/
|
|
157
|
+
uploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string>;
|
|
158
|
+
/**
|
|
159
|
+
* This method downloads the summary from the storage and then applies decompression on the compressed blobs.
|
|
160
|
+
* @param id - The ID of the summary to be downloaded
|
|
161
|
+
* @returns The summary with decompressed blobs
|
|
162
|
+
*/
|
|
163
|
+
downloadSummary(id: ISummaryHandle): Promise<ISummaryTree>;
|
|
164
|
+
}
|
|
165
|
+
//# sourceMappingURL=documentStorageServiceSummaryBlobCompressionAdapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"documentStorageServiceSummaryBlobCompressionAdapter.d.ts","sourceRoot":"","sources":["../../../../src/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAC9F,OAAO,EACN,aAAa,EAEb,cAAc,EACd,YAAY,EACZ,QAAQ,EAGR,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AACnF,OAAO,EAAE,yBAAyB,EAA+B,MAAM,KAAK,CAAC;AAE7E;;GAEG;AACH,eAAO,MAAM,mBAAmB,0BAA0B,CAAC;AAG3D;;;;;;;;;;;GAWG;AACH,qBAAa,wCAAyC,SAAQ,2BAA2B;IAKvF,OAAO,CAAC,QAAQ,CAAC,OAAO;IAJzB,OAAO,CAAC,qBAAqB,CAAkB;gBAG9C,OAAO,EAAE,uBAAuB,EACf,OAAO,EAAE,yBAAyB;IAKpD,IAAW,OAAO,IAAI,uBAAuB,CAE5C;IAED;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,SAAS;IAMxB;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,qBAAqB;IAOpC;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,oBAAoB;IAmBnC;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,6BAA6B;IAK5C;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,aAAa;IAI5B;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAoBjC;IAEF;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAgBjC;IAEF;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,UAAU;IAwBzB;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,UAAU;IAqBzB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,MAAM,CAAC,kBAAkB;IAoCjC;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,yBAAyB;IAkBxC;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,qBAAqB;IAOpC;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,oBAAoB;IASnC;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,oBAAoB;IAsBnC;;;;;OAKG;WACW,eAAe,CAC5B,OAAO,EAAE,YAAY,EACrB,MAAM,EAAE,yBAAyB,GAC/B,YAAY;IAaf;;;;OAIG;IACmB,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAYpE;;;;;;;OAOG;IACmB,eAAe,CACpC,OAAO,CAAC,EAAE,QAAQ,GAAG,SAAS,EAC9B,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,GAE/B,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IAShC;;;;;OAKG;IACmB,wBAAwB,CAC7C,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,eAAe,GACtB,OAAO,CAAC,MAAM,CAAC;IAQlB;;;;OAIG;IACmB,eAAe,CAAC,EAAE,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC;CAYhF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
|
+
* Licensed under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.blobHeadersBlobName = exports.DocumentStorageServiceCompressionAdapter = void 0;
|
|
8
|
+
var documentStorageServiceSummaryBlobCompressionAdapter_1 = require("./documentStorageServiceSummaryBlobCompressionAdapter.cjs");
|
|
9
|
+
Object.defineProperty(exports, "DocumentStorageServiceCompressionAdapter", { enumerable: true, get: function () { return documentStorageServiceSummaryBlobCompressionAdapter_1.DocumentStorageServiceCompressionAdapter; } });
|
|
10
|
+
Object.defineProperty(exports, "blobHeadersBlobName", { enumerable: true, get: function () { return documentStorageServiceSummaryBlobCompressionAdapter_1.blobHeadersBlobName; } });
|
|
11
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../../src/adapters/compression/summaryblob/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,iIAG+D;AAF9D,+KAAA,wCAAwC,OAAA;AACxC,0JAAA,mBAAmB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tDocumentStorageServiceCompressionAdapter,\n\tblobHeadersBlobName,\n} from \"./documentStorageServiceSummaryBlobCompressionAdapter\";\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
export { DocumentStorageServiceCompressionAdapter, blobHeadersBlobName, } from "./documentStorageServiceSummaryBlobCompressionAdapter";
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/adapters/compression/summaryblob/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,wCAAwC,EACxC,mBAAmB,GACnB,MAAM,uDAAuD,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
|
+
* Licensed under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.applyStorageCompression = exports.blobHeadersBlobName = exports.DefaultCompressionStorageConfig = exports.SummaryCompressionAlgorithm = void 0;
|
|
8
|
+
var compression_1 = require("./compression/index.cjs");
|
|
9
|
+
Object.defineProperty(exports, "SummaryCompressionAlgorithm", { enumerable: true, get: function () { return compression_1.SummaryCompressionAlgorithm; } });
|
|
10
|
+
Object.defineProperty(exports, "DefaultCompressionStorageConfig", { enumerable: true, get: function () { return compression_1.DefaultCompressionStorageConfig; } });
|
|
11
|
+
Object.defineProperty(exports, "blobHeadersBlobName", { enumerable: true, get: function () { return compression_1.blobHeadersBlobName; } });
|
|
12
|
+
var predefinedAdapters_1 = require("./predefinedAdapters.cjs");
|
|
13
|
+
Object.defineProperty(exports, "applyStorageCompression", { enumerable: true, get: function () { return predefinedAdapters_1.applyStorageCompression; } });
|
|
14
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/adapters/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,uDAKuB;AAJtB,0HAAA,2BAA2B,OAAA;AAE3B,8HAAA,+BAA+B,OAAA;AAC/B,kHAAA,mBAAmB,OAAA;AAGpB,+DAA+D;AAAtD,6HAAA,uBAAuB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tSummaryCompressionAlgorithm,\n\tICompressionStorageConfig,\n\tDefaultCompressionStorageConfig,\n\tblobHeadersBlobName,\n} from \"./compression\";\n\nexport { applyStorageCompression } from \"./predefinedAdapters\";\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
export { SummaryCompressionAlgorithm, ICompressionStorageConfig, DefaultCompressionStorageConfig, blobHeadersBlobName, } from "./compression";
|
|
6
|
+
export { applyStorageCompression } from "./predefinedAdapters";
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/adapters/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,2BAA2B,EAC3B,yBAAyB,EACzB,+BAA+B,EAC/B,mBAAmB,GACnB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
|
+
* Licensed under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.isCompressionConfig = exports.applyStorageCompression = void 0;
|
|
8
|
+
const core_utils_1 = require("@fluidframework/core-utils");
|
|
9
|
+
const compression_1 = require("./compression/index.cjs");
|
|
10
|
+
/**
|
|
11
|
+
* This method optionally applies compression to the given document service factory. The compression
|
|
12
|
+
* must be enabled by setting the config to true or by passing a compression config object.
|
|
13
|
+
* @param documentServiceFactory - The document service factory to apply compression to.
|
|
14
|
+
* @param config - The compression configuration.
|
|
15
|
+
* @returns The document service factory possibly with compression applied.
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
function applyStorageCompression(documentServiceFactory, config) {
|
|
19
|
+
if (config === undefined || config === false) {
|
|
20
|
+
return documentServiceFactory;
|
|
21
|
+
}
|
|
22
|
+
else if (config === true) {
|
|
23
|
+
return applyStorageCompressionInternal(compression_1.DocumentServiceFactoryCompressionAdapter, documentServiceFactory);
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
(0, core_utils_1.assert)(isCompressionConfig(config), 0x6f4 /* Invalid compression config */);
|
|
27
|
+
return applyStorageCompressionInternal(compression_1.DocumentServiceFactoryCompressionAdapter, documentServiceFactory, config);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.applyStorageCompression = applyStorageCompression;
|
|
31
|
+
/**
|
|
32
|
+
* This method applies compression to the given document service factory.
|
|
33
|
+
* @param documentServiceFactory - The document service factory to apply compression to.
|
|
34
|
+
* @param config - The compression configuration.
|
|
35
|
+
* @returns The document service factory with compression applied.
|
|
36
|
+
*/
|
|
37
|
+
function applyStorageCompressionInternal(constructor, documentServiceFactory, config = compression_1.DefaultCompressionStorageConfig) {
|
|
38
|
+
if (config.algorithm === undefined) {
|
|
39
|
+
return documentServiceFactory;
|
|
40
|
+
}
|
|
41
|
+
return new constructor(documentServiceFactory, config);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* This method checks whether given objects contains
|
|
45
|
+
* a properties expected for the interface ICompressionStorageConfig.
|
|
46
|
+
*/
|
|
47
|
+
function isCompressionConfig(config) {
|
|
48
|
+
return (config !== undefined &&
|
|
49
|
+
(config.algorithm !== undefined || config.minSizeToCompress !== undefined));
|
|
50
|
+
}
|
|
51
|
+
exports.isCompressionConfig = isCompressionConfig;
|
|
52
|
+
//# sourceMappingURL=predefinedAdapters.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"predefinedAdapters.cjs","sourceRoot":"","sources":["../../src/adapters/predefinedAdapters.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2DAAoD;AAEpD,yDAIuB;AAEvB;;;;;;;GAOG;AACH,SAAgB,uBAAuB,CACtC,sBAA+C,EAC/C,MAA4C;IAE5C,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,KAAK,EAAE;QAC7C,OAAO,sBAAsB,CAAC;KAC9B;SAAM,IAAI,MAAM,KAAK,IAAI,EAAE;QAC3B,OAAO,+BAA+B,CACrC,sDAAwC,EACxC,sBAAsB,CACtB,CAAC;KACF;SAAM;QACN,IAAA,mBAAM,EAAC,mBAAmB,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC,gCAAgC,CAAC,CAAC;QAC5E,OAAO,+BAA+B,CACrC,sDAAwC,EACxC,sBAAsB,EACtB,MAAM,CACN,CAAC;KACF;AACF,CAAC;AAnBD,0DAmBC;AAED;;;;;GAKG;AACH,SAAS,+BAA+B,CACvC,WAK4B,EAC5B,sBAA+C,EAC/C,SAAoC,6CAA+B;IAEnE,IAAI,MAAM,CAAC,SAAS,KAAK,SAAS,EAAE;QACnC,OAAO,sBAAsB,CAAC;KAC9B;IACD,OAAO,IAAI,WAAW,CAAC,sBAAsB,EAAE,MAAM,CAAC,CAAC;AACxD,CAAC;AAED;;;GAGG;AACH,SAAgB,mBAAmB,CAAC,MAAW;IAC9C,OAAO,CACN,MAAM,KAAK,SAAS;QACpB,CAAC,MAAM,CAAC,SAAS,KAAK,SAAS,IAAI,MAAM,CAAC,iBAAiB,KAAK,SAAS,CAAC,CAC1E,CAAC;AACH,CAAC;AALD,kDAKC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils\";\nimport { IDocumentServiceFactory } from \"@fluidframework/driver-definitions\";\nimport {\n\tDocumentServiceFactoryCompressionAdapter,\n\tICompressionStorageConfig,\n\tDefaultCompressionStorageConfig,\n} from \"./compression\";\n\n/**\n * This method optionally applies compression to the given document service factory. The compression\n * must be enabled by setting the config to true or by passing a compression config object.\n * @param documentServiceFactory - The document service factory to apply compression to.\n * @param config - The compression configuration.\n * @returns The document service factory possibly with compression applied.\n * @internal\n */\nexport function applyStorageCompression(\n\tdocumentServiceFactory: IDocumentServiceFactory,\n\tconfig?: ICompressionStorageConfig | boolean,\n): IDocumentServiceFactory {\n\tif (config === undefined || config === false) {\n\t\treturn documentServiceFactory;\n\t} else if (config === true) {\n\t\treturn applyStorageCompressionInternal(\n\t\t\tDocumentServiceFactoryCompressionAdapter,\n\t\t\tdocumentServiceFactory,\n\t\t);\n\t} else {\n\t\tassert(isCompressionConfig(config), 0x6f4 /* Invalid compression config */);\n\t\treturn applyStorageCompressionInternal(\n\t\t\tDocumentServiceFactoryCompressionAdapter,\n\t\t\tdocumentServiceFactory,\n\t\t\tconfig,\n\t\t);\n\t}\n}\n\n/**\n * This method applies compression to the given document service factory.\n * @param documentServiceFactory - The document service factory to apply compression to.\n * @param config - The compression configuration.\n * @returns The document service factory with compression applied.\n */\nfunction applyStorageCompressionInternal(\n\tconstructor: new (\n\t\t// eslint-disable-next-line @typescript-eslint/no-shadow\n\t\tdocumentServiceFactory: IDocumentServiceFactory,\n\t\t// eslint-disable-next-line @typescript-eslint/no-shadow\n\t\tconfig: ICompressionStorageConfig,\n\t) => IDocumentServiceFactory,\n\tdocumentServiceFactory: IDocumentServiceFactory,\n\tconfig: ICompressionStorageConfig = DefaultCompressionStorageConfig,\n): IDocumentServiceFactory {\n\tif (config.algorithm === undefined) {\n\t\treturn documentServiceFactory;\n\t}\n\treturn new constructor(documentServiceFactory, config);\n}\n\n/**\n * This method checks whether given objects contains\n * a properties expected for the interface ICompressionStorageConfig.\n */\nexport function isCompressionConfig(config: any): config is ICompressionStorageConfig {\n\treturn (\n\t\tconfig !== undefined &&\n\t\t(config.algorithm !== undefined || config.minSizeToCompress !== undefined)\n\t);\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import { IDocumentServiceFactory } from "@fluidframework/driver-definitions";
|
|
6
|
+
import { ICompressionStorageConfig } from "./compression";
|
|
7
|
+
/**
|
|
8
|
+
* This method optionally applies compression to the given document service factory. The compression
|
|
9
|
+
* must be enabled by setting the config to true or by passing a compression config object.
|
|
10
|
+
* @param documentServiceFactory - The document service factory to apply compression to.
|
|
11
|
+
* @param config - The compression configuration.
|
|
12
|
+
* @returns The document service factory possibly with compression applied.
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export declare function applyStorageCompression(documentServiceFactory: IDocumentServiceFactory, config?: ICompressionStorageConfig | boolean): IDocumentServiceFactory;
|
|
16
|
+
/**
|
|
17
|
+
* This method checks whether given objects contains
|
|
18
|
+
* a properties expected for the interface ICompressionStorageConfig.
|
|
19
|
+
*/
|
|
20
|
+
export declare function isCompressionConfig(config: any): config is ICompressionStorageConfig;
|
|
21
|
+
//# sourceMappingURL=predefinedAdapters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"predefinedAdapters.d.ts","sourceRoot":"","sources":["../../src/adapters/predefinedAdapters.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAEN,yBAAyB,EAEzB,MAAM,eAAe,CAAC;AAEvB;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACtC,sBAAsB,EAAE,uBAAuB,EAC/C,MAAM,CAAC,EAAE,yBAAyB,GAAG,OAAO,GAC1C,uBAAuB,CAgBzB;AAwBD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,IAAI,yBAAyB,CAKpF"}
|
package/dist/blob.cjs
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
|
+
* Licensed under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.AttachmentTreeEntry = exports.TreeTreeEntry = exports.BlobTreeEntry = void 0;
|
|
8
|
+
const protocol_definitions_1 = require("@fluidframework/protocol-definitions");
|
|
9
|
+
/**
|
|
10
|
+
* Basic implementation of a blob ITreeEntry
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
class BlobTreeEntry {
|
|
14
|
+
/**
|
|
15
|
+
* Creates a blob ITreeEntry
|
|
16
|
+
* @param path - path of entry
|
|
17
|
+
* @param contents - blob contents
|
|
18
|
+
* @param encoding - encoding of contents; defaults to utf-8
|
|
19
|
+
*/
|
|
20
|
+
constructor(path, contents, encoding = "utf-8") {
|
|
21
|
+
this.path = path;
|
|
22
|
+
this.mode = protocol_definitions_1.FileMode.File;
|
|
23
|
+
this.type = protocol_definitions_1.TreeEntry.Blob;
|
|
24
|
+
this.value = { contents, encoding };
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.BlobTreeEntry = BlobTreeEntry;
|
|
28
|
+
/**
|
|
29
|
+
* Basic implementation of a tree ITreeEntry
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
32
|
+
class TreeTreeEntry {
|
|
33
|
+
/**
|
|
34
|
+
* Creates a tree ITreeEntry
|
|
35
|
+
* @param path - path of entry
|
|
36
|
+
* @param value - subtree
|
|
37
|
+
*/
|
|
38
|
+
constructor(path, value) {
|
|
39
|
+
this.path = path;
|
|
40
|
+
this.value = value;
|
|
41
|
+
this.mode = protocol_definitions_1.FileMode.Directory;
|
|
42
|
+
this.type = protocol_definitions_1.TreeEntry.Tree;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.TreeTreeEntry = TreeTreeEntry;
|
|
46
|
+
/**
|
|
47
|
+
* Basic implementation of an attachment ITreeEntry
|
|
48
|
+
* @internal
|
|
49
|
+
*/
|
|
50
|
+
class AttachmentTreeEntry {
|
|
51
|
+
/**
|
|
52
|
+
* Creates an attachment ITreeEntry
|
|
53
|
+
* @param path - path of entry
|
|
54
|
+
* @param id - id of external blob attachment
|
|
55
|
+
*/
|
|
56
|
+
constructor(path, id) {
|
|
57
|
+
this.path = path;
|
|
58
|
+
this.id = id;
|
|
59
|
+
this.mode = protocol_definitions_1.FileMode.File;
|
|
60
|
+
this.type = protocol_definitions_1.TreeEntry.Attachment;
|
|
61
|
+
this.value = { id };
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.AttachmentTreeEntry = AttachmentTreeEntry;
|
|
65
|
+
//# sourceMappingURL=blob.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blob.cjs","sourceRoot":"","sources":["../src/blob.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+EAM8C;AAE9C;;;GAGG;AACH,MAAa,aAAa;IAKzB;;;;;OAKG;IACH,YACiB,IAAY,EAC5B,QAAgB,EAChB,WAA+B,OAAO;QAFtB,SAAI,GAAJ,IAAI,CAAQ;QAXb,SAAI,GAAG,+BAAQ,CAAC,IAAI,CAAC;QACrB,SAAI,GAAG,gCAAS,CAAC,IAAI,CAAC;QAcrC,IAAI,CAAC,KAAK,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;IACrC,CAAC;CACD;AAlBD,sCAkBC;AAED;;;GAGG;AACH,MAAa,aAAa;IAIzB;;;;OAIG;IACH,YACiB,IAAY,EACZ,KAAY;QADZ,SAAI,GAAJ,IAAI,CAAQ;QACZ,UAAK,GAAL,KAAK,CAAO;QAVb,SAAI,GAAG,+BAAQ,CAAC,SAAS,CAAC;QAC1B,SAAI,GAAG,gCAAS,CAAC,IAAI,CAAC;IAUnC,CAAC;CACJ;AAbD,sCAaC;AAED;;;GAGG;AACH,MAAa,mBAAmB;IAK/B;;;;OAIG;IACH,YACiB,IAAY,EACZ,EAAU;QADV,SAAI,GAAJ,IAAI,CAAQ;QACZ,OAAE,GAAF,EAAE,CAAQ;QAXX,SAAI,GAAG,+BAAQ,CAAC,IAAI,CAAC;QACrB,SAAI,GAAG,gCAAS,CAAC,UAAU,CAAC;QAY3C,IAAI,CAAC,KAAK,GAAG,EAAE,EAAE,EAAE,CAAC;IACrB,CAAC;CACD;AAhBD,kDAgBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tFileMode,\n\tIBlob,\n\tIAttachment,\n\tITree,\n\tTreeEntry,\n} from \"@fluidframework/protocol-definitions\";\n\n/**\n * Basic implementation of a blob ITreeEntry\n * @internal\n */\nexport class BlobTreeEntry {\n\tpublic readonly mode = FileMode.File;\n\tpublic readonly type = TreeEntry.Blob;\n\tpublic readonly value: IBlob;\n\n\t/**\n\t * Creates a blob ITreeEntry\n\t * @param path - path of entry\n\t * @param contents - blob contents\n\t * @param encoding - encoding of contents; defaults to utf-8\n\t */\n\tconstructor(\n\t\tpublic readonly path: string,\n\t\tcontents: string,\n\t\tencoding: \"utf-8\" | \"base64\" = \"utf-8\",\n\t) {\n\t\tthis.value = { contents, encoding };\n\t}\n}\n\n/**\n * Basic implementation of a tree ITreeEntry\n * @internal\n */\nexport class TreeTreeEntry {\n\tpublic readonly mode = FileMode.Directory;\n\tpublic readonly type = TreeEntry.Tree;\n\n\t/**\n\t * Creates a tree ITreeEntry\n\t * @param path - path of entry\n\t * @param value - subtree\n\t */\n\tconstructor(\n\t\tpublic readonly path: string,\n\t\tpublic readonly value: ITree,\n\t) {}\n}\n\n/**\n * Basic implementation of an attachment ITreeEntry\n * @internal\n */\nexport class AttachmentTreeEntry {\n\tpublic readonly mode = FileMode.File;\n\tpublic readonly type = TreeEntry.Attachment;\n\tpublic readonly value: IAttachment;\n\n\t/**\n\t * Creates an attachment ITreeEntry\n\t * @param path - path of entry\n\t * @param id - id of external blob attachment\n\t */\n\tconstructor(\n\t\tpublic readonly path: string,\n\t\tpublic readonly id: string,\n\t) {\n\t\tthis.value = { id };\n\t}\n}\n"]}
|
package/dist/blob.d.ts
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import { FileMode, IBlob, IAttachment, ITree, TreeEntry } from "@fluidframework/protocol-definitions";
|
|
6
|
+
/**
|
|
7
|
+
* Basic implementation of a blob ITreeEntry
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export declare class BlobTreeEntry {
|
|
11
|
+
readonly path: string;
|
|
12
|
+
readonly mode = FileMode.File;
|
|
13
|
+
readonly type = TreeEntry.Blob;
|
|
14
|
+
readonly value: IBlob;
|
|
15
|
+
/**
|
|
16
|
+
* Creates a blob ITreeEntry
|
|
17
|
+
* @param path - path of entry
|
|
18
|
+
* @param contents - blob contents
|
|
19
|
+
* @param encoding - encoding of contents; defaults to utf-8
|
|
20
|
+
*/
|
|
21
|
+
constructor(path: string, contents: string, encoding?: "utf-8" | "base64");
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Basic implementation of a tree ITreeEntry
|
|
25
|
+
* @internal
|
|
26
|
+
*/
|
|
27
|
+
export declare class TreeTreeEntry {
|
|
28
|
+
readonly path: string;
|
|
29
|
+
readonly value: ITree;
|
|
30
|
+
readonly mode = FileMode.Directory;
|
|
31
|
+
readonly type = TreeEntry.Tree;
|
|
32
|
+
/**
|
|
33
|
+
* Creates a tree ITreeEntry
|
|
34
|
+
* @param path - path of entry
|
|
35
|
+
* @param value - subtree
|
|
36
|
+
*/
|
|
37
|
+
constructor(path: string, value: ITree);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Basic implementation of an attachment ITreeEntry
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
43
|
+
export declare class AttachmentTreeEntry {
|
|
44
|
+
readonly path: string;
|
|
45
|
+
readonly id: string;
|
|
46
|
+
readonly mode = FileMode.File;
|
|
47
|
+
readonly type = TreeEntry.Attachment;
|
|
48
|
+
readonly value: IAttachment;
|
|
49
|
+
/**
|
|
50
|
+
* Creates an attachment ITreeEntry
|
|
51
|
+
* @param path - path of entry
|
|
52
|
+
* @param id - id of external blob attachment
|
|
53
|
+
*/
|
|
54
|
+
constructor(path: string, id: string);
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=blob.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blob.d.ts","sourceRoot":"","sources":["../src/blob.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,QAAQ,EACR,KAAK,EACL,WAAW,EACX,KAAK,EACL,SAAS,EACT,MAAM,sCAAsC,CAAC;AAE9C;;;GAGG;AACH,qBAAa,aAAa;aAYR,IAAI,EAAE,MAAM;IAX7B,SAAgB,IAAI,iBAAiB;IACrC,SAAgB,IAAI,kBAAkB;IACtC,SAAgB,KAAK,EAAE,KAAK,CAAC;IAE7B;;;;;OAKG;gBAEc,IAAI,EAAE,MAAM,EAC5B,QAAQ,EAAE,MAAM,EAChB,QAAQ,GAAE,OAAO,GAAG,QAAkB;CAIvC;AAED;;;GAGG;AACH,qBAAa,aAAa;aAUR,IAAI,EAAE,MAAM;aACZ,KAAK,EAAE,KAAK;IAV7B,SAAgB,IAAI,sBAAsB;IAC1C,SAAgB,IAAI,kBAAkB;IAEtC;;;;OAIG;gBAEc,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,KAAK;CAE7B;AAED;;;GAGG;AACH,qBAAa,mBAAmB;aAWd,IAAI,EAAE,MAAM;aACZ,EAAE,EAAE,MAAM;IAX3B,SAAgB,IAAI,iBAAiB;IACrC,SAAgB,IAAI,wBAAwB;IAC5C,SAAgB,KAAK,EAAE,WAAW,CAAC;IAEnC;;;;OAIG;gBAEc,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM;CAI3B"}
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.buildSnapshotTree = void 0;
|
|
8
|
-
const
|
|
8
|
+
const client_utils_1 = require("@fluid-internal/client-utils");
|
|
9
|
+
const core_utils_1 = require("@fluidframework/core-utils");
|
|
9
10
|
const protocol_definitions_1 = require("@fluidframework/protocol-definitions");
|
|
10
11
|
const protocol_base_1 = require("@fluidframework/protocol-base");
|
|
11
12
|
const uuid_1 = require("uuid");
|
|
@@ -15,7 +16,7 @@ function flattenCore(path, treeEntries, blobMap) {
|
|
|
15
16
|
const subPath = `${path}${treeEntry.path}`;
|
|
16
17
|
if (treeEntry.type === protocol_definitions_1.TreeEntry.Blob) {
|
|
17
18
|
const blob = treeEntry.value;
|
|
18
|
-
const buffer = (0,
|
|
19
|
+
const buffer = (0, client_utils_1.stringToBuffer)(blob.contents, blob.encoding);
|
|
19
20
|
const id = (0, uuid_1.v4)();
|
|
20
21
|
blobMap.set(id, buffer);
|
|
21
22
|
const entry = {
|
|
@@ -29,7 +30,7 @@ function flattenCore(path, treeEntries, blobMap) {
|
|
|
29
30
|
entries.push(entry);
|
|
30
31
|
}
|
|
31
32
|
else if (treeEntry.type === protocol_definitions_1.TreeEntry.Tree) {
|
|
32
|
-
(0,
|
|
33
|
+
(0, core_utils_1.assert)(treeEntry.type === protocol_definitions_1.TreeEntry.Tree, 0x101 /* "Unexpected tree entry type on flatten!" */);
|
|
33
34
|
const t = treeEntry.value;
|
|
34
35
|
const entry = {
|
|
35
36
|
mode: protocol_definitions_1.FileMode[treeEntry.mode],
|
|
@@ -68,10 +69,11 @@ function flatten(tree, blobMap) {
|
|
|
68
69
|
* @param blobMap - a map of blob's sha1 to content that gets filled with content from entries
|
|
69
70
|
* NOTE: blobMap's validity is contingent on the returned promise's resolution
|
|
70
71
|
* @returns the hierarchical tree
|
|
72
|
+
* @internal
|
|
71
73
|
*/
|
|
72
74
|
function buildSnapshotTree(entries, blobMap) {
|
|
73
75
|
const flattened = flatten(entries, blobMap);
|
|
74
|
-
return (0, protocol_base_1.
|
|
76
|
+
return (0, protocol_base_1.buildGitTreeHierarchy)(flattened);
|
|
75
77
|
}
|
|
76
78
|
exports.buildSnapshotTree = buildSnapshotTree;
|
|
77
|
-
//# sourceMappingURL=buildSnapshotTree.
|
|
79
|
+
//# sourceMappingURL=buildSnapshotTree.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildSnapshotTree.cjs","sourceRoot":"","sources":["../src/buildSnapshotTree.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAA8D;AAC9D,2DAAoD;AAEpD,+EAK8C;AAC9C,iEAAsE;AACtE,+BAAkC;AAElC,SAAS,WAAW,CACnB,IAAY,EACZ,WAAyB,EACzB,OAAqC;IAErC,MAAM,OAAO,GAAqB,EAAE,CAAC;IACrC,KAAK,MAAM,SAAS,IAAI,WAAW,EAAE;QACpC,MAAM,OAAO,GAAG,GAAG,IAAI,GAAG,SAAS,CAAC,IAAI,EAAE,CAAC;QAE3C,IAAI,SAAS,CAAC,IAAI,KAAK,gCAAS,CAAC,IAAI,EAAE;YACtC,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC;YAC7B,MAAM,MAAM,GAAG,IAAA,6BAAc,EAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC5D,MAAM,EAAE,GAAG,IAAA,SAAI,GAAE,CAAC;YAClB,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;YAExB,MAAM,KAAK,GAAmB;gBAC7B,IAAI,EAAE,+BAAQ,CAAC,SAAS,CAAC,IAAI,CAAC;gBAC9B,IAAI,EAAE,OAAO;gBACb,GAAG,EAAE,EAAE;gBACP,IAAI,EAAE,CAAC;gBACP,IAAI,EAAE,MAAM;gBACZ,GAAG,EAAE,EAAE;aACP,CAAC;YACF,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACpB;aAAM,IAAI,SAAS,CAAC,IAAI,KAAK,gCAAS,CAAC,IAAI,EAAE;YAC7C,IAAA,mBAAM,EACL,SAAS,CAAC,IAAI,KAAK,gCAAS,CAAC,IAAI,EACjC,KAAK,CAAC,8CAA8C,CACpD,CAAC;YACF,MAAM,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC;YAC1B,MAAM,KAAK,GAAmB;gBAC7B,IAAI,EAAE,+BAAQ,CAAC,SAAS,CAAC,IAAI,CAAC;gBAC9B,IAAI,EAAE,OAAO;gBACb,GAAG,EAAE,EAAE;gBACP,IAAI,EAAE,CAAC,CAAC;gBACR,IAAI,EAAE,MAAM;gBACZ,GAAG,EAAE,EAAE;aACP,CAAC;YACF,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAEpB,MAAM,cAAc,GAAG,WAAW,CAAC,GAAG,OAAO,GAAG,EAAE,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YACtE,OAAO,CAAC,IAAI,CAAC,GAAG,cAAc,CAAC,CAAC;SAChC;KACD;IAED,OAAO,OAAO,CAAC;AAChB,CAAC;AAED;;;;;;GAMG;AACH,SAAS,OAAO,CAAC,IAAkB,EAAE,OAAqC;IACzE,MAAM,OAAO,GAAG,WAAW,CAAC,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAC/C,OAAO;QACN,GAAG,EAAE,EAAE;QACP,IAAI,EAAE,OAAO;QACb,GAAG,EAAE,EAAE;KACP,CAAC;AACH,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,iBAAiB,CAChC,OAAqB,EACrB,OAAqC;IAErC,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC5C,OAAO,IAAA,qCAAqB,EAAC,SAAS,CAAC,CAAC;AACzC,CAAC;AAND,8CAMC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { stringToBuffer } from \"@fluid-internal/client-utils\";\nimport { assert } from \"@fluidframework/core-utils\";\nimport * as git from \"@fluidframework/gitresources\";\nimport {\n\tFileMode,\n\tISnapshotTree,\n\tITreeEntry,\n\tTreeEntry,\n} from \"@fluidframework/protocol-definitions\";\nimport { buildGitTreeHierarchy } from \"@fluidframework/protocol-base\";\nimport { v4 as uuid } from \"uuid\";\n\nfunction flattenCore(\n\tpath: string,\n\ttreeEntries: ITreeEntry[],\n\tblobMap: Map<string, ArrayBufferLike>,\n): git.ITreeEntry[] {\n\tconst entries: git.ITreeEntry[] = [];\n\tfor (const treeEntry of treeEntries) {\n\t\tconst subPath = `${path}${treeEntry.path}`;\n\n\t\tif (treeEntry.type === TreeEntry.Blob) {\n\t\t\tconst blob = treeEntry.value;\n\t\t\tconst buffer = stringToBuffer(blob.contents, blob.encoding);\n\t\t\tconst id = uuid();\n\t\t\tblobMap.set(id, buffer);\n\n\t\t\tconst entry: git.ITreeEntry = {\n\t\t\t\tmode: FileMode[treeEntry.mode],\n\t\t\t\tpath: subPath,\n\t\t\t\tsha: id,\n\t\t\t\tsize: 0,\n\t\t\t\ttype: \"blob\",\n\t\t\t\turl: \"\",\n\t\t\t};\n\t\t\tentries.push(entry);\n\t\t} else if (treeEntry.type === TreeEntry.Tree) {\n\t\t\tassert(\n\t\t\t\ttreeEntry.type === TreeEntry.Tree,\n\t\t\t\t0x101 /* \"Unexpected tree entry type on flatten!\" */,\n\t\t\t);\n\t\t\tconst t = treeEntry.value;\n\t\t\tconst entry: git.ITreeEntry = {\n\t\t\t\tmode: FileMode[treeEntry.mode],\n\t\t\t\tpath: subPath,\n\t\t\t\tsha: \"\",\n\t\t\t\tsize: -1,\n\t\t\t\ttype: \"tree\",\n\t\t\t\turl: \"\",\n\t\t\t};\n\t\t\tentries.push(entry);\n\n\t\t\tconst subTreeEntries = flattenCore(`${subPath}/`, t.entries, blobMap);\n\t\t\tentries.push(...subTreeEntries);\n\t\t}\n\t}\n\n\treturn entries;\n}\n\n/**\n * Create a flatten view of an array of ITreeEntry\n *\n * @param tree - an array of ITreeEntry to flatten\n * @param blobMap - a map of blob's sha1 to content\n * @returns A flatten with of the ITreeEntry\n */\nfunction flatten(tree: ITreeEntry[], blobMap: Map<string, ArrayBufferLike>): git.ITree {\n\tconst entries = flattenCore(\"\", tree, blobMap);\n\treturn {\n\t\tsha: \"\",\n\t\ttree: entries,\n\t\turl: \"\",\n\t};\n}\n\n/**\n * Build a tree hierarchy base on an array of ITreeEntry\n *\n * @param entries - an array of ITreeEntry to flatten\n * @param blobMap - a map of blob's sha1 to content that gets filled with content from entries\n * NOTE: blobMap's validity is contingent on the returned promise's resolution\n * @returns the hierarchical tree\n * @internal\n */\nexport function buildSnapshotTree(\n\tentries: ITreeEntry[],\n\tblobMap: Map<string, ArrayBufferLike>,\n): ISnapshotTree {\n\tconst flattened = flatten(entries, blobMap);\n\treturn buildGitTreeHierarchy(flattened);\n}\n"]}
|
|
@@ -10,6 +10,7 @@ import { ISnapshotTree, ITreeEntry } from "@fluidframework/protocol-definitions"
|
|
|
10
10
|
* @param blobMap - a map of blob's sha1 to content that gets filled with content from entries
|
|
11
11
|
* NOTE: blobMap's validity is contingent on the returned promise's resolution
|
|
12
12
|
* @returns the hierarchical tree
|
|
13
|
+
* @internal
|
|
13
14
|
*/
|
|
14
15
|
export declare function buildSnapshotTree(entries: ITreeEntry[], blobMap: Map<string, ArrayBufferLike>): ISnapshotTree;
|
|
15
16
|
//# sourceMappingURL=buildSnapshotTree.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildSnapshotTree.d.ts","sourceRoot":"","sources":["../src/buildSnapshotTree.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"buildSnapshotTree.d.ts","sourceRoot":"","sources":["../src/buildSnapshotTree.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAEN,aAAa,EACb,UAAU,EAEV,MAAM,sCAAsC,CAAC;AAoE9C;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAChC,OAAO,EAAE,UAAU,EAAE,EACrB,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,GACnC,aAAa,CAGf"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
|
+
* Licensed under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.DocumentServiceFactoryProxy = void 0;
|
|
8
|
+
/**
|
|
9
|
+
* This abstract class implements IDocumentServiceFactory interface. It uses delegation pattern.
|
|
10
|
+
* It delegates all calls to IDocumentServiceFactory implementation passed to constructor.
|
|
11
|
+
*/
|
|
12
|
+
class DocumentServiceFactoryProxy {
|
|
13
|
+
constructor(_serviceFactory) {
|
|
14
|
+
this._serviceFactory = _serviceFactory;
|
|
15
|
+
}
|
|
16
|
+
get serviceFactory() {
|
|
17
|
+
return this._serviceFactory;
|
|
18
|
+
}
|
|
19
|
+
async createContainer(createNewSummary, createNewResolvedUrl, logger, clientIsSummarizer) {
|
|
20
|
+
return this.serviceFactory.createContainer(createNewSummary, createNewResolvedUrl, logger, clientIsSummarizer);
|
|
21
|
+
}
|
|
22
|
+
async createDocumentService(resolvedUrl, logger, clientIsSummarizer) {
|
|
23
|
+
return this.serviceFactory.createDocumentService(resolvedUrl, logger, clientIsSummarizer);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.DocumentServiceFactoryProxy = DocumentServiceFactoryProxy;
|
|
27
|
+
//# sourceMappingURL=documentServiceFactoryProxy.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"documentServiceFactoryProxy.cjs","sourceRoot":"","sources":["../src/documentServiceFactoryProxy.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAUH;;;GAGG;AAEH,MAAsB,2BAA2B;IAChD,YAA6B,eAAwC;QAAxC,oBAAe,GAAf,eAAe,CAAyB;IAAG,CAAC;IAEzE,IAAW,cAAc;QACxB,OAAO,IAAI,CAAC,eAAe,CAAC;IAC7B,CAAC;IAEM,KAAK,CAAC,eAAe,CAC3B,gBAA0C,EAC1C,oBAAkC,EAClC,MAA6B,EAC7B,kBAA4B;QAE5B,OAAO,IAAI,CAAC,cAAc,CAAC,eAAe,CACzC,gBAAgB,EAChB,oBAAoB,EACpB,MAAM,EACN,kBAAkB,CAClB,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,qBAAqB,CACjC,WAAyB,EACzB,MAA6B,EAC7B,kBAA4B;QAE5B,OAAO,IAAI,CAAC,cAAc,CAAC,qBAAqB,CAAC,WAAW,EAAE,MAAM,EAAE,kBAAkB,CAAC,CAAC;IAC3F,CAAC;CACD;AA5BD,kEA4BC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryBaseLogger } from \"@fluidframework/core-interfaces\";\nimport {\n\tIDocumentService,\n\tIDocumentServiceFactory,\n\tIResolvedUrl,\n} from \"@fluidframework/driver-definitions\";\nimport { ISummaryTree } from \"@fluidframework/protocol-definitions\";\n\n/**\n * This abstract class implements IDocumentServiceFactory interface. It uses delegation pattern.\n * It delegates all calls to IDocumentServiceFactory implementation passed to constructor.\n */\n\nexport abstract class DocumentServiceFactoryProxy implements IDocumentServiceFactory {\n\tconstructor(private readonly _serviceFactory: IDocumentServiceFactory) {}\n\n\tpublic get serviceFactory(): IDocumentServiceFactory {\n\t\treturn this._serviceFactory;\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\treturn this.serviceFactory.createContainer(\n\t\t\tcreateNewSummary,\n\t\t\tcreateNewResolvedUrl,\n\t\t\tlogger,\n\t\t\tclientIsSummarizer,\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.serviceFactory.createDocumentService(resolvedUrl, logger, clientIsSummarizer);\n\t}\n}\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
6
|
+
import { IDocumentService, IDocumentServiceFactory, IResolvedUrl } from "@fluidframework/driver-definitions";
|
|
7
|
+
import { ISummaryTree } from "@fluidframework/protocol-definitions";
|
|
8
|
+
/**
|
|
9
|
+
* This abstract class implements IDocumentServiceFactory interface. It uses delegation pattern.
|
|
10
|
+
* It delegates all calls to IDocumentServiceFactory implementation passed to constructor.
|
|
11
|
+
*/
|
|
12
|
+
export declare abstract class DocumentServiceFactoryProxy implements IDocumentServiceFactory {
|
|
13
|
+
private readonly _serviceFactory;
|
|
14
|
+
constructor(_serviceFactory: IDocumentServiceFactory);
|
|
15
|
+
get serviceFactory(): IDocumentServiceFactory;
|
|
16
|
+
createContainer(createNewSummary: ISummaryTree | undefined, createNewResolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
|
|
17
|
+
createDocumentService(resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=documentServiceFactoryProxy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"documentServiceFactoryProxy.d.ts","sourceRoot":"","sources":["../src/documentServiceFactoryProxy.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EACN,gBAAgB,EAChB,uBAAuB,EACvB,YAAY,EACZ,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAEpE;;;GAGG;AAEH,8BAAsB,2BAA4B,YAAW,uBAAuB;IACvE,OAAO,CAAC,QAAQ,CAAC,eAAe;gBAAf,eAAe,EAAE,uBAAuB;IAErE,IAAW,cAAc,IAAI,uBAAuB,CAEnD;IAEY,eAAe,CAC3B,gBAAgB,EAAE,YAAY,GAAG,SAAS,EAC1C,oBAAoB,EAAE,YAAY,EAClC,MAAM,CAAC,EAAE,oBAAoB,EAC7B,kBAAkB,CAAC,EAAE,OAAO,GAC1B,OAAO,CAAC,gBAAgB,CAAC;IASf,qBAAqB,CACjC,WAAW,EAAE,YAAY,EACzB,MAAM,CAAC,EAAE,oBAAoB,EAC7B,kBAAkB,CAAC,EAAE,OAAO,GAC1B,OAAO,CAAC,gBAAgB,CAAC;CAG5B"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
|
+
* Licensed under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.DocumentServiceProxy = void 0;
|
|
8
|
+
/**
|
|
9
|
+
* This abstract class implements IDocumentService interface. It uses delegation pattern.
|
|
10
|
+
* It delegates all calls to IDocumentService implementation passed to constructor.
|
|
11
|
+
*/
|
|
12
|
+
class DocumentServiceProxy {
|
|
13
|
+
constructor(_service) {
|
|
14
|
+
this._service = _service;
|
|
15
|
+
}
|
|
16
|
+
get service() {
|
|
17
|
+
return this._service;
|
|
18
|
+
}
|
|
19
|
+
async connectToStorage() {
|
|
20
|
+
return this._service.connectToStorage();
|
|
21
|
+
}
|
|
22
|
+
async connectToDeltaStorage() {
|
|
23
|
+
return this._service.connectToDeltaStorage();
|
|
24
|
+
}
|
|
25
|
+
async connectToDeltaStream(client) {
|
|
26
|
+
return this._service.connectToDeltaStream(client);
|
|
27
|
+
}
|
|
28
|
+
dispose(error) {
|
|
29
|
+
this._service.dispose(error);
|
|
30
|
+
}
|
|
31
|
+
get resolvedUrl() {
|
|
32
|
+
return this._service.resolvedUrl;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.DocumentServiceProxy = DocumentServiceProxy;
|
|
36
|
+
//# sourceMappingURL=documentServiceProxy.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"documentServiceProxy.cjs","sourceRoot":"","sources":["../src/documentServiceProxy.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAWH;;;GAGG;AAEH,MAAsB,oBAAoB;IACzC,YAA6B,QAA0B;QAA1B,aAAQ,GAAR,QAAQ,CAAkB;IAAG,CAAC;IAE3D,IAAW,OAAO;QACjB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACtB,CAAC;IAEM,KAAK,CAAC,gBAAgB;QAC5B,OAAO,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,CAAC;IACzC,CAAC;IAEM,KAAK,CAAC,qBAAqB;QACjC,OAAO,IAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE,CAAC;IAC9C,CAAC;IAEM,KAAK,CAAC,oBAAoB,CAAC,MAAe;QAChD,OAAO,IAAI,CAAC,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC;IACnD,CAAC;IAEM,OAAO,CAAC,KAAW;QACzB,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED,IAAW,WAAW;QACrB,OAAO,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC;IAClC,CAAC;CACD;AA1BD,oDA0BC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIDocumentDeltaConnection,\n\tIDocumentDeltaStorageService,\n\tIDocumentService,\n\tIDocumentStorageService,\n\tIResolvedUrl,\n} from \"@fluidframework/driver-definitions\";\nimport { IClient } from \"@fluidframework/protocol-definitions\";\n\n/**\n * This abstract class implements IDocumentService interface. It uses delegation pattern.\n * It delegates all calls to IDocumentService implementation passed to constructor.\n */\n\nexport abstract class DocumentServiceProxy implements IDocumentService {\n\tconstructor(private readonly _service: IDocumentService) {}\n\n\tpublic get service(): IDocumentService {\n\t\treturn this._service;\n\t}\n\n\tpublic async connectToStorage(): Promise<IDocumentStorageService> {\n\t\treturn this._service.connectToStorage();\n\t}\n\n\tpublic async connectToDeltaStorage(): Promise<IDocumentDeltaStorageService> {\n\t\treturn this._service.connectToDeltaStorage();\n\t}\n\n\tpublic async connectToDeltaStream(client: IClient): Promise<IDocumentDeltaConnection> {\n\t\treturn this._service.connectToDeltaStream(client);\n\t}\n\n\tpublic dispose(error?: any): void {\n\t\tthis._service.dispose(error);\n\t}\n\n\tpublic get resolvedUrl(): IResolvedUrl {\n\t\treturn this._service.resolvedUrl;\n\t}\n}\n"]}
|