@fluidframework/odsp-driver 2.0.0-dev.6.4.0.192049 → 2.0.0-dev.7.2.0.204906
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/CHANGELOG.md +66 -0
- package/api-extractor.json +1 -1
- package/api-report/odsp-driver.api.md +306 -0
- package/dist/ReadBufferUtils.js +3 -3
- package/dist/ReadBufferUtils.js.map +1 -1
- package/dist/checkUrl.d.ts +1 -0
- package/dist/checkUrl.d.ts.map +1 -1
- package/dist/checkUrl.js +1 -0
- package/dist/checkUrl.js.map +1 -1
- package/dist/compactSnapshotParser.d.ts +2 -0
- package/dist/compactSnapshotParser.d.ts.map +1 -1
- package/dist/compactSnapshotParser.js +1 -0
- package/dist/compactSnapshotParser.js.map +1 -1
- package/dist/constants.d.ts +6 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +6 -0
- package/dist/constants.js.map +1 -1
- package/dist/contracts.d.ts +3 -3
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contractsPublic.d.ts +15 -0
- package/dist/contractsPublic.d.ts.map +1 -1
- package/dist/contractsPublic.js +8 -2
- package/dist/contractsPublic.js.map +1 -1
- package/dist/createOdspCreateContainerRequest.d.ts +1 -0
- package/dist/createOdspCreateContainerRequest.d.ts.map +1 -1
- package/dist/createOdspCreateContainerRequest.js +1 -0
- package/dist/createOdspCreateContainerRequest.js.map +1 -1
- package/dist/createOdspUrl.d.ts +1 -0
- package/dist/createOdspUrl.d.ts.map +1 -1
- package/dist/createOdspUrl.js +1 -0
- package/dist/createOdspUrl.js.map +1 -1
- package/dist/epochTracker.d.ts +12 -2
- package/dist/epochTracker.d.ts.map +1 -1
- package/dist/epochTracker.js +1 -0
- package/dist/epochTracker.js.map +1 -1
- package/dist/fetch.d.ts +1 -1
- package/dist/fetch.d.ts.map +1 -1
- package/dist/fetchSnapshot.d.ts +1 -0
- package/dist/fetchSnapshot.d.ts.map +1 -1
- package/dist/fetchSnapshot.js +15 -11
- package/dist/fetchSnapshot.js.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/odsp-driver-alpha.d.ts +558 -0
- package/dist/odsp-driver-beta.d.ts +558 -0
- package/dist/odsp-driver-public.d.ts +558 -0
- package/dist/odsp-driver-untrimmed.d.ts +558 -0
- package/dist/odspCache.d.ts +6 -0
- package/dist/odspCache.d.ts.map +1 -1
- package/dist/odspCache.js.map +1 -1
- package/dist/odspDocumentDeltaConnection.d.ts +1 -1
- package/dist/odspDocumentDeltaConnection.d.ts.map +1 -1
- package/dist/odspDocumentDeltaConnection.js +78 -69
- package/dist/odspDocumentDeltaConnection.js.map +1 -1
- package/dist/odspDocumentService.js +23 -19
- package/dist/odspDocumentService.js.map +1 -1
- package/dist/odspDocumentServiceFactory.d.ts +4 -0
- package/dist/odspDocumentServiceFactory.d.ts.map +1 -1
- package/dist/odspDocumentServiceFactory.js +4 -0
- package/dist/odspDocumentServiceFactory.js.map +1 -1
- package/dist/odspDocumentServiceFactoryCore.d.ts +1 -0
- package/dist/odspDocumentServiceFactoryCore.d.ts.map +1 -1
- package/dist/odspDocumentServiceFactoryCore.js +32 -27
- package/dist/odspDocumentServiceFactoryCore.js.map +1 -1
- package/dist/odspDocumentServiceFactoryWithCodeSplit.d.ts +2 -1
- package/dist/odspDocumentServiceFactoryWithCodeSplit.d.ts.map +1 -1
- package/dist/odspDocumentServiceFactoryWithCodeSplit.js +2 -1
- package/dist/odspDocumentServiceFactoryWithCodeSplit.js.map +1 -1
- package/dist/odspDocumentStorageManager.js +5 -1
- package/dist/odspDocumentStorageManager.js.map +1 -1
- package/dist/odspDocumentStorageServiceBase.d.ts +1 -1
- package/dist/odspDocumentStorageServiceBase.d.ts.map +1 -1
- package/dist/odspDocumentStorageServiceBase.js +1 -14
- package/dist/odspDocumentStorageServiceBase.js.map +1 -1
- package/dist/odspDriverUrlResolver.d.ts +1 -0
- package/dist/odspDriverUrlResolver.d.ts.map +1 -1
- package/dist/odspDriverUrlResolver.js +2 -0
- package/dist/odspDriverUrlResolver.js.map +1 -1
- package/dist/odspDriverUrlResolverForShareLink.d.ts +2 -0
- package/dist/odspDriverUrlResolverForShareLink.d.ts.map +1 -1
- package/dist/odspDriverUrlResolverForShareLink.js +1 -0
- package/dist/odspDriverUrlResolverForShareLink.js.map +1 -1
- package/dist/odspFluidFileLink.d.ts +10 -1
- package/dist/odspFluidFileLink.d.ts.map +1 -1
- package/dist/odspFluidFileLink.js +14 -6
- package/dist/odspFluidFileLink.js.map +1 -1
- package/dist/odspPublicUtils.d.ts +6 -0
- package/dist/odspPublicUtils.d.ts.map +1 -1
- package/dist/odspPublicUtils.js +3 -0
- package/dist/odspPublicUtils.js.map +1 -1
- package/dist/odspSummaryUploadManager.js +5 -1
- package/dist/odspSummaryUploadManager.js.map +1 -1
- package/dist/odspUrlHelper.d.ts +5 -0
- package/dist/odspUrlHelper.d.ts.map +1 -1
- package/dist/odspUrlHelper.js +5 -0
- package/dist/odspUrlHelper.js.map +1 -1
- package/dist/odspUtils.d.ts +4 -1
- package/dist/odspUtils.d.ts.map +1 -1
- package/dist/odspUtils.js +1 -0
- package/dist/odspUtils.js.map +1 -1
- package/dist/opsCaching.d.ts +1 -1
- package/dist/opsCaching.d.ts.map +1 -1
- package/dist/opsCaching.js +13 -1
- package/dist/opsCaching.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/prefetchLatestSnapshot.d.ts +2 -0
- package/dist/prefetchLatestSnapshot.d.ts.map +1 -1
- package/dist/prefetchLatestSnapshot.js +2 -0
- package/dist/prefetchLatestSnapshot.js.map +1 -1
- package/dist/socketModule.d.ts +7 -0
- package/dist/socketModule.d.ts.map +1 -0
- package/dist/socketModule.js +10 -0
- package/dist/socketModule.js.map +1 -0
- package/dist/tsdoc-metadata.json +1 -1
- package/dist/zipItDataRepresentationUtils.d.ts +2 -2
- package/dist/zipItDataRepresentationUtils.d.ts.map +1 -1
- package/dist/zipItDataRepresentationUtils.js +6 -6
- package/dist/zipItDataRepresentationUtils.js.map +1 -1
- package/lib/ReadBufferUtils.js +3 -3
- package/lib/ReadBufferUtils.js.map +1 -1
- package/lib/checkUrl.d.ts +1 -0
- package/lib/checkUrl.d.ts.map +1 -1
- package/lib/checkUrl.js +1 -0
- package/lib/checkUrl.js.map +1 -1
- package/lib/compactSnapshotParser.d.ts +2 -0
- package/lib/compactSnapshotParser.d.ts.map +1 -1
- package/lib/compactSnapshotParser.js +1 -0
- package/lib/compactSnapshotParser.js.map +1 -1
- package/lib/constants.d.ts +6 -0
- package/lib/constants.d.ts.map +1 -1
- package/lib/constants.js +6 -0
- package/lib/constants.js.map +1 -1
- package/lib/contracts.d.ts +3 -3
- package/lib/contracts.d.ts.map +1 -1
- package/lib/contractsPublic.d.ts +15 -0
- package/lib/contractsPublic.d.ts.map +1 -1
- package/lib/contractsPublic.js +6 -0
- package/lib/contractsPublic.js.map +1 -1
- package/lib/createOdspCreateContainerRequest.d.ts +1 -0
- package/lib/createOdspCreateContainerRequest.d.ts.map +1 -1
- package/lib/createOdspCreateContainerRequest.js +1 -0
- package/lib/createOdspCreateContainerRequest.js.map +1 -1
- package/lib/createOdspUrl.d.ts +1 -0
- package/lib/createOdspUrl.d.ts.map +1 -1
- package/lib/createOdspUrl.js +1 -0
- package/lib/createOdspUrl.js.map +1 -1
- package/lib/epochTracker.d.ts +12 -2
- package/lib/epochTracker.d.ts.map +1 -1
- package/lib/epochTracker.js +1 -0
- package/lib/epochTracker.js.map +1 -1
- package/lib/fetch.d.ts +1 -1
- package/lib/fetch.d.ts.map +1 -1
- package/lib/fetchSnapshot.d.ts +1 -0
- package/lib/fetchSnapshot.d.ts.map +1 -1
- package/lib/fetchSnapshot.js +14 -10
- package/lib/fetchSnapshot.js.map +1 -1
- package/lib/index.d.ts +5 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/odspCache.d.ts +6 -0
- package/lib/odspCache.d.ts.map +1 -1
- package/lib/odspCache.js.map +1 -1
- package/lib/odspDocumentDeltaConnection.d.ts +1 -1
- package/lib/odspDocumentDeltaConnection.d.ts.map +1 -1
- package/lib/odspDocumentDeltaConnection.js +77 -68
- package/lib/odspDocumentDeltaConnection.js.map +1 -1
- package/lib/odspDocumentService.js +18 -18
- package/lib/odspDocumentService.js.map +1 -1
- package/lib/odspDocumentServiceFactory.d.ts +4 -0
- package/lib/odspDocumentServiceFactory.d.ts.map +1 -1
- package/lib/odspDocumentServiceFactory.js +4 -0
- package/lib/odspDocumentServiceFactory.js.map +1 -1
- package/lib/odspDocumentServiceFactoryCore.d.ts +1 -0
- package/lib/odspDocumentServiceFactoryCore.d.ts.map +1 -1
- package/lib/odspDocumentServiceFactoryCore.js +27 -26
- package/lib/odspDocumentServiceFactoryCore.js.map +1 -1
- package/lib/odspDocumentServiceFactoryWithCodeSplit.d.ts +2 -1
- package/lib/odspDocumentServiceFactoryWithCodeSplit.d.ts.map +1 -1
- package/lib/odspDocumentServiceFactoryWithCodeSplit.js +2 -1
- package/lib/odspDocumentServiceFactoryWithCodeSplit.js.map +1 -1
- package/lib/odspDocumentStorageServiceBase.d.ts +1 -1
- package/lib/odspDocumentStorageServiceBase.d.ts.map +1 -1
- package/lib/odspDocumentStorageServiceBase.js +1 -14
- package/lib/odspDocumentStorageServiceBase.js.map +1 -1
- package/lib/odspDriverUrlResolver.d.ts +1 -0
- package/lib/odspDriverUrlResolver.d.ts.map +1 -1
- package/lib/odspDriverUrlResolver.js +2 -0
- package/lib/odspDriverUrlResolver.js.map +1 -1
- package/lib/odspDriverUrlResolverForShareLink.d.ts +2 -0
- package/lib/odspDriverUrlResolverForShareLink.d.ts.map +1 -1
- package/lib/odspDriverUrlResolverForShareLink.js +1 -0
- package/lib/odspDriverUrlResolverForShareLink.js.map +1 -1
- package/lib/odspFluidFileLink.d.ts +10 -1
- package/lib/odspFluidFileLink.d.ts.map +1 -1
- package/lib/odspFluidFileLink.js +14 -6
- package/lib/odspFluidFileLink.js.map +1 -1
- package/lib/odspPublicUtils.d.ts +6 -0
- package/lib/odspPublicUtils.d.ts.map +1 -1
- package/lib/odspPublicUtils.js +3 -0
- package/lib/odspPublicUtils.js.map +1 -1
- package/lib/odspUrlHelper.d.ts +5 -0
- package/lib/odspUrlHelper.d.ts.map +1 -1
- package/lib/odspUrlHelper.js +5 -0
- package/lib/odspUrlHelper.js.map +1 -1
- package/lib/odspUtils.d.ts +4 -1
- package/lib/odspUtils.d.ts.map +1 -1
- package/lib/odspUtils.js +1 -0
- package/lib/odspUtils.js.map +1 -1
- package/lib/opsCaching.d.ts +1 -1
- package/lib/opsCaching.d.ts.map +1 -1
- package/lib/opsCaching.js +13 -1
- package/lib/opsCaching.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/prefetchLatestSnapshot.d.ts +2 -0
- package/lib/prefetchLatestSnapshot.d.ts.map +1 -1
- package/lib/prefetchLatestSnapshot.js +2 -0
- package/lib/prefetchLatestSnapshot.js.map +1 -1
- package/lib/socketModule.d.ts +7 -0
- package/lib/socketModule.d.ts.map +1 -0
- package/lib/socketModule.js +7 -0
- package/lib/socketModule.js.map +1 -0
- package/lib/zipItDataRepresentationUtils.d.ts +2 -2
- package/lib/zipItDataRepresentationUtils.d.ts.map +1 -1
- package/lib/zipItDataRepresentationUtils.js +3 -3
- package/lib/zipItDataRepresentationUtils.js.map +1 -1
- package/package.json +24 -26
- package/src/checkUrl.ts +1 -0
- package/src/compactSnapshotParser.ts +2 -0
- package/src/constants.ts +7 -0
- package/src/contractsPublic.ts +15 -1
- package/src/createOdspCreateContainerRequest.ts +1 -0
- package/src/createOdspUrl.ts +1 -0
- package/src/epochTracker.ts +10 -0
- package/src/fetchSnapshot.ts +16 -15
- package/src/index.ts +10 -1
- package/src/odspCache.ts +6 -0
- package/src/odspDocumentDeltaConnection.ts +56 -32
- package/src/odspDocumentServiceFactory.ts +4 -0
- package/src/odspDocumentServiceFactoryCore.ts +1 -0
- package/src/odspDocumentServiceFactoryWithCodeSplit.ts +2 -1
- package/src/odspDocumentStorageServiceBase.ts +1 -15
- package/src/odspDriverUrlResolver.ts +2 -0
- package/src/odspDriverUrlResolverForShareLink.ts +2 -0
- package/src/odspFluidFileLink.ts +21 -5
- package/src/odspPublicUtils.ts +6 -0
- package/src/odspUrlHelper.ts +5 -0
- package/src/odspUtils.ts +4 -0
- package/src/opsCaching.ts +15 -1
- package/src/packageVersion.ts +1 -1
- package/src/prefetchLatestSnapshot.ts +2 -0
- package/src/socketModule.ts +8 -0
- package/src/zipItDataRepresentationUtils.ts +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,71 @@
|
|
|
1
1
|
# @fluidframework/odsp-driver
|
|
2
2
|
|
|
3
|
+
## 2.0.0-internal.7.1.0
|
|
4
|
+
|
|
5
|
+
Dependency updates only.
|
|
6
|
+
|
|
7
|
+
## 2.0.0-internal.7.0.0
|
|
8
|
+
|
|
9
|
+
### Major Changes
|
|
10
|
+
|
|
11
|
+
- Dependencies on @fluidframework/protocol-definitions package updated to 3.0.0 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
|
|
12
|
+
|
|
13
|
+
This included the following changes from the protocol-definitions release:
|
|
14
|
+
|
|
15
|
+
- Updating signal interfaces for some planned improvements. The intention is split the interface between signals
|
|
16
|
+
submitted by clients to the server and the resulting signals sent from the server to clients.
|
|
17
|
+
- A new optional type member is available on the ISignalMessage interface and a new ISentSignalMessage interface has
|
|
18
|
+
been added, which will be the typing for signals sent from the client to the server. Both extend a new
|
|
19
|
+
ISignalMessageBase interface that contains common members.
|
|
20
|
+
- The @fluidframework/common-definitions package dependency has been updated to version 1.0.0.
|
|
21
|
+
|
|
22
|
+
- routerlicious-driver: remove dead blob aggregation concepts and code [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
|
|
23
|
+
|
|
24
|
+
Dead concepts blob aggregation like `aggregateBlobsSmallerThanBytes` and `minBlobSize` have been removed.
|
|
25
|
+
|
|
26
|
+
- Server upgrade: dependencies on Fluid server packages updated to 2.0.1 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
|
|
27
|
+
|
|
28
|
+
Dependencies on the following Fluid server package have been updated to version 2.0.1:
|
|
29
|
+
|
|
30
|
+
- @fluidframework/gitresources: 2.0.1
|
|
31
|
+
- @fluidframework/server-kafka-orderer: 2.0.1
|
|
32
|
+
- @fluidframework/server-lambdas: 2.0.1
|
|
33
|
+
- @fluidframework/server-lambdas-driver: 2.0.1
|
|
34
|
+
- @fluidframework/server-local-server: 2.0.1
|
|
35
|
+
- @fluidframework/server-memory-orderer: 2.0.1
|
|
36
|
+
- @fluidframework/protocol-base: 2.0.1
|
|
37
|
+
- @fluidframework/server-routerlicious: 2.0.1
|
|
38
|
+
- @fluidframework/server-routerlicious-base: 2.0.1
|
|
39
|
+
- @fluidframework/server-services: 2.0.1
|
|
40
|
+
- @fluidframework/server-services-client: 2.0.1
|
|
41
|
+
- @fluidframework/server-services-core: 2.0.1
|
|
42
|
+
- @fluidframework/server-services-ordering-kafkanode: 2.0.1
|
|
43
|
+
- @fluidframework/server-services-ordering-rdkafka: 2.0.1
|
|
44
|
+
- @fluidframework/server-services-ordering-zookeeper: 2.0.1
|
|
45
|
+
- @fluidframework/server-services-shared: 2.0.1
|
|
46
|
+
- @fluidframework/server-services-telemetry: 2.0.1
|
|
47
|
+
- @fluidframework/server-services-utils: 2.0.1
|
|
48
|
+
- @fluidframework/server-test-utils: 2.0.1
|
|
49
|
+
- tinylicious: 2.0.1
|
|
50
|
+
|
|
51
|
+
- Minimum TypeScript version now 5.1.6 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
|
|
52
|
+
|
|
53
|
+
The minimum supported TypeScript version for Fluid 2.0 clients is now 5.1.6.
|
|
54
|
+
|
|
55
|
+
## 2.0.0-internal.6.4.0
|
|
56
|
+
|
|
57
|
+
### Minor Changes
|
|
58
|
+
|
|
59
|
+
- Upcoming: The type of the logger property/param in various APIs will be changing ([#17350](https://github.com/microsoft/FluidFramework/issues/17350)) [27284bcda3](https://github.com/microsoft/FluidFramework/commits/27284bcda3d63cc4306cf76806f8a075db0db60f)
|
|
60
|
+
|
|
61
|
+
- @fluidframework/runtime-definitions
|
|
62
|
+
- `IFluidDataStoreRuntime.logger` will be re-typed as `ITelemetryBaseLogger`
|
|
63
|
+
- @fluidframework/odsp-driver
|
|
64
|
+
- `protected OdspDocumentServiceFactoryCore.createDocumentServiceCore`'s parameter `odspLogger` will be re-typed as `ITelemetryLoggerExt`
|
|
65
|
+
- `protected LocalOdspDocumentServiceFactory.createDocumentServiceCore`'s parameter `odspLogger` will be re-typed as `ITelemetryLoggerExt`
|
|
66
|
+
|
|
67
|
+
Additionally, several of @fluidframework/telemetry-utils's exports are being marked as internal and should not be consumed outside of other FF packages.
|
|
68
|
+
|
|
3
69
|
## 2.0.0-internal.6.3.0
|
|
4
70
|
|
|
5
71
|
Dependency updates only.
|
package/api-extractor.json
CHANGED
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
## API Report File for "@fluidframework/odsp-driver"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
|
|
7
|
+
import { DriverPreCheckInfo } from '@fluidframework/driver-definitions';
|
|
8
|
+
import { HostStoragePolicy } from '@fluidframework/odsp-driver-definitions';
|
|
9
|
+
import { IContainerPackageInfo } from '@fluidframework/driver-definitions';
|
|
10
|
+
import { IdentityType } from '@fluidframework/odsp-driver-definitions';
|
|
11
|
+
import { IDocumentService } from '@fluidframework/driver-definitions';
|
|
12
|
+
import { IDocumentServiceFactory } from '@fluidframework/driver-definitions';
|
|
13
|
+
import { IEntry } from '@fluidframework/odsp-driver-definitions';
|
|
14
|
+
import { IFileEntry } from '@fluidframework/odsp-driver-definitions';
|
|
15
|
+
import { IOdspResolvedUrl } from '@fluidframework/odsp-driver-definitions';
|
|
16
|
+
import { IOdspUrlParts } from '@fluidframework/odsp-driver-definitions';
|
|
17
|
+
import { IPersistedCache } from '@fluidframework/odsp-driver-definitions';
|
|
18
|
+
import { IRelaySessionAwareDriverFactory } from '@fluidframework/odsp-driver-definitions';
|
|
19
|
+
import { IRequest } from '@fluidframework/core-interfaces';
|
|
20
|
+
import { IResolvedUrl } from '@fluidframework/driver-definitions';
|
|
21
|
+
import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
|
|
22
|
+
import { ISharingLinkKind } from '@fluidframework/odsp-driver-definitions';
|
|
23
|
+
import { ISnapshotOptions } from '@fluidframework/odsp-driver-definitions';
|
|
24
|
+
import { ISnapshotTree } from '@fluidframework/protocol-definitions';
|
|
25
|
+
import { ISocketStorageDiscovery } from '@fluidframework/odsp-driver-definitions';
|
|
26
|
+
import { ISummaryTree } from '@fluidframework/protocol-definitions';
|
|
27
|
+
import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
|
|
28
|
+
import { ITelemetryLogger } from '@fluidframework/core-interfaces';
|
|
29
|
+
import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
|
|
30
|
+
import { ITelemetryProperties } from '@fluidframework/core-interfaces';
|
|
31
|
+
import { IUrlResolver } from '@fluidframework/driver-definitions';
|
|
32
|
+
import { OdspResourceTokenFetchOptions } from '@fluidframework/odsp-driver-definitions';
|
|
33
|
+
import { PromiseCache } from '@fluidframework/core-utils';
|
|
34
|
+
import { RateLimiter } from '@fluidframework/driver-utils';
|
|
35
|
+
import { ShareLinkTypes } from '@fluidframework/odsp-driver-definitions';
|
|
36
|
+
import { TokenFetcher } from '@fluidframework/odsp-driver-definitions';
|
|
37
|
+
|
|
38
|
+
// @public
|
|
39
|
+
export function checkUrl(documentUrl: URL): DriverPreCheckInfo | undefined;
|
|
40
|
+
|
|
41
|
+
// @public (undocumented)
|
|
42
|
+
export enum ClpCompliantAppHeader {
|
|
43
|
+
// (undocumented)
|
|
44
|
+
isClpCompliantApp = "X-CLP-Compliant-App"
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// @public (undocumented)
|
|
48
|
+
export function createLocalOdspDocumentServiceFactory(localSnapshot: Uint8Array | string): IDocumentServiceFactory;
|
|
49
|
+
|
|
50
|
+
// @public
|
|
51
|
+
export function createOdspCreateContainerRequest(siteUrl: string, driveId: string, filePath: string, fileName: string, createShareLinkType?: ShareLinkTypes | ISharingLinkKind): IRequest;
|
|
52
|
+
|
|
53
|
+
// @public
|
|
54
|
+
export function createOdspUrl(l: OdspFluidDataStoreLocator): string;
|
|
55
|
+
|
|
56
|
+
// @public
|
|
57
|
+
export function encodeOdspFluidDataStoreLocator(locator: OdspFluidDataStoreLocator): string;
|
|
58
|
+
|
|
59
|
+
// @public
|
|
60
|
+
export class EpochTracker implements IPersistedFileCache {
|
|
61
|
+
constructor(cache: IPersistedCache, fileEntry: IFileEntry, logger: ITelemetryLoggerExt, clientIsSummarizer?: boolean | undefined);
|
|
62
|
+
// (undocumented)
|
|
63
|
+
protected readonly cache: IPersistedCache;
|
|
64
|
+
// (undocumented)
|
|
65
|
+
protected readonly clientIsSummarizer?: boolean | undefined;
|
|
66
|
+
fetch(url: string, fetchOptions: RequestInit, fetchType: FetchType, addInBody?: boolean, fetchReason?: string): Promise<IOdspResponse<Response>>;
|
|
67
|
+
fetchAndParseAsJSON<T>(url: string, fetchOptions: RequestInit, fetchType: FetchType, addInBody?: boolean, fetchReason?: string): Promise<IOdspResponse<T>>;
|
|
68
|
+
fetchArray(url: string, fetchOptions: {
|
|
69
|
+
[index: string]: any;
|
|
70
|
+
}, fetchType: FetchType, addInBody?: boolean, fetchReason?: string): Promise<IOdspResponse<ArrayBuffer>>;
|
|
71
|
+
// (undocumented)
|
|
72
|
+
protected readonly fileEntry: IFileEntry;
|
|
73
|
+
// (undocumented)
|
|
74
|
+
get fluidEpoch(): string | undefined;
|
|
75
|
+
// (undocumented)
|
|
76
|
+
get(entry: IEntry): Promise<any>;
|
|
77
|
+
// (undocumented)
|
|
78
|
+
protected readonly logger: ITelemetryLoggerExt;
|
|
79
|
+
// (undocumented)
|
|
80
|
+
put(entry: IEntry, value: any): Promise<void>;
|
|
81
|
+
// (undocumented)
|
|
82
|
+
readonly rateLimiter: RateLimiter;
|
|
83
|
+
// (undocumented)
|
|
84
|
+
removeEntries(): Promise<void>;
|
|
85
|
+
// (undocumented)
|
|
86
|
+
setEpoch(epoch: string, fromCache: boolean, fetchType: FetchTypeInternal): void;
|
|
87
|
+
// (undocumented)
|
|
88
|
+
validateEpoch(epoch: string | undefined, fetchType: FetchType): Promise<void>;
|
|
89
|
+
// (undocumented)
|
|
90
|
+
protected validateEpochFromResponse(epochFromResponse: string | undefined, fetchType: FetchTypeInternal, fromCache?: boolean): void;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// @public (undocumented)
|
|
94
|
+
export type FetchType = "blob" | "createBlob" | "createFile" | "joinSession" | "ops" | "test" | "snapshotTree" | "treesLatest" | "uploadSummary" | "push" | "versions";
|
|
95
|
+
|
|
96
|
+
// @public (undocumented)
|
|
97
|
+
export type FetchTypeInternal = FetchType | "cache";
|
|
98
|
+
|
|
99
|
+
// @public
|
|
100
|
+
export function getApiRoot(origin: string): string;
|
|
101
|
+
|
|
102
|
+
// @public (undocumented)
|
|
103
|
+
export function getHashedDocumentId(driveId: string, itemId: string): Promise<string>;
|
|
104
|
+
|
|
105
|
+
// @public
|
|
106
|
+
export function getLocatorFromOdspUrl(url: URL, requireFluidSignature?: boolean): OdspFluidDataStoreLocator | undefined;
|
|
107
|
+
|
|
108
|
+
// @public
|
|
109
|
+
export function getOdspUrlParts(url: URL): Promise<IOdspUrlParts | undefined>;
|
|
110
|
+
|
|
111
|
+
// @public (undocumented)
|
|
112
|
+
export interface ICacheAndTracker {
|
|
113
|
+
// (undocumented)
|
|
114
|
+
cache: IOdspCache;
|
|
115
|
+
// (undocumented)
|
|
116
|
+
epochTracker: EpochTracker;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// @public (undocumented)
|
|
120
|
+
export interface IClpCompliantAppHeader {
|
|
121
|
+
// (undocumented)
|
|
122
|
+
[ClpCompliantAppHeader.isClpCompliantApp]: boolean;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// @public
|
|
126
|
+
export interface INonPersistentCache {
|
|
127
|
+
readonly fileUrlCache: PromiseCache<string, IOdspResolvedUrl>;
|
|
128
|
+
readonly sessionJoinCache: PromiseCache<string, {
|
|
129
|
+
entryTime: number;
|
|
130
|
+
joinSessionResponse: ISocketStorageDiscovery;
|
|
131
|
+
}>;
|
|
132
|
+
readonly snapshotPrefetchResultCache: PromiseCache<string, IPrefetchSnapshotContents>;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// @public
|
|
136
|
+
export interface IOdspCache extends INonPersistentCache {
|
|
137
|
+
readonly persistedCache: IPersistedFileCache;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// @public (undocumented)
|
|
141
|
+
export interface IOdspResponse<T> {
|
|
142
|
+
// (undocumented)
|
|
143
|
+
content: T;
|
|
144
|
+
// (undocumented)
|
|
145
|
+
duration: number;
|
|
146
|
+
// (undocumented)
|
|
147
|
+
headers: Map<string, string>;
|
|
148
|
+
// (undocumented)
|
|
149
|
+
propsToLog: ITelemetryProperties;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// @public
|
|
153
|
+
export interface IPersistedFileCache {
|
|
154
|
+
// (undocumented)
|
|
155
|
+
get(entry: IEntry): Promise<any>;
|
|
156
|
+
// (undocumented)
|
|
157
|
+
put(entry: IEntry, value: any): Promise<void>;
|
|
158
|
+
// (undocumented)
|
|
159
|
+
removeEntries(): Promise<void>;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// @public (undocumented)
|
|
163
|
+
export interface IPrefetchSnapshotContents extends ISnapshotContents {
|
|
164
|
+
// (undocumented)
|
|
165
|
+
fluidEpoch: string;
|
|
166
|
+
// (undocumented)
|
|
167
|
+
prefetchStartTime: number;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// @public (undocumented)
|
|
171
|
+
export interface ISharingLinkHeader {
|
|
172
|
+
// (undocumented)
|
|
173
|
+
[SharingLinkHeader.isSharingLinkToRedeem]: boolean;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// @public (undocumented)
|
|
177
|
+
export interface ISnapshotContents {
|
|
178
|
+
// (undocumented)
|
|
179
|
+
blobs: Map<string, ArrayBuffer>;
|
|
180
|
+
latestSequenceNumber: number | undefined;
|
|
181
|
+
// (undocumented)
|
|
182
|
+
ops: ISequencedDocumentMessage[];
|
|
183
|
+
sequenceNumber: number | undefined;
|
|
184
|
+
// (undocumented)
|
|
185
|
+
snapshotTree: ISnapshotTree;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// @public
|
|
189
|
+
export interface ISnapshotContentsWithProps extends ISnapshotContents {
|
|
190
|
+
// (undocumented)
|
|
191
|
+
telemetryProps: Record<string, number>;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// @public
|
|
195
|
+
export function isOdcOrigin(origin: string): boolean;
|
|
196
|
+
|
|
197
|
+
// @public
|
|
198
|
+
export function isOdcUrl(url: string | URL): boolean;
|
|
199
|
+
|
|
200
|
+
// @public
|
|
201
|
+
export function isSpoUrl(url: string): boolean;
|
|
202
|
+
|
|
203
|
+
// @public
|
|
204
|
+
export const locatorQueryParamName = "nav";
|
|
205
|
+
|
|
206
|
+
// @public (undocumented)
|
|
207
|
+
export const OdcApiSiteOrigin = "https://my.microsoftpersonalcontent.com";
|
|
208
|
+
|
|
209
|
+
// @public (undocumented)
|
|
210
|
+
export const OdcFileSiteOrigin = "https://1drv.ms";
|
|
211
|
+
|
|
212
|
+
// @public
|
|
213
|
+
export class OdspDocumentServiceFactory extends OdspDocumentServiceFactoryCore {
|
|
214
|
+
constructor(getStorageToken: TokenFetcher<OdspResourceTokenFetchOptions>, getWebsocketToken: TokenFetcher<OdspResourceTokenFetchOptions> | undefined, persistedCache?: IPersistedCache, hostPolicy?: HostStoragePolicy);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
// @public
|
|
218
|
+
export class OdspDocumentServiceFactoryCore implements IDocumentServiceFactory, IRelaySessionAwareDriverFactory {
|
|
219
|
+
constructor(getStorageToken: TokenFetcher<OdspResourceTokenFetchOptions>, getWebsocketToken: TokenFetcher<OdspResourceTokenFetchOptions> | undefined, persistedCache?: IPersistedCache, hostPolicy?: HostStoragePolicy);
|
|
220
|
+
// (undocumented)
|
|
221
|
+
createContainer(createNewSummary: ISummaryTree | undefined, createNewResolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
|
|
222
|
+
// (undocumented)
|
|
223
|
+
createDocumentService(resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
|
|
224
|
+
// (undocumented)
|
|
225
|
+
protected createDocumentServiceCore(resolvedUrl: IResolvedUrl, odspLogger: ITelemetryLogger, cacheAndTrackerArg?: ICacheAndTracker, clientIsSummarizer?: boolean): Promise<IDocumentService>;
|
|
226
|
+
getRelayServiceSessionInfo(resolvedUrl: IResolvedUrl): Promise<ISocketStorageDiscovery | undefined>;
|
|
227
|
+
// (undocumented)
|
|
228
|
+
get IRelaySessionAwareDriverFactory(): this;
|
|
229
|
+
// (undocumented)
|
|
230
|
+
protected persistedCache: IPersistedCache;
|
|
231
|
+
// (undocumented)
|
|
232
|
+
get snapshotPrefetchResultCache(): PromiseCache<string, IPrefetchSnapshotContents>;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// @public @deprecated (undocumented)
|
|
236
|
+
export class OdspDocumentServiceFactoryWithCodeSplit extends OdspDocumentServiceFactoryCore implements IDocumentServiceFactory {
|
|
237
|
+
constructor(getStorageToken: TokenFetcher<OdspResourceTokenFetchOptions>, getWebsocketToken: TokenFetcher<OdspResourceTokenFetchOptions> | undefined, persistedCache?: IPersistedCache, hostPolicy?: HostStoragePolicy);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
// @public
|
|
241
|
+
export class OdspDriverUrlResolver implements IUrlResolver {
|
|
242
|
+
constructor();
|
|
243
|
+
getAbsoluteUrl(resolvedUrl: IResolvedUrl, relativeUrl: string, packageInfoSource?: IContainerPackageInfo): Promise<string>;
|
|
244
|
+
// (undocumented)
|
|
245
|
+
resolve(request: IRequest): Promise<IOdspResolvedUrl>;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
// @public
|
|
249
|
+
export class OdspDriverUrlResolverForShareLink implements IUrlResolver {
|
|
250
|
+
constructor(shareLinkFetcherProps?: ShareLinkFetcherProps | undefined, logger?: ITelemetryBaseLogger, appName?: string | undefined, getContext?: ((resolvedUrl: IOdspResolvedUrl, dataStorePath: string) => Promise<string | undefined>) | undefined);
|
|
251
|
+
appendDataStorePath(requestUrl: URL, pathToAppend: string): string | undefined;
|
|
252
|
+
static createDocumentUrl(baseUrl: string, driverInfo: OdspFluidDataStoreLocator): string;
|
|
253
|
+
// @deprecated
|
|
254
|
+
static createNavParam(locator: OdspFluidDataStoreLocator): string;
|
|
255
|
+
getAbsoluteUrl(resolvedUrl: IResolvedUrl, dataStorePath: string, packageInfoSource?: IContainerPackageInfo): Promise<string>;
|
|
256
|
+
resolve(request: IRequest): Promise<IOdspResolvedUrl>;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
// @public (undocumented)
|
|
260
|
+
export interface OdspFluidDataStoreLocator extends IOdspUrlParts {
|
|
261
|
+
// (undocumented)
|
|
262
|
+
appName?: string;
|
|
263
|
+
// (undocumented)
|
|
264
|
+
containerPackageName?: string;
|
|
265
|
+
// (undocumented)
|
|
266
|
+
context?: string;
|
|
267
|
+
// (undocumented)
|
|
268
|
+
dataStorePath: string;
|
|
269
|
+
// (undocumented)
|
|
270
|
+
fileVersion?: string;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
// @public
|
|
274
|
+
export function parseCompactSnapshotResponse(buffer: Uint8Array, logger: ITelemetryLoggerExt): ISnapshotContentsWithProps;
|
|
275
|
+
|
|
276
|
+
// @public
|
|
277
|
+
export function prefetchLatestSnapshot(resolvedUrl: IResolvedUrl, getStorageToken: TokenFetcher<OdspResourceTokenFetchOptions>, persistedCache: IPersistedCache, forceAccessTokenViaAuthorizationHeader: boolean, logger: ITelemetryBaseLogger, hostSnapshotFetchOptions: ISnapshotOptions | undefined, enableRedeemFallback?: boolean, fetchBinarySnapshotFormat?: boolean, snapshotFormatFetchType?: SnapshotFormatSupportType, odspDocumentServiceFactory?: OdspDocumentServiceFactory): Promise<boolean>;
|
|
278
|
+
|
|
279
|
+
// @public
|
|
280
|
+
export interface ShareLinkFetcherProps {
|
|
281
|
+
identityType: IdentityType;
|
|
282
|
+
tokenFetcher: TokenFetcher<OdspResourceTokenFetchOptions>;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
// @public (undocumented)
|
|
286
|
+
export enum SharingLinkHeader {
|
|
287
|
+
// (undocumented)
|
|
288
|
+
isSharingLinkToRedeem = "isSharingLinkToRedeem"
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
// @public
|
|
292
|
+
export enum SnapshotFormatSupportType {
|
|
293
|
+
// (undocumented)
|
|
294
|
+
Binary = 1,
|
|
295
|
+
// (undocumented)
|
|
296
|
+
Json = 0,
|
|
297
|
+
// (undocumented)
|
|
298
|
+
JsonAndBinary = 2
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
// @public
|
|
302
|
+
export function storeLocatorInOdspUrl(url: URL, locator: OdspFluidDataStoreLocator): void;
|
|
303
|
+
|
|
304
|
+
// (No @packageDocumentation comment for this package)
|
|
305
|
+
|
|
306
|
+
```
|
package/dist/ReadBufferUtils.js
CHANGED
|
@@ -11,6 +11,9 @@ const core_utils_1 = require("@fluidframework/core-utils");
|
|
|
11
11
|
* Used by tree code to reconstruct a tree from binary representation.
|
|
12
12
|
*/
|
|
13
13
|
class ReadBuffer {
|
|
14
|
+
get buffer() {
|
|
15
|
+
return this.data;
|
|
16
|
+
}
|
|
14
17
|
constructor(data) {
|
|
15
18
|
this.data = data;
|
|
16
19
|
this.index = 0;
|
|
@@ -19,9 +22,6 @@ class ReadBuffer {
|
|
|
19
22
|
// catastrophic result and will be really hard to investigate.
|
|
20
23
|
Object.freeze(data.buffer);
|
|
21
24
|
}
|
|
22
|
-
get buffer() {
|
|
23
|
-
return this.data;
|
|
24
|
-
}
|
|
25
25
|
get eof() {
|
|
26
26
|
return this.index === this.data.length;
|
|
27
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReadBufferUtils.js","sourceRoot":"","sources":["../src/ReadBufferUtils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2DAAoD;AAEpD;;;GAGG;AACH,MAAa,UAAU;
|
|
1
|
+
{"version":3,"file":"ReadBufferUtils.js","sourceRoot":"","sources":["../src/ReadBufferUtils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2DAAoD;AAEpD;;;GAGG;AACH,MAAa,UAAU;IAGtB,IAAW,MAAM;QAChB,OAAO,IAAI,CAAC,IAAI,CAAC;IAClB,CAAC;IAED,YAA+B,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;QANrC,UAAK,GAAG,CAAC,CAAC;QAOnB,4DAA4D;QAC5D,+DAA+D;QAC/D,8DAA8D;QAC9D,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5B,CAAC;IAED,IAAW,GAAG;QACb,OAAO,IAAI,CAAC,KAAK,K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License.\n */\n\nimport { assert } from \"@fluidframework/core-utils\";\n\n/**\n * Buffer class, used to sequentially read data.\n * Used by tree code to reconstruct a tree from binary representation.\n */\nexport class ReadBuffer {\n\tprotected index = 0;\n\n\tpublic get buffer() {\n\t\treturn this.data;\n\t}\n\n\tconstructor(protected readonly data: Uint8Array) {\n\t\t// BlobShallowCopy will return to users parts of this array.\n\t\t// We need to ensure that nobody can change it, as it will have\n\t\t// catastrophic result and will be really hard to investigate.\n\t\tObject.freeze(data.buffer);\n\t}\n\n\tpublic get eof() {\n\t\treturn this.index === this.data.length;\n\t}\n\tpublic get pos() {\n\t\treturn this.index;\n\t}\n\tpublic get length() {\n\t\treturn this.data.length;\n\t}\n\n\tpublic slice(start: number, end: number) {\n\t\treturn this.data.slice(start, end);\n\t}\n\n\tpublic reset() {\n\t\tthis.index = 0;\n\t}\n\n\tpublic read(lengthArg = 1): number {\n\t\tlet res = 0;\n\t\tlet multiplier = 1;\n\t\tlet length = lengthArg;\n\t\twhile (length > 0) {\n\t\t\tassert(!this.eof, 0x223 /* \"unexpected end of buffer\" */);\n\t\t\tres += this.data[this.index] * multiplier;\n\t\t\tthis.index++;\n\t\t\tmultiplier *= 256;\n\t\t\tlength--;\n\t\t}\n\t\treturn res;\n\t}\n\n\tpublic skip(length: number) {\n\t\tassert(length >= 0, 0x224 /* \"Skip length should be positive\" */);\n\t\tthis.index += length;\n\t\tassert(this.index <= this.data.length, 0x3dc /* skipping past size of buffer */);\n\t}\n}\n"]}
|
package/dist/checkUrl.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { DriverPreCheckInfo } from "@fluidframework/driver-definitions";
|
|
|
8
8
|
* Note that returning information here is NOT a full guarantee that resolve will ultimately be successful.
|
|
9
9
|
* Instead, this should be used as a lightweight check that can filter out easily detectable unsupported URLs
|
|
10
10
|
* before the entire Fluid loading process needs to be kicked off.
|
|
11
|
+
* @public
|
|
11
12
|
*/
|
|
12
13
|
export declare function checkUrl(documentUrl: URL): DriverPreCheckInfo | undefined;
|
|
13
14
|
//# sourceMappingURL=checkUrl.d.ts.map
|
package/dist/checkUrl.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkUrl.d.ts","sourceRoot":"","sources":["../src/checkUrl.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAGxE
|
|
1
|
+
{"version":3,"file":"checkUrl.d.ts","sourceRoot":"","sources":["../src/checkUrl.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAGxE;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,WAAW,EAAE,GAAG,GAAG,kBAAkB,GAAG,SAAS,CAmBzE"}
|
package/dist/checkUrl.js
CHANGED
|
@@ -11,6 +11,7 @@ const odspFluidFileLink_1 = require("./odspFluidFileLink");
|
|
|
11
11
|
* Note that returning information here is NOT a full guarantee that resolve will ultimately be successful.
|
|
12
12
|
* Instead, this should be used as a lightweight check that can filter out easily detectable unsupported URLs
|
|
13
13
|
* before the entire Fluid loading process needs to be kicked off.
|
|
14
|
+
* @public
|
|
14
15
|
*/
|
|
15
16
|
function checkUrl(documentUrl) {
|
|
16
17
|
const locator = (0, odspFluidFileLink_1.getLocatorFromOdspUrl)(documentUrl);
|
package/dist/checkUrl.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkUrl.js","sourceRoot":"","sources":["../src/checkUrl.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,2DAA4D;AAE5D
|
|
1
|
+
{"version":3,"file":"checkUrl.js","sourceRoot":"","sources":["../src/checkUrl.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,2DAA4D;AAE5D;;;;;;GAMG;AACH,SAAgB,QAAQ,CAAC,WAAgB;IACxC,MAAM,OAAO,GAAG,IAAA,yCAAqB,EAAC,WAAW,CAAC,CAAC;IAEnD,IAAI,CAAC,OAAO,EAAE;QACb,OAAO,SAAS,CAAC;KACjB;IAED,IAAI,UAA8B,CAAC;IACnC,IAAI;QACH,IAAI,OAAO,EAAE,OAAO,EAAE;YACrB,UAAU,GAAG,IAAI,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,MAAM,CAAC;SAC9C;KACD;IAAC,MAAM,GAAE;IAEV,OAAO;QACN,eAAe,EAAE,OAAO,EAAE,oBAAoB;QAC9C,uEAAuE;QACvE,mBAAmB,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS;KAC1D,CAAC;AACH,CAAC;AAnBD,4BAmBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { DriverPreCheckInfo } from \"@fluidframework/driver-definitions\";\nimport { getLocatorFromOdspUrl } from \"./odspFluidFileLink\";\n\n/**\n * A check that returns DriverPreCheckInfo if the URL format is likely supported by this driver.\n * Note that returning information here is NOT a full guarantee that resolve will ultimately be successful.\n * Instead, this should be used as a lightweight check that can filter out easily detectable unsupported URLs\n * before the entire Fluid loading process needs to be kicked off.\n * @public\n */\nexport function checkUrl(documentUrl: URL): DriverPreCheckInfo | undefined {\n\tconst locator = getLocatorFromOdspUrl(documentUrl);\n\n\tif (!locator) {\n\t\treturn undefined;\n\t}\n\n\tlet siteOrigin: string | undefined;\n\ttry {\n\t\tif (locator?.siteUrl) {\n\t\t\tsiteOrigin = new URL(locator?.siteUrl).origin;\n\t\t}\n\t} catch {}\n\n\treturn {\n\t\tcodeDetailsHint: locator?.containerPackageName,\n\t\t// Add the snapshot endpoint, which has the same domain as the site URL\n\t\tcriticalBootDomains: siteOrigin ? [siteOrigin] : undefined,\n\t};\n}\n"]}
|
|
@@ -9,6 +9,7 @@ export declare const currentReadVersion = "1.0";
|
|
|
9
9
|
/**
|
|
10
10
|
* The parsing is significantly faster if the position of props is well known instead of dynamic. So these variables
|
|
11
11
|
* represents how many times slower parsing path is executed. This will be then logged into telemetry.
|
|
12
|
+
* @public
|
|
12
13
|
*/
|
|
13
14
|
export interface ISnapshotContentsWithProps extends ISnapshotContents {
|
|
14
15
|
telemetryProps: Record<string, number>;
|
|
@@ -17,6 +18,7 @@ export interface ISnapshotContentsWithProps extends ISnapshotContents {
|
|
|
17
18
|
* Converts snapshot from binary compact representation to tree/blobs/ops.
|
|
18
19
|
* @param buffer - Compact snapshot to be parsed into tree/blobs/ops.
|
|
19
20
|
* @returns Tree, blobs and ops from the snapshot.
|
|
21
|
+
* @public
|
|
20
22
|
*/
|
|
21
23
|
export declare function parseCompactSnapshotResponse(buffer: Uint8Array, logger: ITelemetryLoggerExt): ISnapshotContentsWithProps;
|
|
22
24
|
//# sourceMappingURL=compactSnapshotParser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compactSnapshotParser.d.ts","sourceRoot":"","sources":["../src/compactSnapshotParser.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAetD,eAAO,MAAM,sBAAsB,QAAQ,CAAC;AAC5C,eAAO,MAAM,kBAAkB,QAAQ,CAAC;AAExC
|
|
1
|
+
{"version":3,"file":"compactSnapshotParser.d.ts","sourceRoot":"","sources":["../src/compactSnapshotParser.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAetD,eAAO,MAAM,sBAAsB,QAAQ,CAAC;AAC5C,eAAO,MAAM,kBAAkB,QAAQ,CAAC;AAExC;;;;GAIG;AACH,MAAM,WAAW,0BAA2B,SAAQ,iBAAiB;IACpE,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACvC;AAsLD;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAC3C,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,mBAAmB,GACzB,0BAA0B,CA0C5B"}
|
|
@@ -172,6 +172,7 @@ function readSnapshotSection(node) {
|
|
|
172
172
|
* Converts snapshot from binary compact representation to tree/blobs/ops.
|
|
173
173
|
* @param buffer - Compact snapshot to be parsed into tree/blobs/ops.
|
|
174
174
|
* @returns Tree, blobs and ops from the snapshot.
|
|
175
|
+
* @public
|
|
175
176
|
*/
|
|
176
177
|
function parseCompactSnapshotResponse(buffer, logger) {
|
|
177
178
|
const { builder, telemetryProps } = zipItDataRepresentationUtils_1.TreeBuilder.load(new ReadBufferUtils_1.ReadBuffer(buffer), logger);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compactSnapshotParser.js","sourceRoot":"","sources":["../src/compactSnapshotParser.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2DAAoD;AAIpD,uDAA+C;AAC/C,iFAUwC;AACxC,2CAAsC;AAEzB,QAAA,sBAAsB,GAAG,KAAK,CAAC;AAC/B,QAAA,kBAAkB,GAAG,KAAK,CAAC;AAUxC;;;GAGG;AACH,SAAS,eAAe,CAAC,IAAe;IACvC,IAAA,qDAAsB,EAAC,IAAI,EAAE,sCAAsC,CAAC,CAAC;IACrE,IAAI,sBAAsB,GAAG,CAAC,CAAC;IAC/B,MAAM,KAAK,GAA6B,IAAI,GAAG,EAAE,CAAC;IAClD,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE;QACxB,IAAA,qDAAsB,EAAC,IAAI,EAAE,qBAAqB,CAAC,CAAC;QAEpD;;;;WAIG;QACH,IACC,IAAI,CAAC,MAAM,KAAK,CAAC;YACjB,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,KAAK,IAAI;YAC/B,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,KAAK,MAAM,EAChC;YACD,o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AAE,EACzB,KAAK,CAAC,4DAA4D,CAClE,CAAC;IAEF,MAAM,CAAC,QAAQ,EAAE,oBAAoB,CAAC,GAAG,IAAA,mBAAO,EAAC,GAAG,EAAE,CAAC,mBAAmB,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC9F,MAAM,CAAC,KAAK,EAAE,aAAa,CAAC,GAAG,IAAA,mBAAO,EAAC,GAAG,EAAE,CAAC,eAAe,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;IAE7E,OAAO;QACN,GAAG,QAAQ;QACX,GAAG,KAAK;QACR,GAAG,EAAE,OAAO,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE;QACvE,oBAAoB,EAAE,OAAO,CAAC,GAAG;QACjC,cAAc,EAAE;YACf,GAAG,cAAc;YACjB,oBAAoB;YACpB,aAAa;YACb,sBAAsB,EAAE,QAAQ,CAAC,sBAAsB;YACvD,sBAAsB,EAAE,KAAK,CAAC,sBAAsB;SACpD;KACD,CAAC;AACH,CAAC;AA7CD,oEA6CC","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 { ISequencedDocumentMessage, ISnapshotTree } from \"@fluidframework/protocol-definitions\";\nimport { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils\";\nimport { ISnapshotContents } from \"./odspPublicUtils\";\nimport { ReadBuffer } from \"./ReadBufferUtils\";\nimport {\n\tassertBlobCoreInstance,\n\tgetStringInstance,\n\tassertBoolInstance,\n\tassertNodeCoreInstance,\n\tassertNumberInstance,\n\tgetNodeProps,\n\tNodeCore,\n\tNodeTypes,\n\tTreeBuilder,\n} from \"./zipItDataRepresentationUtils\";\nimport { measure } from \"./odspUtils\";\n\nexport const snapshotMinReadVersion = \"1.0\";\nexport const currentReadVersion = \"1.0\";\n\n/**\n * The parsing is significantly faster if the position of props is well known instead of dynamic. So these variables\n * represents how many times slower parsing path is executed. This will be then logged into telemetry.\n */\nexport interface ISnapshotContentsWithProps extends ISnapshotContents {\n\ttelemetryProps: Record<string, number>;\n}\n\n/**\n * Recreates blobs section of the tree.\n * @param node - tree node to read blob section from\n */\nfunction readBlobSection(node: NodeTypes) {\n\tassertNodeCoreInstance(node, \"TreeBlobs should be of type NodeCore\");\n\tlet slowBlobStructureCount = 0;\n\tconst blobs: Map<string, ArrayBuffer> = new Map();\n\tfor (const blob of node) {\n\t\tassertNodeCoreInstance(blob, \"blob should be node\");\n\n\t\t/**\n\t\t * Perf optimization - the most common cases!\n\t\t * This is essentially unrolling code below for faster processing\n\t\t * It speeds up tree parsing by 2-3x times!\n\t\t */\n\t\tif (\n\t\t\tblob.length === 4 &&\n\t\t\tblob.getMaybeString(0) === \"id\" &&\n\t\t\tblob.getMaybeString(2) === \"data\"\n\t\t) {\n\t\t\t// \"id\": <node name>\n\t\t\t// \"data\": <blob>\n\t\t\tblobs.set(blob.getString(1), blob.getBlob(3).arrayBuffer);\n\t\t\tcontinue;\n\t\t}\n\n\t\t/**\n\t\t * More generalized workflow\n\t\t */\n\t\tslowBlobStructureCount += 1;\n\t\tconst records = getNodeProps(blob);\n\t\tassertBlobCoreInstance(records.data, \"data should be of BlobCore type\");\n\t\tconst id = getStringInstance(records.id, \"blob id should be string\");\n\t\tblobs.set(id, records.data.arrayBuffer);\n\t}\n\treturn { blobs, slowBlobStructureCount };\n}\n\n/**\n * Recreates ops section of the tree.\n * @param node - tree node to read ops section from\n */\nfunction readOpsSection(node: NodeTypes) {\n\tassertNodeCoreInstance(node, \"Deltas should be of type NodeCore\");\n\tconst ops: ISequencedDocumentMessage[] = [];\n\tconst records = getNodeProps(node);\n\tassertNumberInstance(records.firstSequenceNumber, \"Seq number should be a number\");\n\tassertNodeCoreInstance(records.deltas, \"Deltas should be a Node\");\n\tfor (let i = 0; i < records.deltas.length; ++i) {\n\t\tops.push(JSON.parse(records.deltas.getString(i)));\n\t}\n\t// Due to a bug at service side, in an edge case service was serializing deltas even\n\t// when there are no ops. So just make the code resilient to that bug. Service has also\n\t// fixed that bug.\n\tassert(\n\t\tops.length === 0 || records.firstSequenceNumber.valueOf() === ops[0].sequenceNumber,\n\t\t0x280 /* \"Validate first op seq number\" */,\n\t);\n\treturn ops;\n}\n\n/**\n * Recreates snapshot tree out of tree representation.\n * @param node - tree node to de-serialize from\n */\nfunction readTreeSection(node: NodeCore) {\n\tlet slowTreeStructureCount = 0;\n\tconst trees = {};\n\tconst snapshotTree: ISnapshotTree = {\n\t\tblobs: {},\n\t\ttrees,\n\t};\n\tfor (const treeNode of node) {\n\t\tassertNodeCoreInstance(treeNode, \"tree nodes should be nodes\");\n\n\t\t/**\n\t\t * Perf optimization - the most common cases!\n\t\t * This is essentially unrolling code below for faster processing\n\t\t * It speeds up tree parsing by 2-3x times!\n\t\t */\n\t\tconst length = treeNode.length;\n\t\tif (length > 0 && treeNode.getMaybeString(0) === \"name\") {\n\t\t\tif (length === 4) {\n\t\t\t\tconst content = treeNode.getMaybeString(2);\n\t\t\t\t// \"name\": <node name>\n\t\t\t\t// \"children\": <blob id>\n\t\t\t\tif (content === \"children\") {\n\t\t\t\t\tconst result = readTreeSection(treeNode.getNode(3));\n\t\t\t\t\ttrees[treeNode.getString(1)] = result.snapshotTree;\n\t\t\t\t\tslowTreeStructureCount += result.slowTreeStructureCount;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// \"name\": <node name>\n\t\t\t\t// \"value\": <blob id>\n\t\t\t\tif (content === \"value\") {\n\t\t\t\t\tsnapshotTree.blobs[treeNode.getString(1)] = treeNode.getString(3);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// \"name\": <node name>\n\t\t\t// \"nodeType\": 3\n\t\t\t// \"value\": <blob id>\n\t\t\tif (\n\t\t\t\tlength === 6 &&\n\t\t\t\ttreeNode.getMaybeString(2) === \"nodeType\" &&\n\t\t\t\ttreeNode.getMaybeString(4) === \"value\"\n\t\t\t) {\n\t\t\t\tsnapshotTree.blobs[treeNode.getString(1)] = treeNode.getString(5);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// \"name\": <node name>\n\t\t\t// \"unreferenced\": true\n\t\t\t// \"children\": <blob id>\n\t\t\tif (\n\t\t\t\tlength === 6 &&\n\t\t\t\ttreeNode.getMaybeString(2) === \"unreferenced\" &&\n\t\t\t\ttreeNode.getMaybeString(4) === \"children\"\n\t\t\t) {\n\t\t\t\tconst result = readTreeSection(treeNode.getNode(5));\n\t\t\t\ttrees[treeNode.getString(1)] = result.snapshotTree;\n\t\t\t\tslowTreeStructureCount += result.slowTreeStructureCount;\n\t\t\t\tassert(treeNode.getBool(3), 0x3db /* Unreferenced if present should be true */);\n\t\t\t\tsnapshotTree.unreferenced = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * More generalized workflow\n\t\t */\n\t\tslowTreeStructureCount += 1;\n\t\tconst records = getNodeProps(treeNode);\n\n\t\tif (records.unreferenced !== undefined) {\n\t\t\tassertBoolInstance(records.unreferenced, \"Unreferenced flag should be bool\");\n\t\t\tassert(records.unreferenced, 0x281 /* \"Unreferenced if present should be true\" */);\n\t\t\tsnapshotTree.unreferenced = true;\n\t\t}\n\n\t\tconst path = getStringInstance(records.name, \"Path name should be string\");\n\t\tif (records.value !== undefined) {\n\t\t\tsnapshotTree.blobs[path] = getStringInstance(\n\t\t\t\trecords.value,\n\t\t\t\t\"Blob value should be string\",\n\t\t\t);\n\t\t} else if (records.children !== undefined) {\n\t\t\tassertNodeCoreInstance(records.children, \"Trees should be of type NodeCore\");\n\t\t\tconst result = readTreeSection(records.children);\n\t\t\ttrees[path] = result.snapshotTree;\n\t\t\tslowTreeStructureCount += result.slowTreeStructureCount;\n\t\t} else {\n\t\t\ttrees[path] = { blobs: {}, trees: {} };\n\t\t}\n\t}\n\treturn { snapshotTree, slowTreeStructureCount };\n}\n\n/**\n * Recreates snapshot tree out of tree representation.\n * @param node - tree node to de-serialize from\n */\nfunction readSnapshotSection(node: NodeTypes) {\n\tassertNodeCoreInstance(node, \"Snapshot should be of type NodeCore\");\n\tconst records = getNodeProps(node);\n\n\tassertNodeCoreInstance(records.treeNodes, \"TreeNodes should be of type NodeCore\");\n\tassertNumberInstance(records.sequenceNumber, \"sequenceNumber should be of type number\");\n\tconst { snapshotTree, slowTreeStructureCount } = readTreeSection(records.treeNodes);\n\tsnapshotTree.id = getStringInstance(records.id, \"snapshotId should be string\");\n\tconst sequenceNumber = records.sequenceNumber.valueOf();\n\treturn {\n\t\tsequenceNumber,\n\t\tsnapshotTree,\n\t\tslowTreeStructureCount,\n\t};\n}\n\n/**\n * Converts snapshot from binary compact representation to tree/blobs/ops.\n * @param buffer - Compact snapshot to be parsed into tree/blobs/ops.\n * @returns Tree, blobs and ops from the snapshot.\n */\nexport function parseCompactSnapshotResponse(\n\tbuffer: Uint8Array,\n\tlogger: ITelemetryLoggerExt,\n): ISnapshotContentsWithProps {\n\tconst { builder, telemetryProps } = TreeBuilder.load(new ReadBuffer(buffer), logger);\n\tassert(builder.length === 1, 0x219 /* \"1 root should be there\" */);\n\tconst root = builder.getNode(0);\n\n\tconst records = getNodeProps(root);\n\n\tconst mrv = getStringInstance(records.mrv, \"minReadVersion should be string\");\n\tconst cv = getStringInstance(records.cv, \"createVersion should be string\");\n\tif (records.lsn !== undefined) {\n\t\tassertNumberInstance(records.lsn, \"lsn should be a number\");\n\t}\n\n\tassert(\n\t\tparseFloat(snapshotMinReadVersion) >= parseFloat(mrv),\n\t\t0x20f /* \"Driver min read version should >= to server minReadVersion\" */,\n\t);\n\tassert(\n\t\tparseFloat(cv) >= parseFloat(snapshotMinReadVersion),\n\t\t0x210 /* \"Snapshot should be created with minReadVersion or above\" */,\n\t);\n\tassert(\n\t\tcurrentReadVersion === cv,\n\t\t0x2c2 /* \"Create Version should be equal to currentReadVersion\" */,\n\t);\n\n\tconst [snapshot, durationSnapshotTree] = measure(() => readSnapshotSection(records.snapshot));\n\tconst [blobs, durationBlobs] = measure(() => readBlobSection(records.blobs));\n\n\treturn {\n\t\t...snapshot,\n\t\t...blobs,\n\t\tops: records.deltas !== undefined ? readOpsSection(records.deltas) : [],\n\t\tlatestSequenceNumber: records.lsn,\n\t\ttelemetryProps: {\n\t\t\t...telemetryProps,\n\t\t\tdurationSnapshotTree,\n\t\t\tdurationBlobs,\n\t\t\tslowTreeStructureCount: snapshot.slowTreeStructureCount,\n\t\t\tslowBlobStructureCount: blobs.slowBlobStructureCount,\n\t\t},\n\t};\n}\n"]}
|
|
1
|
+
{"version":3,"file":"compactSnapshotParser.js","sourceRoot":"","sources":["../src/compactSnapshotParser.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2DAAoD;AAIpD,uDAA+C;AAC/C,iFAUwC;AACxC,2CAAsC;AAEzB,QAAA,sBAAsB,GAAG,KAAK,CAAC;AAC/B,QAAA,kBAAkB,GAAG,KAAK,CAAC;AAWxC;;;GAGG;AACH,SAAS,eAAe,CAAC,IAAe;IACvC,IAAA,qDAAsB,EAAC,IAAI,EAAE,sCAAsC,CAAC,CAAC;IACrE,IAAI,sBAAsB,GAAG,CAAC,CAAC;IAC/B,MAAM,KAAK,GAA6B,IAAI,GAAG,EAAE,CAAC;IAClD,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE;QACxB,IAAA,qDAAsB,EAAC,IAAI,EAAE,qBAAqB,CAAC,CAAC;QAEpD;;;;WAIG;QACH,IACC,IAAI,CAAC,MAAM,KAAK,CAAC;YACjB,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,KAAK,IAAI;YAC/B,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,KAAK,MAAM,EAChC;YACD,oBAAoB;YACpB,iBAAiB;YACjB,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,CA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mBAAO,EAAC,GAAG,EAAE,CAAC,mBAAmB,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC9F,MAAM,CAAC,KAAK,EAAE,aAAa,CAAC,GAAG,IAAA,mBAAO,EAAC,GAAG,EAAE,CAAC,eAAe,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;IAE7E,OAAO;QACN,GAAG,QAAQ;QACX,GAAG,KAAK;QACR,GAAG,EAAE,OAAO,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE;QACvE,oBAAoB,EAAE,OAAO,CAAC,GAAG;QACjC,cAAc,EAAE;YACf,GAAG,cAAc;YACjB,oBAAoB;YACpB,aAAa;YACb,sBAAsB,EAAE,QAAQ,CAAC,sBAAsB;YACvD,sBAAsB,EAAE,KAAK,CAAC,sBAAsB;SACpD;KACD,CAAC;AACH,CAAC;AA7CD,oEA6CC","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 { ISequencedDocumentMessage, ISnapshotTree } from \"@fluidframework/protocol-definitions\";\nimport { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils\";\nimport { ISnapshotContents } from \"./odspPublicUtils\";\nimport { ReadBuffer } from \"./ReadBufferUtils\";\nimport {\n\tassertBlobCoreInstance,\n\tgetStringInstance,\n\tassertBoolInstance,\n\tassertNodeCoreInstance,\n\tassertNumberInstance,\n\tgetNodeProps,\n\tNodeCore,\n\tNodeTypes,\n\tTreeBuilder,\n} from \"./zipItDataRepresentationUtils\";\nimport { measure } from \"./odspUtils\";\n\nexport const snapshotMinReadVersion = \"1.0\";\nexport const currentReadVersion = \"1.0\";\n\n/**\n * The parsing is significantly faster if the position of props is well known instead of dynamic. So these variables\n * represents how many times slower parsing path is executed. This will be then logged into telemetry.\n * @public\n */\nexport interface ISnapshotContentsWithProps extends ISnapshotContents {\n\ttelemetryProps: Record<string, number>;\n}\n\n/**\n * Recreates blobs section of the tree.\n * @param node - tree node to read blob section from\n */\nfunction readBlobSection(node: NodeTypes) {\n\tassertNodeCoreInstance(node, \"TreeBlobs should be of type NodeCore\");\n\tlet slowBlobStructureCount = 0;\n\tconst blobs: Map<string, ArrayBuffer> = new Map();\n\tfor (const blob of node) {\n\t\tassertNodeCoreInstance(blob, \"blob should be node\");\n\n\t\t/**\n\t\t * Perf optimization - the most common cases!\n\t\t * This is essentially unrolling code below for faster processing\n\t\t * It speeds up tree parsing by 2-3x times!\n\t\t */\n\t\tif (\n\t\t\tblob.length === 4 &&\n\t\t\tblob.getMaybeString(0) === \"id\" &&\n\t\t\tblob.getMaybeString(2) === \"data\"\n\t\t) {\n\t\t\t// \"id\": <node name>\n\t\t\t// \"data\": <blob>\n\t\t\tblobs.set(blob.getString(1), blob.getBlob(3).arrayBuffer);\n\t\t\tcontinue;\n\t\t}\n\n\t\t/**\n\t\t * More generalized workflow\n\t\t */\n\t\tslowBlobStructureCount += 1;\n\t\tconst records = getNodeProps(blob);\n\t\tassertBlobCoreInstance(records.data, \"data should be of BlobCore type\");\n\t\tconst id = getStringInstance(records.id, \"blob id should be string\");\n\t\tblobs.set(id, records.data.arrayBuffer);\n\t}\n\treturn { blobs, slowBlobStructureCount };\n}\n\n/**\n * Recreates ops section of the tree.\n * @param node - tree node to read ops section from\n */\nfunction readOpsSection(node: NodeTypes) {\n\tassertNodeCoreInstance(node, \"Deltas should be of type NodeCore\");\n\tconst ops: ISequencedDocumentMessage[] = [];\n\tconst records = getNodeProps(node);\n\tassertNumberInstance(records.firstSequenceNumber, \"Seq number should be a number\");\n\tassertNodeCoreInstance(records.deltas, \"Deltas should be a Node\");\n\tfor (let i = 0; i < records.deltas.length; ++i) {\n\t\tops.push(JSON.parse(records.deltas.getString(i)));\n\t}\n\t// Due to a bug at service side, in an edge case service was serializing deltas even\n\t// when there are no ops. So just make the code resilient to that bug. Service has also\n\t// fixed that bug.\n\tassert(\n\t\tops.length === 0 || records.firstSequenceNumber.valueOf() === ops[0].sequenceNumber,\n\t\t0x280 /* \"Validate first op seq number\" */,\n\t);\n\treturn ops;\n}\n\n/**\n * Recreates snapshot tree out of tree representation.\n * @param node - tree node to de-serialize from\n */\nfunction readTreeSection(node: NodeCore) {\n\tlet slowTreeStructureCount = 0;\n\tconst trees = {};\n\tconst snapshotTree: ISnapshotTree = {\n\t\tblobs: {},\n\t\ttrees,\n\t};\n\tfor (const treeNode of node) {\n\t\tassertNodeCoreInstance(treeNode, \"tree nodes should be nodes\");\n\n\t\t/**\n\t\t * Perf optimization - the most common cases!\n\t\t * This is essentially unrolling code below for faster processing\n\t\t * It speeds up tree parsing by 2-3x times!\n\t\t */\n\t\tconst length = treeNode.length;\n\t\tif (length > 0 && treeNode.getMaybeString(0) === \"name\") {\n\t\t\tif (length === 4) {\n\t\t\t\tconst content = treeNode.getMaybeString(2);\n\t\t\t\t// \"name\": <node name>\n\t\t\t\t// \"children\": <blob id>\n\t\t\t\tif (content === \"children\") {\n\t\t\t\t\tconst result = readTreeSection(treeNode.getNode(3));\n\t\t\t\t\ttrees[treeNode.getString(1)] = result.snapshotTree;\n\t\t\t\t\tslowTreeStructureCount += result.slowTreeStructureCount;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// \"name\": <node name>\n\t\t\t\t// \"value\": <blob id>\n\t\t\t\tif (content === \"value\") {\n\t\t\t\t\tsnapshotTree.blobs[treeNode.getString(1)] = treeNode.getString(3);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// \"name\": <node name>\n\t\t\t// \"nodeType\": 3\n\t\t\t// \"value\": <blob id>\n\t\t\tif (\n\t\t\t\tlength === 6 &&\n\t\t\t\ttreeNode.getMaybeString(2) === \"nodeType\" &&\n\t\t\t\ttreeNode.getMaybeString(4) === \"value\"\n\t\t\t) {\n\t\t\t\tsnapshotTree.blobs[treeNode.getString(1)] = treeNode.getString(5);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// \"name\": <node name>\n\t\t\t// \"unreferenced\": true\n\t\t\t// \"children\": <blob id>\n\t\t\tif (\n\t\t\t\tlength === 6 &&\n\t\t\t\ttreeNode.getMaybeString(2) === \"unreferenced\" &&\n\t\t\t\ttreeNode.getMaybeString(4) === \"children\"\n\t\t\t) {\n\t\t\t\tconst result = readTreeSection(treeNode.getNode(5));\n\t\t\t\ttrees[treeNode.getString(1)] = result.snapshotTree;\n\t\t\t\tslowTreeStructureCount += result.slowTreeStructureCount;\n\t\t\t\tassert(treeNode.getBool(3), 0x3db /* Unreferenced if present should be true */);\n\t\t\t\tsnapshotTree.unreferenced = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * More generalized workflow\n\t\t */\n\t\tslowTreeStructureCount += 1;\n\t\tconst records = getNodeProps(treeNode);\n\n\t\tif (records.unreferenced !== undefined) {\n\t\t\tassertBoolInstance(records.unreferenced, \"Unreferenced flag should be bool\");\n\t\t\tassert(records.unreferenced, 0x281 /* \"Unreferenced if present should be true\" */);\n\t\t\tsnapshotTree.unreferenced = true;\n\t\t}\n\n\t\tconst path = getStringInstance(records.name, \"Path name should be string\");\n\t\tif (records.value !== undefined) {\n\t\t\tsnapshotTree.blobs[path] = getStringInstance(\n\t\t\t\trecords.value,\n\t\t\t\t\"Blob value should be string\",\n\t\t\t);\n\t\t} else if (records.children !== undefined) {\n\t\t\tassertNodeCoreInstance(records.children, \"Trees should be of type NodeCore\");\n\t\t\tconst result = readTreeSection(records.children);\n\t\t\ttrees[path] = result.snapshotTree;\n\t\t\tslowTreeStructureCount += result.slowTreeStructureCount;\n\t\t} else {\n\t\t\ttrees[path] = { blobs: {}, trees: {} };\n\t\t}\n\t}\n\treturn { snapshotTree, slowTreeStructureCount };\n}\n\n/**\n * Recreates snapshot tree out of tree representation.\n * @param node - tree node to de-serialize from\n */\nfunction readSnapshotSection(node: NodeTypes) {\n\tassertNodeCoreInstance(node, \"Snapshot should be of type NodeCore\");\n\tconst records = getNodeProps(node);\n\n\tassertNodeCoreInstance(records.treeNodes, \"TreeNodes should be of type NodeCore\");\n\tassertNumberInstance(records.sequenceNumber, \"sequenceNumber should be of type number\");\n\tconst { snapshotTree, slowTreeStructureCount } = readTreeSection(records.treeNodes);\n\tsnapshotTree.id = getStringInstance(records.id, \"snapshotId should be string\");\n\tconst sequenceNumber = records.sequenceNumber.valueOf();\n\treturn {\n\t\tsequenceNumber,\n\t\tsnapshotTree,\n\t\tslowTreeStructureCount,\n\t};\n}\n\n/**\n * Converts snapshot from binary compact representation to tree/blobs/ops.\n * @param buffer - Compact snapshot to be parsed into tree/blobs/ops.\n * @returns Tree, blobs and ops from the snapshot.\n * @public\n */\nexport function parseCompactSnapshotResponse(\n\tbuffer: Uint8Array,\n\tlogger: ITelemetryLoggerExt,\n): ISnapshotContentsWithProps {\n\tconst { builder, telemetryProps } = TreeBuilder.load(new ReadBuffer(buffer), logger);\n\tassert(builder.length === 1, 0x219 /* \"1 root should be there\" */);\n\tconst root = builder.getNode(0);\n\n\tconst records = getNodeProps(root);\n\n\tconst mrv = getStringInstance(records.mrv, \"minReadVersion should be string\");\n\tconst cv = getStringInstance(records.cv, \"createVersion should be string\");\n\tif (records.lsn !== undefined) {\n\t\tassertNumberInstance(records.lsn, \"lsn should be a number\");\n\t}\n\n\tassert(\n\t\tparseFloat(snapshotMinReadVersion) >= parseFloat(mrv),\n\t\t0x20f /* \"Driver min read version should >= to server minReadVersion\" */,\n\t);\n\tassert(\n\t\tparseFloat(cv) >= parseFloat(snapshotMinReadVersion),\n\t\t0x210 /* \"Snapshot should be created with minReadVersion or above\" */,\n\t);\n\tassert(\n\t\tcurrentReadVersion === cv,\n\t\t0x2c2 /* \"Create Version should be equal to currentReadVersion\" */,\n\t);\n\n\tconst [snapshot, durationSnapshotTree] = measure(() => readSnapshotSection(records.snapshot));\n\tconst [blobs, durationBlobs] = measure(() => readBlobSection(records.blobs));\n\n\treturn {\n\t\t...snapshot,\n\t\t...blobs,\n\t\tops: records.deltas !== undefined ? readOpsSection(records.deltas) : [],\n\t\tlatestSequenceNumber: records.lsn,\n\t\ttelemetryProps: {\n\t\t\t...telemetryProps,\n\t\t\tdurationSnapshotTree,\n\t\t\tdurationBlobs,\n\t\t\tslowTreeStructureCount: snapshot.slowTreeStructureCount,\n\t\t\tslowBlobStructureCount: blobs.slowBlobStructureCount,\n\t\t},\n\t};\n}\n"]}
|
package/dist/constants.d.ts
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
+
/**
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
5
8
|
export declare const OdcApiSiteOrigin = "https://my.microsoftpersonalcontent.com";
|
|
9
|
+
/**
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
6
12
|
export declare const OdcFileSiteOrigin = "https://1drv.ms";
|
|
7
13
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,gBAAgB,4CAA4C,CAAC;
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,eAAO,MAAM,gBAAgB,4CAA4C,CAAC;AAE1E;;GAEG;AACH,eAAO,MAAM,iBAAiB,oBAAoB,CAAC"}
|
package/dist/constants.js
CHANGED
|
@@ -5,6 +5,12 @@
|
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.OdcFileSiteOrigin = exports.OdcApiSiteOrigin = void 0;
|
|
8
|
+
/**
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
8
11
|
exports.OdcApiSiteOrigin = "https://my.microsoftpersonalcontent.com";
|
|
12
|
+
/**
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
9
15
|
exports.OdcFileSiteOrigin = "https://1drv.ms";
|
|
10
16
|
//# sourceMappingURL=constants.js.map
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;GAEG;AACU,QAAA,gBAAgB,GAAG,yCAAyC,CAAC;AAE1E;;GAEG;AACU,QAAA,iBAAiB,GAAG,iBAAiB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @public\n */\nexport const OdcApiSiteOrigin = \"https://my.microsoftpersonalcontent.com\";\n\n/**\n * @public\n */\nexport const OdcFileSiteOrigin = \"https://1drv.ms\";\n"]}
|
package/dist/contracts.d.ts
CHANGED
|
@@ -61,7 +61,7 @@ export interface IOdspSummaryPayload {
|
|
|
61
61
|
export interface IWriteSummaryResponse {
|
|
62
62
|
id: string;
|
|
63
63
|
}
|
|
64
|
-
export
|
|
64
|
+
export type OdspSummaryTreeEntry = IOdspSummaryTreeValueEntry | IOdspSummaryTreeHandleEntry;
|
|
65
65
|
export interface IOdspSummaryTreeBaseEntry {
|
|
66
66
|
path: string;
|
|
67
67
|
type: "blob" | "tree" | "commit";
|
|
@@ -73,7 +73,7 @@ export interface IOdspSummaryTreeValueEntry extends IOdspSummaryTreeBaseEntry {
|
|
|
73
73
|
export interface IOdspSummaryTreeHandleEntry extends IOdspSummaryTreeBaseEntry {
|
|
74
74
|
id: string;
|
|
75
75
|
}
|
|
76
|
-
export
|
|
76
|
+
export type OdspSummaryTreeValue = IOdspSummaryTree | IOdspSummaryBlob;
|
|
77
77
|
export interface IOdspSummaryTree {
|
|
78
78
|
type: "tree";
|
|
79
79
|
entries?: OdspSummaryTreeEntry[];
|
|
@@ -103,7 +103,7 @@ export interface IOdspSnapshotTreeEntryBlob {
|
|
|
103
103
|
path: string;
|
|
104
104
|
type: "blob";
|
|
105
105
|
}
|
|
106
|
-
export
|
|
106
|
+
export type IOdspSnapshotTreeEntry = IOdspSnapshotTreeEntryTree | IOdspSnapshotTreeEntryCommit | IOdspSnapshotTreeEntryBlob;
|
|
107
107
|
export interface IOdspSnapshotCommit {
|
|
108
108
|
entries: IOdspSnapshotTreeEntry[];
|
|
109
109
|
id: string;
|