@fluidframework/container-loader 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 +18 -21
- package/.mocharc.js +12 -0
- package/CHANGELOG.md +364 -0
- package/README.md +152 -56
- package/api-extractor-lint.json +4 -0
- package/api-extractor.json +2 -2
- package/api-report/container-loader.api.md +143 -0
- package/dist/{audience.js → audience.cjs} +15 -13
- package/dist/audience.cjs.map +1 -0
- package/dist/audience.d.ts +4 -6
- package/dist/audience.d.ts.map +1 -1
- package/dist/catchUpMonitor.cjs +43 -0
- package/dist/catchUpMonitor.cjs.map +1 -0
- package/dist/catchUpMonitor.d.ts +29 -0
- package/dist/catchUpMonitor.d.ts.map +1 -0
- package/dist/{connectionManager.js → connectionManager.cjs} +397 -240
- package/dist/connectionManager.cjs.map +1 -0
- package/dist/connectionManager.d.ts +23 -33
- package/dist/connectionManager.d.ts.map +1 -1
- package/dist/{connectionState.js → connectionState.cjs} +5 -7
- package/dist/connectionState.cjs.map +1 -0
- package/dist/connectionState.d.ts +3 -5
- package/dist/connectionState.d.ts.map +1 -1
- package/dist/connectionStateHandler.cjs +474 -0
- package/dist/connectionStateHandler.cjs.map +1 -0
- package/dist/connectionStateHandler.d.ts +127 -29
- package/dist/connectionStateHandler.d.ts.map +1 -1
- package/dist/container-loader-alpha.d.ts +274 -0
- package/dist/container-loader-beta.d.ts +75 -0
- package/dist/container-loader-public.d.ts +75 -0
- package/dist/container-loader-untrimmed.d.ts +331 -0
- package/dist/container.cjs +1585 -0
- package/dist/container.cjs.map +1 -0
- package/dist/container.d.ts +227 -83
- package/dist/container.d.ts.map +1 -1
- package/dist/containerContext.cjs +74 -0
- package/dist/containerContext.cjs.map +1 -0
- package/dist/containerContext.d.ts +33 -59
- package/dist/containerContext.d.ts.map +1 -1
- package/dist/containerStorageAdapter.cjs +234 -0
- package/dist/containerStorageAdapter.cjs.map +1 -0
- package/dist/containerStorageAdapter.d.ts +48 -23
- package/dist/containerStorageAdapter.d.ts.map +1 -1
- package/dist/{contracts.js → contracts.cjs} +5 -5
- package/dist/contracts.cjs.map +1 -0
- package/dist/contracts.d.ts +45 -17
- package/dist/contracts.d.ts.map +1 -1
- package/dist/debugLogger.cjs +101 -0
- package/dist/debugLogger.cjs.map +1 -0
- package/dist/debugLogger.d.ts +30 -0
- package/dist/debugLogger.d.ts.map +1 -0
- package/dist/{deltaManager.js → deltaManager.cjs} +379 -186
- package/dist/deltaManager.cjs.map +1 -0
- package/dist/deltaManager.d.ts +54 -18
- package/dist/deltaManager.d.ts.map +1 -1
- package/dist/{deltaQueue.js → deltaQueue.cjs} +29 -28
- package/dist/deltaQueue.cjs.map +1 -0
- package/dist/deltaQueue.d.ts +3 -4
- package/dist/deltaQueue.d.ts.map +1 -1
- package/dist/disposal.cjs +25 -0
- package/dist/disposal.cjs.map +1 -0
- package/dist/disposal.d.ts +13 -0
- package/dist/disposal.d.ts.map +1 -0
- package/dist/error.cjs +32 -0
- package/dist/error.cjs.map +1 -0
- package/dist/error.d.ts +23 -0
- package/dist/error.d.ts.map +1 -0
- package/dist/index.cjs +19 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/loader.cjs +148 -0
- package/dist/loader.cjs.map +1 -0
- package/dist/loader.d.ts +38 -19
- package/dist/loader.d.ts.map +1 -1
- package/dist/location-redirection-utilities/index.cjs +11 -0
- package/dist/location-redirection-utilities/index.cjs.map +1 -0
- package/dist/location-redirection-utilities/index.d.ts +6 -0
- package/dist/location-redirection-utilities/index.d.ts.map +1 -0
- package/dist/location-redirection-utilities/resolveWithLocationRedirection.cjs +53 -0
- package/dist/location-redirection-utilities/resolveWithLocationRedirection.cjs.map +1 -0
- package/dist/location-redirection-utilities/resolveWithLocationRedirection.d.ts +24 -0
- package/dist/location-redirection-utilities/resolveWithLocationRedirection.d.ts.map +1 -0
- package/dist/{collabWindowTracker.js → noopHeuristic.cjs} +37 -39
- package/dist/noopHeuristic.cjs.map +1 -0
- package/dist/noopHeuristic.d.ts +23 -0
- package/dist/noopHeuristic.d.ts.map +1 -0
- 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/protocol.cjs +99 -0
- package/dist/protocol.cjs.map +1 -0
- package/dist/protocol.d.ts +38 -0
- package/dist/protocol.d.ts.map +1 -0
- package/dist/{protocolTreeDocumentStorageService.js → protocolTreeDocumentStorageService.cjs} +8 -5
- package/dist/protocolTreeDocumentStorageService.cjs.map +1 -0
- package/dist/protocolTreeDocumentStorageService.d.ts +8 -4
- package/dist/protocolTreeDocumentStorageService.d.ts.map +1 -1
- package/dist/quorum.cjs +16 -0
- package/dist/quorum.cjs.map +1 -0
- package/dist/quorum.d.ts +1 -14
- package/dist/quorum.d.ts.map +1 -1
- package/dist/{retriableDocumentStorageService.js → retriableDocumentStorageService.cjs} +36 -21
- package/dist/retriableDocumentStorageService.cjs.map +1 -0
- package/dist/retriableDocumentStorageService.d.ts +7 -5
- package/dist/retriableDocumentStorageService.d.ts.map +1 -1
- package/dist/tsdoc-metadata.json +11 -0
- package/dist/{utils.js → utils.cjs} +52 -14
- package/dist/utils.cjs.map +1 -0
- package/dist/utils.d.ts +34 -1
- package/dist/utils.d.ts.map +1 -1
- package/lib/{audience.d.ts → audience.d.mts} +4 -10
- package/lib/audience.d.mts.map +1 -0
- package/lib/{audience.js → audience.mjs} +15 -17
- package/lib/audience.mjs.map +1 -0
- package/lib/catchUpMonitor.d.mts +29 -0
- package/lib/catchUpMonitor.d.mts.map +1 -0
- package/lib/catchUpMonitor.mjs +39 -0
- package/lib/catchUpMonitor.mjs.map +1 -0
- package/lib/{connectionManager.d.ts → connectionManager.d.mts} +23 -33
- package/lib/connectionManager.d.mts.map +1 -0
- package/lib/{connectionManager.js → connectionManager.mjs} +378 -218
- package/lib/connectionManager.mjs.map +1 -0
- package/lib/{connectionState.d.ts → connectionState.d.mts} +3 -5
- package/lib/connectionState.d.mts.map +1 -0
- package/lib/{connectionState.js → connectionState.mjs} +4 -6
- package/lib/connectionState.mjs.map +1 -0
- package/lib/connectionStateHandler.d.mts +179 -0
- package/lib/connectionStateHandler.d.mts.map +1 -0
- package/lib/connectionStateHandler.mjs +469 -0
- package/lib/connectionStateHandler.mjs.map +1 -0
- package/lib/container-loader-alpha.d.mts +274 -0
- package/lib/container-loader-beta.d.mts +75 -0
- package/lib/container-loader-public.d.mts +75 -0
- package/lib/container-loader-untrimmed.d.mts +331 -0
- package/lib/container.d.mts +382 -0
- package/lib/container.d.mts.map +1 -0
- package/lib/container.mjs +1579 -0
- package/lib/container.mjs.map +1 -0
- package/lib/containerContext.d.mts +58 -0
- package/lib/containerContext.d.mts.map +1 -0
- package/lib/containerContext.mjs +70 -0
- package/lib/containerContext.mjs.map +1 -0
- package/lib/containerStorageAdapter.d.mts +73 -0
- package/lib/containerStorageAdapter.d.mts.map +1 -0
- package/lib/containerStorageAdapter.mjs +228 -0
- package/lib/containerStorageAdapter.mjs.map +1 -0
- package/lib/{contracts.d.ts → contracts.d.mts} +45 -17
- package/lib/contracts.d.mts.map +1 -0
- package/lib/{contracts.js → contracts.mjs} +4 -4
- package/lib/contracts.mjs.map +1 -0
- package/lib/debugLogger.d.mts +30 -0
- package/lib/debugLogger.d.mts.map +1 -0
- package/lib/debugLogger.mjs +93 -0
- package/lib/debugLogger.mjs.map +1 -0
- package/lib/{deltaManager.d.ts → deltaManager.d.mts} +54 -18
- package/lib/deltaManager.d.mts.map +1 -0
- package/lib/{deltaManager.js → deltaManager.mjs} +361 -165
- package/lib/deltaManager.mjs.map +1 -0
- package/lib/{deltaQueue.d.ts → deltaQueue.d.mts} +3 -4
- package/lib/deltaQueue.d.mts.map +1 -0
- package/lib/{deltaQueue.js → deltaQueue.mjs} +25 -24
- package/lib/deltaQueue.mjs.map +1 -0
- package/lib/disposal.d.mts +13 -0
- package/lib/disposal.d.mts.map +1 -0
- package/lib/disposal.mjs +21 -0
- package/lib/disposal.mjs.map +1 -0
- package/lib/error.d.mts +23 -0
- package/lib/error.d.mts.map +1 -0
- package/lib/error.mjs +28 -0
- package/lib/error.mjs.map +1 -0
- package/lib/index.d.mts +11 -0
- package/lib/index.d.mts.map +1 -0
- package/lib/index.mjs +10 -0
- package/lib/index.mjs.map +1 -0
- package/lib/{loader.d.ts → loader.d.mts} +39 -20
- package/lib/loader.d.mts.map +1 -0
- package/lib/loader.mjs +143 -0
- package/lib/loader.mjs.map +1 -0
- package/lib/location-redirection-utilities/index.d.mts +6 -0
- package/lib/location-redirection-utilities/index.d.mts.map +1 -0
- package/lib/location-redirection-utilities/index.mjs +6 -0
- package/lib/location-redirection-utilities/index.mjs.map +1 -0
- package/lib/location-redirection-utilities/resolveWithLocationRedirection.d.mts +24 -0
- package/lib/location-redirection-utilities/resolveWithLocationRedirection.d.mts.map +1 -0
- package/lib/location-redirection-utilities/resolveWithLocationRedirection.mjs +48 -0
- package/lib/location-redirection-utilities/resolveWithLocationRedirection.mjs.map +1 -0
- package/lib/noopHeuristic.d.mts +23 -0
- package/lib/noopHeuristic.d.mts.map +1 -0
- package/lib/{collabWindowTracker.js → noopHeuristic.mjs} +33 -35
- package/lib/noopHeuristic.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/protocol.d.mts +38 -0
- package/lib/protocol.d.mts.map +1 -0
- package/lib/protocol.mjs +94 -0
- package/lib/protocol.mjs.map +1 -0
- package/lib/{protocolTreeDocumentStorageService.d.ts → protocolTreeDocumentStorageService.d.mts} +8 -4
- package/lib/protocolTreeDocumentStorageService.d.mts.map +1 -0
- package/lib/{protocolTreeDocumentStorageService.js → protocolTreeDocumentStorageService.mjs} +8 -5
- package/lib/protocolTreeDocumentStorageService.mjs.map +1 -0
- package/lib/quorum.d.mts +4 -0
- package/lib/quorum.d.mts.map +1 -0
- package/lib/quorum.mjs +12 -0
- package/lib/quorum.mjs.map +1 -0
- package/lib/{retriableDocumentStorageService.d.ts → retriableDocumentStorageService.d.mts} +7 -5
- package/lib/retriableDocumentStorageService.d.mts.map +1 -0
- package/lib/{retriableDocumentStorageService.js → retriableDocumentStorageService.mjs} +35 -20
- package/lib/retriableDocumentStorageService.mjs.map +1 -0
- package/lib/utils.d.mts +67 -0
- package/lib/utils.d.mts.map +1 -0
- package/lib/{utils.js → utils.mjs} +47 -11
- package/lib/utils.mjs.map +1 -0
- package/package.json +163 -70
- package/prettier.config.cjs +8 -0
- package/src/audience.ts +59 -49
- package/src/catchUpMonitor.ts +61 -0
- package/src/connectionManager.ts +1154 -910
- package/src/connectionState.ts +22 -25
- package/src/connectionStateHandler.ts +689 -319
- package/src/container.ts +2476 -1792
- package/src/containerContext.ts +98 -330
- package/src/containerStorageAdapter.ts +301 -105
- package/src/contracts.ts +184 -146
- package/src/debugLogger.ts +123 -0
- package/src/deltaManager.ts +1165 -900
- package/src/deltaQueue.ts +156 -152
- package/src/disposal.ts +25 -0
- package/src/error.ts +44 -0
- package/src/index.ts +14 -15
- package/src/loader.ts +356 -427
- package/src/location-redirection-utilities/index.ts +9 -0
- package/src/location-redirection-utilities/resolveWithLocationRedirection.ts +61 -0
- package/src/noopHeuristic.ts +107 -0
- package/src/packageVersion.ts +1 -1
- package/src/protocol.ts +150 -0
- package/src/protocolTreeDocumentStorageService.ts +35 -35
- package/src/quorum.ts +11 -50
- package/src/retriableDocumentStorageService.ts +135 -95
- package/src/utils.ts +159 -86
- package/tsc-multi.test.json +4 -0
- package/tsconfig.json +10 -12
- package/dist/audience.js.map +0 -1
- package/dist/collabWindowTracker.d.ts +0 -19
- package/dist/collabWindowTracker.d.ts.map +0 -1
- package/dist/collabWindowTracker.js.map +0 -1
- package/dist/connectionManager.js.map +0 -1
- package/dist/connectionState.js.map +0 -1
- package/dist/connectionStateHandler.js +0 -280
- package/dist/connectionStateHandler.js.map +0 -1
- package/dist/container.js +0 -1284
- package/dist/container.js.map +0 -1
- package/dist/containerContext.js +0 -217
- package/dist/containerContext.js.map +0 -1
- package/dist/containerStorageAdapter.js +0 -104
- package/dist/containerStorageAdapter.js.map +0 -1
- package/dist/contracts.js.map +0 -1
- package/dist/deltaManager.js.map +0 -1
- package/dist/deltaManagerProxy.d.ts +0 -54
- package/dist/deltaManagerProxy.d.ts.map +0 -1
- package/dist/deltaManagerProxy.js +0 -115
- package/dist/deltaManagerProxy.js.map +0 -1
- package/dist/deltaQueue.js.map +0 -1
- package/dist/index.js +0 -16
- package/dist/index.js.map +0 -1
- package/dist/loader.js +0 -241
- package/dist/loader.js.map +0 -1
- package/dist/packageVersion.js.map +0 -1
- package/dist/protocolTreeDocumentStorageService.js.map +0 -1
- package/dist/quorum.js +0 -44
- package/dist/quorum.js.map +0 -1
- package/dist/retriableDocumentStorageService.js.map +0 -1
- package/dist/utils.js.map +0 -1
- package/lib/audience.d.ts.map +0 -1
- package/lib/audience.js.map +0 -1
- package/lib/collabWindowTracker.d.ts +0 -19
- package/lib/collabWindowTracker.d.ts.map +0 -1
- package/lib/collabWindowTracker.js.map +0 -1
- package/lib/connectionManager.d.ts.map +0 -1
- package/lib/connectionManager.js.map +0 -1
- package/lib/connectionState.d.ts.map +0 -1
- package/lib/connectionState.js.map +0 -1
- package/lib/connectionStateHandler.d.ts +0 -81
- package/lib/connectionStateHandler.d.ts.map +0 -1
- package/lib/connectionStateHandler.js +0 -276
- package/lib/connectionStateHandler.js.map +0 -1
- package/lib/container.d.ts +0 -238
- package/lib/container.d.ts.map +0 -1
- package/lib/container.js +0 -1276
- package/lib/container.js.map +0 -1
- package/lib/containerContext.d.ts +0 -84
- package/lib/containerContext.d.ts.map +0 -1
- package/lib/containerContext.js +0 -213
- package/lib/containerContext.js.map +0 -1
- package/lib/containerStorageAdapter.d.ts +0 -48
- package/lib/containerStorageAdapter.d.ts.map +0 -1
- package/lib/containerStorageAdapter.js +0 -99
- package/lib/containerStorageAdapter.js.map +0 -1
- package/lib/contracts.d.ts.map +0 -1
- package/lib/contracts.js.map +0 -1
- package/lib/deltaManager.d.ts.map +0 -1
- package/lib/deltaManager.js.map +0 -1
- package/lib/deltaManagerProxy.d.ts +0 -54
- package/lib/deltaManagerProxy.d.ts.map +0 -1
- package/lib/deltaManagerProxy.js +0 -110
- package/lib/deltaManagerProxy.js.map +0 -1
- package/lib/deltaQueue.d.ts.map +0 -1
- package/lib/deltaQueue.js.map +0 -1
- package/lib/index.d.ts +0 -8
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -8
- package/lib/index.js.map +0 -1
- package/lib/loader.d.ts.map +0 -1
- package/lib/loader.js +0 -236
- package/lib/loader.js.map +0 -1
- package/lib/packageVersion.js.map +0 -1
- package/lib/protocolTreeDocumentStorageService.d.ts.map +0 -1
- package/lib/protocolTreeDocumentStorageService.js.map +0 -1
- package/lib/quorum.d.ts +0 -21
- package/lib/quorum.d.ts.map +0 -1
- package/lib/quorum.js +0 -38
- package/lib/quorum.js.map +0 -1
- package/lib/retriableDocumentStorageService.d.ts.map +0 -1
- package/lib/retriableDocumentStorageService.js.map +0 -1
- package/lib/utils.d.ts +0 -34
- package/lib/utils.d.ts.map +0 -1
- package/lib/utils.js.map +0 -1
- package/src/collabWindowTracker.ts +0 -102
- package/src/deltaManagerProxy.ts +0 -158
- package/tsconfig.esnext.json +0 -7
package/dist/container.d.ts
CHANGED
|
@@ -2,156 +2,263 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
6
|
-
import { IAudience, IContainer, IContainerEvents,
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { EventEmitterWithErrorHandling,
|
|
10
|
-
import {
|
|
5
|
+
import { ITelemetryProperties, IRequest, FluidObject } from "@fluidframework/core-interfaces";
|
|
6
|
+
import { AttachState, IAudience, ICodeDetailsLoader, IContainer, IContainerEvents, IContainerLoadMode, ICriticalContainerError, IDeltaManager, IFluidCodeDetails, ReadOnlyInfo } from "@fluidframework/container-definitions";
|
|
7
|
+
import { IDocumentServiceFactory, IResolvedUrl, IUrlResolver } from "@fluidframework/driver-definitions";
|
|
8
|
+
import { IClientDetails, IDocumentMessage, IQuorumClients, ISequencedDocumentMessage, ISnapshotTree } from "@fluidframework/protocol-definitions";
|
|
9
|
+
import { EventEmitterWithErrorHandling, ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
|
|
10
|
+
import { IDetachedBlobStorage, ILoaderOptions } from "./loader";
|
|
11
|
+
import { ISerializableBlobContents } from "./containerStorageAdapter";
|
|
11
12
|
import { ConnectionState } from "./connectionState";
|
|
12
|
-
|
|
13
|
+
import { ProtocolHandlerBuilder } from "./protocol";
|
|
14
|
+
/**
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
export interface IContainerLoadProps {
|
|
13
18
|
/**
|
|
14
|
-
*
|
|
19
|
+
* The resolved url of the container being loaded
|
|
15
20
|
*/
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Client details provided in the override will be merged over the default client.
|
|
19
|
-
*/
|
|
20
|
-
clientDetailsOverride?: IClientDetails;
|
|
21
|
-
resolvedUrl: IFluidResolvedUrl;
|
|
21
|
+
readonly resolvedUrl: IResolvedUrl;
|
|
22
22
|
/**
|
|
23
23
|
* Control which snapshot version to load from. See IParsedUrl for detailed information.
|
|
24
24
|
*/
|
|
25
|
-
version: string | undefined;
|
|
25
|
+
readonly version: string | undefined;
|
|
26
26
|
/**
|
|
27
27
|
* Loads the Container in paused state if true, unpaused otherwise.
|
|
28
28
|
*/
|
|
29
|
-
loadMode?: IContainerLoadMode;
|
|
29
|
+
readonly loadMode?: IContainerLoadMode;
|
|
30
|
+
/**
|
|
31
|
+
* The pending state serialized from a pervious container instance
|
|
32
|
+
*/
|
|
33
|
+
readonly pendingLocalState?: IPendingContainerState;
|
|
34
|
+
/**
|
|
35
|
+
* Load the container to at least this sequence number.
|
|
36
|
+
*/
|
|
37
|
+
readonly loadToSequenceNumber?: number;
|
|
30
38
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
39
|
+
/**
|
|
40
|
+
* @internal
|
|
41
|
+
*/
|
|
42
|
+
export interface IContainerCreateProps {
|
|
43
|
+
/**
|
|
44
|
+
* Disables the Container from reconnecting if false, allows reconnect otherwise.
|
|
45
|
+
*/
|
|
46
|
+
readonly canReconnect?: boolean;
|
|
34
47
|
/**
|
|
35
48
|
* Client details provided in the override will be merged over the default client.
|
|
36
49
|
*/
|
|
37
|
-
clientDetailsOverride?: IClientDetails;
|
|
50
|
+
readonly clientDetailsOverride?: IClientDetails;
|
|
51
|
+
/**
|
|
52
|
+
* The url resolver used by the loader for resolving external urls
|
|
53
|
+
* into Fluid urls such that the container specified by the
|
|
54
|
+
* external url can be loaded.
|
|
55
|
+
*/
|
|
56
|
+
readonly urlResolver: IUrlResolver;
|
|
38
57
|
/**
|
|
39
|
-
*
|
|
58
|
+
* The document service factory take the Fluid url provided
|
|
59
|
+
* by the resolved url and constructs all the necessary services
|
|
60
|
+
* for communication with the container's server.
|
|
40
61
|
*/
|
|
41
|
-
|
|
62
|
+
readonly documentServiceFactory: IDocumentServiceFactory;
|
|
63
|
+
/**
|
|
64
|
+
* The code loader handles loading the necessary code
|
|
65
|
+
* for running a container once it is loaded.
|
|
66
|
+
*/
|
|
67
|
+
readonly codeLoader: ICodeDetailsLoader;
|
|
68
|
+
/**
|
|
69
|
+
* A property bag of options used by various layers
|
|
70
|
+
* to control features
|
|
71
|
+
*/
|
|
72
|
+
readonly options: ILoaderOptions;
|
|
73
|
+
/**
|
|
74
|
+
* Scope is provided to all container and is a set of shared
|
|
75
|
+
* services for container's to integrate with their host environment.
|
|
76
|
+
*/
|
|
77
|
+
readonly scope: FluidObject;
|
|
78
|
+
/**
|
|
79
|
+
* The logger downstream consumers should construct their loggers from
|
|
80
|
+
*/
|
|
81
|
+
readonly subLogger: ITelemetryLoggerExt;
|
|
82
|
+
/**
|
|
83
|
+
* Blobs storage for detached containers.
|
|
84
|
+
*/
|
|
85
|
+
readonly detachedBlobStorage?: IDetachedBlobStorage;
|
|
86
|
+
/**
|
|
87
|
+
* Optional property for allowing the container to use a custom
|
|
88
|
+
* protocol implementation for handling the quorum and/or the audience.
|
|
89
|
+
*/
|
|
90
|
+
readonly protocolHandlerBuilder?: ProtocolHandlerBuilder;
|
|
42
91
|
}
|
|
43
92
|
/**
|
|
44
|
-
* Waits until container connects to delta storage and gets up-to-date
|
|
93
|
+
* Waits until container connects to delta storage and gets up-to-date.
|
|
94
|
+
*
|
|
45
95
|
* Useful when resolving URIs and hitting 404, due to container being loaded from (stale) snapshot and not being
|
|
46
96
|
* up to date. Host may chose to wait in such case and retry resolving URI.
|
|
97
|
+
*
|
|
47
98
|
* Warning: Will wait infinitely for connection to establish if there is no connection.
|
|
48
99
|
* May result in deadlock if Container.disconnect() is called and never followed by a call to Container.connect().
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
100
|
+
*
|
|
101
|
+
* @returns `true`: container is up to date, it processed all the ops that were know at the time of first connection.
|
|
102
|
+
*
|
|
103
|
+
* `false`: storage does not provide indication of how far the client is. Container processed all the ops known to it,
|
|
104
|
+
* but it maybe still behind.
|
|
105
|
+
*
|
|
52
106
|
* @throws an error beginning with `"Container closed"` if the container is closed before it catches up.
|
|
107
|
+
* @alpha
|
|
53
108
|
*/
|
|
54
109
|
export declare function waitContainerToCatchUp(container: IContainer): Promise<boolean>;
|
|
110
|
+
/**
|
|
111
|
+
* Helper function to report to telemetry cases where operation takes longer than expected (200ms)
|
|
112
|
+
* @param logger - logger to use
|
|
113
|
+
* @param eventName - event name
|
|
114
|
+
* @param action - functor to call and measure
|
|
115
|
+
*/
|
|
116
|
+
export declare function ReportIfTooLong(logger: ITelemetryLoggerExt, eventName: string, action: () => Promise<ITelemetryProperties>): Promise<void>;
|
|
55
117
|
/**
|
|
56
118
|
* State saved by a container at close time, to be used to load a new instance
|
|
57
119
|
* of the container to the same state
|
|
120
|
+
* @internal
|
|
58
121
|
*/
|
|
59
122
|
export interface IPendingContainerState {
|
|
60
123
|
pendingRuntimeState: unknown;
|
|
124
|
+
/**
|
|
125
|
+
* Snapshot from which container initially loaded.
|
|
126
|
+
*/
|
|
127
|
+
baseSnapshot: ISnapshotTree;
|
|
128
|
+
/**
|
|
129
|
+
* Serializable blobs from the base snapshot. Used to load offline since
|
|
130
|
+
* storage is not available.
|
|
131
|
+
*/
|
|
132
|
+
snapshotBlobs: ISerializableBlobContents;
|
|
133
|
+
/**
|
|
134
|
+
* All ops since base snapshot sequence number up to the latest op
|
|
135
|
+
* seen when the container was closed. Used to apply stashed (saved pending)
|
|
136
|
+
* ops at the same sequence number at which they were made.
|
|
137
|
+
*/
|
|
138
|
+
savedOps: ISequencedDocumentMessage[];
|
|
61
139
|
url: string;
|
|
62
|
-
protocol: IProtocolState;
|
|
63
|
-
term: number;
|
|
64
140
|
clientId?: string;
|
|
65
141
|
}
|
|
66
|
-
export declare class Container extends EventEmitterWithErrorHandling<IContainerEvents> implements IContainer {
|
|
67
|
-
private readonly loader;
|
|
68
|
-
static version: string;
|
|
142
|
+
export declare class Container extends EventEmitterWithErrorHandling<IContainerEvents> implements IContainer, IContainerExperimental {
|
|
69
143
|
/**
|
|
70
144
|
* Load an existing container.
|
|
145
|
+
* @internal
|
|
71
146
|
*/
|
|
72
|
-
static load(
|
|
147
|
+
static load(loadProps: IContainerLoadProps, createProps: IContainerCreateProps): Promise<Container>;
|
|
73
148
|
/**
|
|
74
149
|
* Create a new container in a detached state.
|
|
75
150
|
*/
|
|
76
|
-
static createDetached(
|
|
151
|
+
static createDetached(createProps: IContainerCreateProps, codeDetails: IFluidCodeDetails): Promise<Container>;
|
|
77
152
|
/**
|
|
78
153
|
* Create a new container in a detached state that is initialized with a
|
|
79
154
|
* snapshot from a previous detached container.
|
|
80
155
|
*/
|
|
81
|
-
static rehydrateDetachedFromSnapshot(
|
|
82
|
-
subLogger: TelemetryLogger;
|
|
156
|
+
static rehydrateDetachedFromSnapshot(createProps: IContainerCreateProps, snapshot: string): Promise<Container>;
|
|
83
157
|
private readonly _canReconnect;
|
|
158
|
+
private readonly clientDetailsOverride;
|
|
159
|
+
private readonly urlResolver;
|
|
160
|
+
private readonly serviceFactory;
|
|
161
|
+
private readonly codeLoader;
|
|
162
|
+
private readonly options;
|
|
163
|
+
private readonly scope;
|
|
164
|
+
private readonly subLogger;
|
|
165
|
+
private readonly detachedBlobStorage;
|
|
166
|
+
private readonly protocolHandlerBuilder;
|
|
167
|
+
private readonly client;
|
|
84
168
|
private readonly mc;
|
|
169
|
+
/**
|
|
170
|
+
* Used by the RelativeLoader to spawn a new Container for the same document. Used to create the summarizing client.
|
|
171
|
+
* @internal
|
|
172
|
+
*/
|
|
173
|
+
readonly clone: (loadProps: IContainerLoadProps, createParamOverrides: Partial<IContainerCreateProps>) => Promise<Container>;
|
|
174
|
+
/**
|
|
175
|
+
* Lifecycle state of the container, used mainly to prevent re-entrancy and telemetry
|
|
176
|
+
*
|
|
177
|
+
* States are allowed to progress to further states:
|
|
178
|
+
* "loading" - "loaded" - "closing" - "disposing" - "closed" - "disposed"
|
|
179
|
+
*
|
|
180
|
+
* For example, moving from "closed" to "disposing" is not allowed since it is an earlier state.
|
|
181
|
+
*
|
|
182
|
+
* loading: Container has been created, but is not yet in normal/loaded state
|
|
183
|
+
* loaded: Container is in normal/loaded state
|
|
184
|
+
* closing: Container has started closing process (for re-entrancy prevention)
|
|
185
|
+
* disposing: Container has started disposing process (for re-entrancy prevention)
|
|
186
|
+
* closed: Container has closed
|
|
187
|
+
* disposed: Container has been disposed
|
|
188
|
+
*/
|
|
85
189
|
private _lifecycleState;
|
|
86
190
|
private setLoaded;
|
|
87
191
|
get closed(): boolean;
|
|
192
|
+
get disposed(): boolean;
|
|
88
193
|
private _attachState;
|
|
89
|
-
private readonly
|
|
90
|
-
get storage(): IDocumentStorageService;
|
|
91
|
-
private _storageService;
|
|
92
|
-
private get storageService();
|
|
93
|
-
private readonly clientDetailsOverride;
|
|
194
|
+
private readonly storageAdapter;
|
|
94
195
|
private readonly _deltaManager;
|
|
95
196
|
private service;
|
|
96
|
-
private
|
|
97
|
-
private
|
|
98
|
-
private get context();
|
|
197
|
+
private _runtime;
|
|
198
|
+
private get runtime();
|
|
99
199
|
private _protocolHandler;
|
|
100
200
|
private get protocolHandler();
|
|
101
201
|
/** During initialization we pause the inbound queues. We track this state to ensure we only call resume once */
|
|
102
202
|
private inboundQueuePausedFromInit;
|
|
103
203
|
private firstConnection;
|
|
104
204
|
private readonly connectionTransitionTimes;
|
|
105
|
-
private messageCountAfterDisconnection;
|
|
106
205
|
private _loadedFromVersion;
|
|
107
|
-
private _resolvedUrl;
|
|
108
206
|
private attachStarted;
|
|
109
207
|
private _dirtyContainer;
|
|
208
|
+
private readonly savedOps;
|
|
209
|
+
private baseSnapshot?;
|
|
210
|
+
private baseSnapshotBlobs?;
|
|
211
|
+
private readonly _containerId;
|
|
110
212
|
private lastVisible;
|
|
111
213
|
private readonly visibilityEventHandler;
|
|
112
214
|
private readonly connectionStateHandler;
|
|
215
|
+
private readonly clientsWhoShouldHaveLeft;
|
|
113
216
|
private setAutoReconnectTime;
|
|
114
|
-
private
|
|
217
|
+
private noopHeuristic;
|
|
115
218
|
private get connectionMode();
|
|
116
|
-
get IFluidRouter(): IFluidRouter;
|
|
117
219
|
get resolvedUrl(): IResolvedUrl | undefined;
|
|
118
|
-
get loadedFromVersion(): IVersion | undefined;
|
|
119
220
|
get readOnlyInfo(): ReadOnlyInfo;
|
|
120
|
-
get closeSignal(): AbortSignal;
|
|
121
221
|
/**
|
|
122
|
-
*
|
|
222
|
+
* Sends signal to runtime (and data stores) to be read-only.
|
|
223
|
+
* Hosts may have read only views, indicating to data stores that no edits are allowed.
|
|
224
|
+
* This is independent from this._readonlyPermissions (permissions) and this.connectionMode
|
|
225
|
+
* (server can return "write" mode even when asked for "read")
|
|
226
|
+
* Leveraging same "readonly" event as runtime & data stores should behave the same in such case
|
|
227
|
+
* as in read-only permissions.
|
|
228
|
+
* But this.active can be used by some DDSes to figure out if ops can be sent
|
|
229
|
+
* (for example, read-only view still participates in code proposals / upgrades decisions)
|
|
230
|
+
*
|
|
231
|
+
* Forcing Readonly does not prevent DDS from generating ops. It is up to user code to honour
|
|
232
|
+
* the readonly flag. If ops are generated, they will accumulate locally and not be sent. If
|
|
233
|
+
* there are pending in the outbound queue, it will stop sending until force readonly is
|
|
234
|
+
* cleared.
|
|
235
|
+
*
|
|
236
|
+
* @param readonly - set or clear force readonly.
|
|
123
237
|
*/
|
|
124
238
|
forceReadonly(readonly: boolean): void;
|
|
125
239
|
get deltaManager(): IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
|
|
126
240
|
get connectionState(): ConnectionState;
|
|
127
|
-
get connected()
|
|
128
|
-
|
|
129
|
-
* Service configuration details. If running in offline mode will be undefined otherwise will contain service
|
|
130
|
-
* configuration details returned as part of the initial connection.
|
|
131
|
-
*/
|
|
132
|
-
get serviceConfiguration(): IClientConfiguration | undefined;
|
|
241
|
+
private get connected();
|
|
242
|
+
private _clientId;
|
|
133
243
|
/**
|
|
134
244
|
* The server provided id of the client.
|
|
135
245
|
* Set once this.connected is true, otherwise undefined
|
|
136
246
|
*/
|
|
137
247
|
get clientId(): string | undefined;
|
|
138
|
-
|
|
139
|
-
* The server provided claims of the client.
|
|
140
|
-
* Set once this.connected is true, otherwise undefined
|
|
141
|
-
*/
|
|
142
|
-
get scopes(): string[] | undefined;
|
|
143
|
-
get clientDetails(): IClientDetails;
|
|
248
|
+
private get offlineLoadEnabled();
|
|
144
249
|
/**
|
|
145
250
|
* Get the code details that are currently specified for the container.
|
|
146
251
|
* @returns The current code details if any are specified, undefined if none are specified.
|
|
147
252
|
*/
|
|
148
253
|
getSpecifiedCodeDetails(): IFluidCodeDetails | undefined;
|
|
254
|
+
private _loadedCodeDetails;
|
|
149
255
|
/**
|
|
150
256
|
* Get the code details that were used to load the container.
|
|
151
257
|
* @returns The code details that were used to load the container if it is loaded, undefined if it is not yet
|
|
152
258
|
* loaded.
|
|
153
259
|
*/
|
|
154
260
|
getLoadedCodeDetails(): IFluidCodeDetails | undefined;
|
|
261
|
+
private _loadedModule;
|
|
155
262
|
/**
|
|
156
263
|
* Retrieves the audience associated with the document
|
|
157
264
|
*/
|
|
@@ -159,55 +266,65 @@ export declare class Container extends EventEmitterWithErrorHandling<IContainerE
|
|
|
159
266
|
/**
|
|
160
267
|
* Returns true if container is dirty.
|
|
161
268
|
* Which means data loss if container is closed at that same moment
|
|
162
|
-
* Most likely that happens when there is no network connection to
|
|
269
|
+
* Most likely that happens when there is no network connection to Relay Service
|
|
163
270
|
*/
|
|
164
271
|
get isDirty(): boolean;
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
private
|
|
170
|
-
|
|
272
|
+
/**
|
|
273
|
+
* {@inheritDoc @fluidframework/container-definitions#IContainer.entryPoint}
|
|
274
|
+
*/
|
|
275
|
+
getEntryPoint(): Promise<FluidObject>;
|
|
276
|
+
private readonly _lifecycleEvents;
|
|
277
|
+
/**
|
|
278
|
+
* @internal
|
|
279
|
+
*/
|
|
280
|
+
constructor(createProps: IContainerCreateProps, loadProps?: Pick<IContainerLoadProps, "pendingLocalState">);
|
|
171
281
|
/**
|
|
172
282
|
* Retrieves the quorum associated with the document
|
|
173
283
|
*/
|
|
174
284
|
getQuorum(): IQuorumClients;
|
|
285
|
+
dispose(error?: ICriticalContainerError): void;
|
|
175
286
|
close(error?: ICriticalContainerError): void;
|
|
287
|
+
private verifyClosed;
|
|
176
288
|
private closeCore;
|
|
177
|
-
|
|
289
|
+
private _disposed;
|
|
290
|
+
private disposeCore;
|
|
291
|
+
closeAndGetPendingLocalState(stopBlobAttachingSignal?: AbortSignal): Promise<string>;
|
|
292
|
+
getPendingLocalState(): Promise<string>;
|
|
293
|
+
private getPendingLocalStateCore;
|
|
178
294
|
get attachState(): AttachState;
|
|
179
295
|
serialize(): string;
|
|
180
|
-
attach(request: IRequest
|
|
181
|
-
|
|
296
|
+
attach(request: IRequest, attachProps?: {
|
|
297
|
+
deltaConnection?: "none" | "delayed";
|
|
298
|
+
}): Promise<void>;
|
|
182
299
|
private setAutoReconnectInternal;
|
|
183
300
|
connect(): void;
|
|
184
301
|
private connectInternal;
|
|
185
302
|
disconnect(): void;
|
|
186
303
|
private disconnectInternal;
|
|
187
304
|
private resumeInternal;
|
|
188
|
-
getAbsoluteUrl(relativeUrl: string)
|
|
305
|
+
readonly getAbsoluteUrl: (relativeUrl: string) => Promise<string | undefined>;
|
|
189
306
|
proposeCodeDetails(codeDetails: IFluidCodeDetails): Promise<boolean>;
|
|
190
307
|
private processCodeProposal;
|
|
308
|
+
/**
|
|
309
|
+
* Determines if the currently loaded module satisfies the incoming constraint code details
|
|
310
|
+
*/
|
|
311
|
+
private satisfies;
|
|
191
312
|
private getVersion;
|
|
192
|
-
private recordConnectStartTime;
|
|
193
313
|
private connectToDeltaStream;
|
|
194
314
|
/**
|
|
195
315
|
* Load container.
|
|
196
316
|
*
|
|
197
|
-
* @param specifiedVersion -
|
|
198
|
-
* - undefined - fetch latest snapshot
|
|
199
|
-
* - otherwise, version sha to load snapshot
|
|
317
|
+
* @param specifiedVersion - Version SHA to load snapshot. If not specified, will fetch the latest snapshot.
|
|
200
318
|
*/
|
|
201
319
|
private load;
|
|
202
320
|
private createDetached;
|
|
203
321
|
private rehydrateDetachedFromSnapshot;
|
|
204
|
-
private connectStorageService;
|
|
205
322
|
private getDocumentAttributes;
|
|
206
323
|
private initializeProtocolStateFromSnapshot;
|
|
207
324
|
private initializeProtocolState;
|
|
208
325
|
private captureProtocolSummary;
|
|
209
326
|
private getCodeDetailsFromQuorum;
|
|
210
|
-
private
|
|
327
|
+
private static setupClient;
|
|
211
328
|
/**
|
|
212
329
|
* Returns true if connection is active, i.e. it's "write" connection and
|
|
213
330
|
* container runtime was notified about this connection (i.e. we are up-to-date and could send ops).
|
|
@@ -220,6 +337,9 @@ export declare class Container extends EventEmitterWithErrorHandling<IContainerE
|
|
|
220
337
|
private logConnectionStateChangeTelemetry;
|
|
221
338
|
private propagateConnectionState;
|
|
222
339
|
private submitContainerMessage;
|
|
340
|
+
/** @returns clientSequenceNumber of last message in a batch */
|
|
341
|
+
private submitBatch;
|
|
342
|
+
private submitSummaryMessage;
|
|
223
343
|
private submitMessage;
|
|
224
344
|
private processRemoteMessage;
|
|
225
345
|
private submitSignal;
|
|
@@ -230,9 +350,33 @@ export declare class Container extends EventEmitterWithErrorHandling<IContainerE
|
|
|
230
350
|
* @returns The snapshot requested, or the latest snapshot if no version was specified, plus version ID
|
|
231
351
|
*/
|
|
232
352
|
private fetchSnapshotTree;
|
|
233
|
-
private
|
|
234
|
-
private
|
|
235
|
-
|
|
236
|
-
|
|
353
|
+
private instantiateRuntime;
|
|
354
|
+
private readonly updateDirtyContainerState;
|
|
355
|
+
/**
|
|
356
|
+
* Set the connected state of the ContainerContext
|
|
357
|
+
* This controls the "connected" state of the ContainerRuntime as well
|
|
358
|
+
* @param state - Is the container currently connected?
|
|
359
|
+
* @param readonly - Is the container in readonly mode?
|
|
360
|
+
*/
|
|
361
|
+
private setContextConnectedState;
|
|
362
|
+
private handleDeltaConnectionArg;
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* IContainer interface that includes experimental features still under development.
|
|
366
|
+
* @internal
|
|
367
|
+
*/
|
|
368
|
+
export interface IContainerExperimental extends IContainer {
|
|
369
|
+
/**
|
|
370
|
+
* Get pending state from container. WARNING: misuse of this API can result in duplicate op
|
|
371
|
+
* submission and potential document corruption. The blob returned MUST be deleted if and when this
|
|
372
|
+
* container emits a "connected" event.
|
|
373
|
+
* @returns serialized blob that can be passed to Loader.resolve()
|
|
374
|
+
*/
|
|
375
|
+
getPendingLocalState?(): Promise<string>;
|
|
376
|
+
/**
|
|
377
|
+
* Closes the container and returns serialized local state intended to be
|
|
378
|
+
* given to a newly loaded container.
|
|
379
|
+
*/
|
|
380
|
+
closeAndGetPendingLocalState?(stopBlobAttachingSignal?: AbortSignal): Promise<string>;
|
|
237
381
|
}
|
|
238
382
|
//# sourceMappingURL=container.d.ts.map
|
package/dist/container.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../src/container.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../src/container.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAEN,oBAAoB,EAEpB,QAAQ,EACR,WAAW,EAEX,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACN,WAAW,EAEX,SAAS,EAET,kBAAkB,EAClB,UAAU,EACV,gBAAgB,EAChB,kBAAkB,EAClB,uBAAuB,EACvB,aAAa,EACb,iBAAiB,EAOjB,YAAY,EAGZ,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAEN,uBAAuB,EAEvB,YAAY,EAEZ,YAAY,EACZ,MAAM,oCAAoC,CAAC;AAU5C,OAAO,EAEN,cAAc,EAGd,gBAAgB,EAChB,cAAc,EAGd,yBAAyB,EAGzB,aAAa,EAMb,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAEN,6BAA6B,EAQ7B,mBAAmB,EAInB,MAAM,iCAAiC,CAAC;AAWzC,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAkB,MAAM,UAAU,CAAC;AAEhF,OAAO,EAIN,yBAAyB,EACzB,MAAM,2BAA2B,CAAC;AAUnC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAGN,sBAAsB,EAEtB,MAAM,YAAY,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YACW,iBAAiB;YAqBjB,kBAAkB;IAiFhC,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAMxC;IAEF;;;;;OAKG;IACH,OAAO,CAAC,wBAAwB;IAYhC,OAAO,CAAC,wBAAwB;CA2BhC;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAuB,SAAQ,UAAU;IACzD;;;;;OAKG;IACH,oBAAoB,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAEzC;;;OAGG;IACH,4BAA4B,CAAC,CAAC,uBAAuB,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACtF"}
|
|
@@ -0,0 +1,74 @@
|
|
|
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.ContainerContext = void 0;
|
|
8
|
+
/**
|
|
9
|
+
* {@inheritDoc @fluidframework/container-definitions#IContainerContext}
|
|
10
|
+
*/
|
|
11
|
+
class ContainerContext {
|
|
12
|
+
get clientId() {
|
|
13
|
+
return this._getClientId();
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* DISCLAIMER: this id is only for telemetry purposes. Not suitable for any other usages.
|
|
17
|
+
*/
|
|
18
|
+
get id() {
|
|
19
|
+
return this._getContainerDiagnosticId() ?? "";
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* When true, ops are free to flow
|
|
23
|
+
* When false, ops should be kept as pending or rejected
|
|
24
|
+
*/
|
|
25
|
+
get connected() {
|
|
26
|
+
return this._getConnected();
|
|
27
|
+
}
|
|
28
|
+
constructor(options, scope, baseSnapshot, _version, deltaManager, storage, quorum, audience, loader, submitFn, submitSummaryFn,
|
|
29
|
+
/** @returns clientSequenceNumber of last message in a batch */
|
|
30
|
+
submitBatchFn, submitSignalFn, disposeFn, closeFn, updateDirtyContainerState, getAbsoluteUrl, _getContainerDiagnosticId, _getClientId, _getAttachState, _getConnected, getSpecifiedCodeDetails, clientDetails, existing, taggedLogger, pendingLocalState) {
|
|
31
|
+
this.options = options;
|
|
32
|
+
this.scope = scope;
|
|
33
|
+
this.baseSnapshot = baseSnapshot;
|
|
34
|
+
this._version = _version;
|
|
35
|
+
this.deltaManager = deltaManager;
|
|
36
|
+
this.storage = storage;
|
|
37
|
+
this.quorum = quorum;
|
|
38
|
+
this.audience = audience;
|
|
39
|
+
this.loader = loader;
|
|
40
|
+
this.submitFn = submitFn;
|
|
41
|
+
this.submitSummaryFn = submitSummaryFn;
|
|
42
|
+
this.submitBatchFn = submitBatchFn;
|
|
43
|
+
this.submitSignalFn = submitSignalFn;
|
|
44
|
+
this.disposeFn = disposeFn;
|
|
45
|
+
this.closeFn = closeFn;
|
|
46
|
+
this.updateDirtyContainerState = updateDirtyContainerState;
|
|
47
|
+
this.getAbsoluteUrl = getAbsoluteUrl;
|
|
48
|
+
this._getContainerDiagnosticId = _getContainerDiagnosticId;
|
|
49
|
+
this._getClientId = _getClientId;
|
|
50
|
+
this._getAttachState = _getAttachState;
|
|
51
|
+
this._getConnected = _getConnected;
|
|
52
|
+
this.getSpecifiedCodeDetails = getSpecifiedCodeDetails;
|
|
53
|
+
this.clientDetails = clientDetails;
|
|
54
|
+
this.existing = existing;
|
|
55
|
+
this.taggedLogger = taggedLogger;
|
|
56
|
+
this.pendingLocalState = pendingLocalState;
|
|
57
|
+
this.supportedFeatures = new Map([
|
|
58
|
+
/**
|
|
59
|
+
* This version of the loader accepts `referenceSequenceNumber`, provided by the container runtime,
|
|
60
|
+
* as a parameter to the `submitBatchFn` and `submitSummaryFn` functions.
|
|
61
|
+
* This is then used to set the reference sequence numbers of the submitted ops in the DeltaManager.
|
|
62
|
+
*/
|
|
63
|
+
["referenceSequenceNumbers", true],
|
|
64
|
+
]);
|
|
65
|
+
}
|
|
66
|
+
getLoadedFromVersion() {
|
|
67
|
+
return this._version;
|
|
68
|
+
}
|
|
69
|
+
get attachState() {
|
|
70
|
+
return this._getAttachState();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
exports.ContainerContext = ContainerContext;
|
|
74
|
+
//# sourceMappingURL=containerContext.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"containerContext.cjs","sourceRoot":"","sources":["../src/containerContext.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA2BH;;GAEG;AACH,MAAa,gBAAgB;IAU5B,IAAW,QAAQ;QAClB,OAAO,IAAI,CAAC,YAAY,EAAE,CAAC;IAC5B,CAAC;IAED;;OAEG;IACH,IAAW,EAAE;QACZ,OAAO,IAAI,CAAC,yBAAyB,EAAE,IAAI,EAAE,CAAC;IAC/C,CAAC;IAED;;;OAGG;IACH,IAAW,SAAS;QACnB,OAAO,IAAI,CAAC,aAAa,EAAE,CAAC;IAC7B,CAAC;IAED,YACiB,OAAuB,EACvB,KAAkB,EAClB,YAAuC,EACtC,QAA8B,EAC/B,YAAwE,EACxE,OAAgC,EAChC,MAAsB,EACtB,QAAmB,EACnB,MAAe,EACf,QAKL,EACK,eAGL;IACX,+DAA+D;IAC/C,aAGL,EACK,cAA+D,EAC/D,SAAoD,EACpD,OAAkD,EAClD,yBAAmD,EACnD,cAAoE,EACnE,yBAAmD,EACnD,YAAsC,EACtC,eAAkC,EAClC,aAA4B,EAC7B,uBAA4D,EAC5D,aAA6B,EAC7B,QAAiB,EACjB,YAAiC,EACjC,iBAA2B;QArC3B,YAAO,GAAP,OAAO,CAAgB;QACvB,UAAK,GAAL,KAAK,CAAa;QAClB,iBAAY,GAAZ,YAAY,CAA2B;QACtC,aAAQ,GAAR,QAAQ,CAAsB;QAC/B,iBAAY,GAAZ,YAAY,CAA4D;QACxE,YAAO,GAAP,OAAO,CAAyB;QAChC,WAAM,GAAN,MAAM,CAAgB;QACtB,aAAQ,GAAR,QAAQ,CAAW;QACnB,WAAM,GAAN,MAAM,CAAS;QACf,aAAQ,GAAR,QAAQ,CAKb;QACK,oBAAe,GAAf,eAAe,CAGpB;QAEK,kBAAa,GAAb,aAAa,CAGlB;QACK,mBAAc,GAAd,cAAc,CAAiD;QAC/D,cAAS,GAAT,SAAS,CAA2C;QACpD,YAAO,GAAP,OAAO,CAA2C;QAClD,8BAAyB,GAAzB,yBAAyB,CAA0B;QACnD,mBAAc,GAAd,cAAc,CAAsD;QACnE,8BAAyB,GAAzB,yBAAyB,CAA0B;QACnD,iBAAY,GAAZ,YAAY,CAA0B;QACtC,oBAAe,GAAf,eAAe,CAAmB;QAClC,kBAAa,GAAb,aAAa,CAAe;QAC7B,4BAAuB,GAAvB,uBAAuB,CAAqC;QAC5D,kBAAa,GAAb,aAAa,CAAgB;QAC7B,aAAQ,GAAR,QAAQ,CAAS;QACjB,iBAAY,GAAZ,YAAY,CAAqB;QACjC,sBAAiB,GAAjB,iBAAiB,CAAU;QAlE5B,sBAAiB,GAAiC,IAAI,GAAG,CAAC;YACzE;;;;eAIG;YACH,CAAC,0BAA0B,EAAE,IAAI,CAAC;SAClC,CAAC,CAAC;IA4DA,CAAC;IAEG,oBAAoB;QAC1B,OAAO,IAAI,CAAC,QAAQ,CAAC;IACtB,CAAC;IAED,IAAW,WAAW;QACrB,OAAO,IAAI,CAAC,eAAe,EAAE,CAAC;IAC/B,CAAC;CACD;AA7ED,4CA6EC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils\";\nimport {\n\tIAudience,\n\tIContainerContext,\n\tIDeltaManager,\n\tILoader,\n\tICriticalContainerError,\n\tAttachState,\n\tILoaderOptions,\n\tIFluidCodeDetails,\n\tIBatchMessage,\n} from \"@fluidframework/container-definitions\";\nimport { FluidObject } from \"@fluidframework/core-interfaces\";\nimport { IDocumentStorageService } from \"@fluidframework/driver-definitions\";\nimport {\n\tIClientDetails,\n\tIDocumentMessage,\n\tIQuorumClients,\n\tISequencedDocumentMessage,\n\tISnapshotTree,\n\tIVersion,\n\tMessageType,\n\tISummaryContent,\n} from \"@fluidframework/protocol-definitions\";\n\n/**\n * {@inheritDoc @fluidframework/container-definitions#IContainerContext}\n */\nexport class ContainerContext implements IContainerContext {\n\tpublic readonly supportedFeatures: ReadonlyMap<string, unknown> = new Map([\n\t\t/**\n\t\t * This version of the loader accepts `referenceSequenceNumber`, provided by the container runtime,\n\t\t * as a parameter to the `submitBatchFn` and `submitSummaryFn` functions.\n\t\t * This is then used to set the reference sequence numbers of the submitted ops in the DeltaManager.\n\t\t */\n\t\t[\"referenceSequenceNumbers\", true],\n\t]);\n\n\tpublic get clientId(): string | undefined {\n\t\treturn this._getClientId();\n\t}\n\n\t/**\n\t * DISCLAIMER: this id is only for telemetry purposes. Not suitable for any other usages.\n\t */\n\tpublic get id(): string {\n\t\treturn this._getContainerDiagnosticId() ?? \"\";\n\t}\n\n\t/**\n\t * When true, ops are free to flow\n\t * When false, ops should be kept as pending or rejected\n\t */\n\tpublic get connected(): boolean {\n\t\treturn this._getConnected();\n\t}\n\n\tconstructor(\n\t\tpublic readonly options: ILoaderOptions,\n\t\tpublic readonly scope: FluidObject,\n\t\tpublic readonly baseSnapshot: ISnapshotTree | undefined,\n\t\tprivate readonly _version: IVersion | undefined,\n\t\tpublic readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>,\n\t\tpublic readonly storage: IDocumentStorageService,\n\t\tpublic readonly quorum: IQuorumClients,\n\t\tpublic readonly audience: IAudience,\n\t\tpublic readonly loader: ILoader,\n\t\tpublic readonly submitFn: (\n\t\t\ttype: MessageType,\n\t\t\tcontents: any,\n\t\t\tbatch: boolean,\n\t\t\tappData: any,\n\t\t) => number,\n\t\tpublic readonly submitSummaryFn: (\n\t\t\tsummaryOp: ISummaryContent,\n\t\t\treferenceSequenceNumber?: number,\n\t\t) => number,\n\t\t/** @returns clientSequenceNumber of last message in a batch */\n\t\tpublic readonly submitBatchFn: (\n\t\t\tbatch: IBatchMessage[],\n\t\t\treferenceSequenceNumber?: number,\n\t\t) => number,\n\t\tpublic readonly submitSignalFn: (content: any, targetClientId?: string) => void,\n\t\tpublic readonly disposeFn: (error?: ICriticalContainerError) => void,\n\t\tpublic readonly closeFn: (error?: ICriticalContainerError) => void,\n\t\tpublic readonly updateDirtyContainerState: (dirty: boolean) => void,\n\t\tpublic readonly getAbsoluteUrl: (relativeUrl: string) => Promise<string | undefined>,\n\t\tprivate readonly _getContainerDiagnosticId: () => string | undefined,\n\t\tprivate readonly _getClientId: () => string | undefined,\n\t\tprivate readonly _getAttachState: () => AttachState,\n\t\tprivate readonly _getConnected: () => boolean,\n\t\tpublic readonly getSpecifiedCodeDetails: () => IFluidCodeDetails | undefined,\n\t\tpublic readonly clientDetails: IClientDetails,\n\t\tpublic readonly existing: boolean,\n\t\tpublic readonly taggedLogger: ITelemetryLoggerExt,\n\t\tpublic readonly pendingLocalState?: unknown,\n\t) {}\n\n\tpublic getLoadedFromVersion(): IVersion | undefined {\n\t\treturn this._version;\n\t}\n\n\tpublic get attachState(): AttachState {\n\t\treturn this._getAttachState();\n\t}\n}\n"]}
|