@fluidframework/container-loader 2.112.0 → 2.113.1
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 +4 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/loadContainerToSequenceNumber.d.ts +51 -0
- package/dist/loadContainerToSequenceNumber.d.ts.map +1 -0
- package/dist/loadContainerToSequenceNumber.js +42 -0
- package/dist/loadContainerToSequenceNumber.js.map +1 -0
- package/dist/loaderLayerCompatState.d.ts +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/pointInTimeServices.d.ts +47 -0
- package/dist/pointInTimeServices.d.ts.map +1 -0
- package/dist/pointInTimeServices.js +43 -0
- package/dist/pointInTimeServices.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/loadContainerToSequenceNumber.d.ts +51 -0
- package/lib/loadContainerToSequenceNumber.d.ts.map +1 -0
- package/lib/loadContainerToSequenceNumber.js +38 -0
- package/lib/loadContainerToSequenceNumber.js.map +1 -0
- package/lib/loaderLayerCompatState.d.ts +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/pointInTimeServices.d.ts +47 -0
- package/lib/pointInTimeServices.d.ts.map +1 -0
- package/lib/pointInTimeServices.js +38 -0
- package/lib/pointInTimeServices.js.map +1 -0
- package/package.json +11 -11
- package/src/index.ts +4 -0
- package/src/loadContainerToSequenceNumber.ts +97 -0
- package/src/packageVersion.ts +1 -1
- package/src/pointInTimeServices.ts +84 -0
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export type { LoadSummarizerSummaryResult, OnDemandSummaryResults, SummaryStage,
|
|
|
10
10
|
export { type ICodeDetailsLoader, type IFluidModuleWithDetails, type ILoaderProps, type ILoaderServices, Loader, } from "./loader.js";
|
|
11
11
|
export { driverSupportRequirementsForLoader, loaderCoreCompatDetails, runtimeSupportRequirementsForLoader, loaderCompatDetailsForRuntime, } from "./loaderLayerCompatState.js";
|
|
12
12
|
export { loadContainerPaused } from "./loadPaused.js";
|
|
13
|
+
export { loadContainerToSequenceNumber, type ILoadContainerToSequenceNumberProps, } from "./loadContainerToSequenceNumber.js";
|
|
13
14
|
export { isLocationRedirectionError, resolveWithLocationRedirectionHandling, } from "./location-redirection-utilities/index.js";
|
|
14
15
|
export type { IProtocolHandler, ProtocolHandlerBuilder } from "./protocol.js";
|
|
15
16
|
export { tryParseCompatibleResolvedUrl, type IParsedUrl, } from "./utils.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,KAAK,cAAc,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC5F,OAAO,EAAE,kCAAkC,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EACN,yBAAyB,EACzB,uBAAuB,EACvB,qBAAqB,EACrB,0BAA0B,EAC1B,mCAAmC,EACnC,qCAAqC,EACrC,KAAK,+BAA+B,EACpC,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,EAC9B,KAAK,4BAA4B,EACjC,KAAK,6BAA6B,EAClC,KAAK,2BAA2B,EAChC,KAAK,6BAA6B,EAClC,KAAK,gCAAgC,EACrC,KAAK,yCAAyC,GAC9C,MAAM,kCAAkC,CAAC;AAC1C,YAAY,EACX,2BAA2B,EAC3B,sBAAsB,EACtB,YAAY,GACZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACN,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,MAAM,GACN,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,kCAAkC,EAClC,uBAAuB,EACvB,mCAAmC,EACnC,6BAA6B,GAC7B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EACN,0BAA0B,EAC1B,sCAAsC,GACtC,MAAM,2CAA2C,CAAC;AACnD,YAAY,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAC9E,OAAO,EACN,6BAA6B,EAC7B,KAAK,UAAU,GACf,MAAM,YAAY,CAAC;AACpB,YAAY,EACX,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EACf,qBAAqB,EACrB,uBAAuB,GACvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EACN,2BAA2B,EAC3B,mBAAmB,EACnB,KAAK,oBAAoB,GACzB,MAAM,gCAAgC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,KAAK,cAAc,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC5F,OAAO,EAAE,kCAAkC,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EACN,yBAAyB,EACzB,uBAAuB,EACvB,qBAAqB,EACrB,0BAA0B,EAC1B,mCAAmC,EACnC,qCAAqC,EACrC,KAAK,+BAA+B,EACpC,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,EAC9B,KAAK,4BAA4B,EACjC,KAAK,6BAA6B,EAClC,KAAK,2BAA2B,EAChC,KAAK,6BAA6B,EAClC,KAAK,gCAAgC,EACrC,KAAK,yCAAyC,GAC9C,MAAM,kCAAkC,CAAC;AAC1C,YAAY,EACX,2BAA2B,EAC3B,sBAAsB,EACtB,YAAY,GACZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACN,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,MAAM,GACN,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,kCAAkC,EAClC,uBAAuB,EACvB,mCAAmC,EACnC,6BAA6B,GAC7B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EACN,6BAA6B,EAC7B,KAAK,mCAAmC,GACxC,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACN,0BAA0B,EAC1B,sCAAsC,GACtC,MAAM,2CAA2C,CAAC;AACnD,YAAY,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAC9E,OAAO,EACN,6BAA6B,EAC7B,KAAK,UAAU,GACf,MAAM,YAAY,CAAC;AACpB,YAAY,EACX,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EACf,qBAAqB,EACrB,uBAAuB,GACvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EACN,2BAA2B,EAC3B,mBAAmB,EACnB,KAAK,oBAAoB,GACzB,MAAM,gCAAgC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.wireFormatConstants = exports.extractBlobAttachReferences = exports.PendingLocalStateStore = exports.tryParseCompatibleResolvedUrl = exports.resolveWithLocationRedirectionHandling = exports.isLocationRedirectionError = exports.loadContainerPaused = exports.loaderCompatDetailsForRuntime = exports.runtimeSupportRequirementsForLoader = exports.loaderCoreCompatDetails = exports.driverSupportRequirementsForLoader = exports.Loader = exports.loadSummarizerContainerAndMakeSummary = exports.loadFrozenContainerFromPendingState = exports.rehydrateDetachedContainer = exports.loadExistingContainer = exports.createDetachedContainer = exports.captureFullContainerState = exports.createFrozenDocumentServiceFactory = exports.asLegacyAlpha = exports.waitContainerToCatchUp = exports.ConnectionState = void 0;
|
|
7
|
+
exports.wireFormatConstants = exports.extractBlobAttachReferences = exports.PendingLocalStateStore = exports.tryParseCompatibleResolvedUrl = exports.resolveWithLocationRedirectionHandling = exports.isLocationRedirectionError = exports.loadContainerToSequenceNumber = exports.loadContainerPaused = exports.loaderCompatDetailsForRuntime = exports.runtimeSupportRequirementsForLoader = exports.loaderCoreCompatDetails = exports.driverSupportRequirementsForLoader = exports.Loader = exports.loadSummarizerContainerAndMakeSummary = exports.loadFrozenContainerFromPendingState = exports.rehydrateDetachedContainer = exports.loadExistingContainer = exports.createDetachedContainer = exports.captureFullContainerState = exports.createFrozenDocumentServiceFactory = exports.asLegacyAlpha = exports.waitContainerToCatchUp = exports.ConnectionState = void 0;
|
|
8
8
|
var connectionState_js_1 = require("./connectionState.js");
|
|
9
9
|
Object.defineProperty(exports, "ConnectionState", { enumerable: true, get: function () { return connectionState_js_1.ConnectionState; } });
|
|
10
10
|
var container_js_1 = require("./container.js");
|
|
@@ -28,6 +28,8 @@ Object.defineProperty(exports, "runtimeSupportRequirementsForLoader", { enumerab
|
|
|
28
28
|
Object.defineProperty(exports, "loaderCompatDetailsForRuntime", { enumerable: true, get: function () { return loaderLayerCompatState_js_1.loaderCompatDetailsForRuntime; } });
|
|
29
29
|
var loadPaused_js_1 = require("./loadPaused.js");
|
|
30
30
|
Object.defineProperty(exports, "loadContainerPaused", { enumerable: true, get: function () { return loadPaused_js_1.loadContainerPaused; } });
|
|
31
|
+
var loadContainerToSequenceNumber_js_1 = require("./loadContainerToSequenceNumber.js");
|
|
32
|
+
Object.defineProperty(exports, "loadContainerToSequenceNumber", { enumerable: true, get: function () { return loadContainerToSequenceNumber_js_1.loadContainerToSequenceNumber; } });
|
|
31
33
|
var index_js_1 = require("./location-redirection-utilities/index.js");
|
|
32
34
|
Object.defineProperty(exports, "isLocationRedirectionError", { enumerable: true, get: function () { return index_js_1.isLocationRedirectionError; } });
|
|
33
35
|
Object.defineProperty(exports, "resolveWithLocationRedirectionHandling", { enumerable: true, get: function () { return index_js_1.resolveWithLocationRedirectionHandling; } });
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2DAAuD;AAA9C,qHAAA,eAAe,OAAA;AACxB,+CAA4F;AAA9D,sHAAA,sBAAsB,OAAA;AAAE,6GAAA,aAAa,OAAA;AACnE,yDAAyE;AAAhE,uIAAA,kCAAkC,OAAA;AAC3C,mFAiB0C;AAhBzC,2IAAA,yBAAyB,OAAA;AACzB,yIAAA,uBAAuB,OAAA;AACvB,uIAAA,qBAAqB,OAAA;AACrB,4IAAA,0BAA0B,OAAA;AAC1B,qJAAA,mCAAmC,OAAA;AACnC,uJAAA,qCAAqC,OAAA;AAiBtC,yCAMqB;AADpB,mGAAA,MAAM,OAAA;AAEP,yEAKqC;AAJpC,+IAAA,kCAAkC,OAAA;AAClC,oIAAA,uBAAuB,OAAA;AACvB,gJAAA,mCAAmC,OAAA;AACnC,0IAAA,6BAA6B,OAAA;AAE9B,iDAAsD;AAA7C,oHAAA,mBAAmB,OAAA;AAC5B,sEAGmD;AAFlD,sHAAA,0BAA0B,OAAA;AAC1B,kIAAA,sCAAsC,OAAA;AAGvC,uCAGoB;AAFnB,yHAAA,6BAA6B,OAAA;AAU9B,yEAAqE;AAA5D,mIAAA,sBAAsB,OAAA;AAC/B,+EAIwC;AAHvC,2IAAA,2BAA2B,OAAA;AAC3B,mIAAA,mBAAmB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { ConnectionState } from \"./connectionState.js\";\nexport { type ContainerAlpha, waitContainerToCatchUp, asLegacyAlpha } from \"./container.js\";\nexport { createFrozenDocumentServiceFactory } from \"./frozenServices.js\";\nexport {\n\tcaptureFullContainerState,\n\tcreateDetachedContainer,\n\tloadExistingContainer,\n\trehydrateDetachedContainer,\n\tloadFrozenContainerFromPendingState,\n\tloadSummarizerContainerAndMakeSummary,\n\ttype ICaptureFullContainerStateProps,\n\ttype IContainerDriverServices,\n\ttype IContainerHostProps,\n\ttype IContainerLoadDriverProps,\n\ttype ICreateAndLoadContainerProps,\n\ttype ICreateDetachedContainerProps,\n\ttype ILoadExistingContainerProps,\n\ttype ILoadSummarizerContainerProps,\n\ttype IRehydrateDetachedContainerProps,\n\ttype ILoadFrozenContainerFromPendingStateProps,\n} from \"./createAndLoadContainerUtils.js\";\nexport type {\n\tLoadSummarizerSummaryResult,\n\tOnDemandSummaryResults,\n\tSummaryStage,\n} from \"./summarizerResultTypes.js\";\nexport {\n\ttype ICodeDetailsLoader,\n\ttype IFluidModuleWithDetails,\n\ttype ILoaderProps,\n\ttype ILoaderServices,\n\tLoader,\n} from \"./loader.js\";\nexport {\n\tdriverSupportRequirementsForLoader,\n\tloaderCoreCompatDetails,\n\truntimeSupportRequirementsForLoader,\n\tloaderCompatDetailsForRuntime,\n} from \"./loaderLayerCompatState.js\";\nexport { loadContainerPaused } from \"./loadPaused.js\";\nexport {\n\tisLocationRedirectionError,\n\tresolveWithLocationRedirectionHandling,\n} from \"./location-redirection-utilities/index.js\";\nexport type { IProtocolHandler, ProtocolHandlerBuilder } from \"./protocol.js\";\nexport {\n\ttryParseCompatibleResolvedUrl,\n\ttype IParsedUrl,\n} from \"./utils.js\";\nexport type {\n\tIBaseProtocolHandler,\n\tIScribeProtocolState,\n\tIQuorumSnapshot,\n\tQuorumClientsSnapshot,\n\tQuorumProposalsSnapshot,\n} from \"./protocol/index.js\";\nexport { PendingLocalStateStore } from \"./pendingLocalStateStore.js\";\nexport {\n\textractBlobAttachReferences,\n\twireFormatConstants,\n\ttype IBlobAttachReference,\n} from \"./captureReferencedContents.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2DAAuD;AAA9C,qHAAA,eAAe,OAAA;AACxB,+CAA4F;AAA9D,sHAAA,sBAAsB,OAAA;AAAE,6GAAA,aAAa,OAAA;AACnE,yDAAyE;AAAhE,uIAAA,kCAAkC,OAAA;AAC3C,mFAiB0C;AAhBzC,2IAAA,yBAAyB,OAAA;AACzB,yIAAA,uBAAuB,OAAA;AACvB,uIAAA,qBAAqB,OAAA;AACrB,4IAAA,0BAA0B,OAAA;AAC1B,qJAAA,mCAAmC,OAAA;AACnC,uJAAA,qCAAqC,OAAA;AAiBtC,yCAMqB;AADpB,mGAAA,MAAM,OAAA;AAEP,yEAKqC;AAJpC,+IAAA,kCAAkC,OAAA;AAClC,oIAAA,uBAAuB,OAAA;AACvB,gJAAA,mCAAmC,OAAA;AACnC,0IAAA,6BAA6B,OAAA;AAE9B,iDAAsD;AAA7C,oHAAA,mBAAmB,OAAA;AAC5B,uFAG4C;AAF3C,iJAAA,6BAA6B,OAAA;AAG9B,sEAGmD;AAFlD,sHAAA,0BAA0B,OAAA;AAC1B,kIAAA,sCAAsC,OAAA;AAGvC,uCAGoB;AAFnB,yHAAA,6BAA6B,OAAA;AAU9B,yEAAqE;AAA5D,mIAAA,sBAAsB,OAAA;AAC/B,+EAIwC;AAHvC,2IAAA,2BAA2B,OAAA;AAC3B,mIAAA,mBAAmB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { ConnectionState } from \"./connectionState.js\";\nexport { type ContainerAlpha, waitContainerToCatchUp, asLegacyAlpha } from \"./container.js\";\nexport { createFrozenDocumentServiceFactory } from \"./frozenServices.js\";\nexport {\n\tcaptureFullContainerState,\n\tcreateDetachedContainer,\n\tloadExistingContainer,\n\trehydrateDetachedContainer,\n\tloadFrozenContainerFromPendingState,\n\tloadSummarizerContainerAndMakeSummary,\n\ttype ICaptureFullContainerStateProps,\n\ttype IContainerDriverServices,\n\ttype IContainerHostProps,\n\ttype IContainerLoadDriverProps,\n\ttype ICreateAndLoadContainerProps,\n\ttype ICreateDetachedContainerProps,\n\ttype ILoadExistingContainerProps,\n\ttype ILoadSummarizerContainerProps,\n\ttype IRehydrateDetachedContainerProps,\n\ttype ILoadFrozenContainerFromPendingStateProps,\n} from \"./createAndLoadContainerUtils.js\";\nexport type {\n\tLoadSummarizerSummaryResult,\n\tOnDemandSummaryResults,\n\tSummaryStage,\n} from \"./summarizerResultTypes.js\";\nexport {\n\ttype ICodeDetailsLoader,\n\ttype IFluidModuleWithDetails,\n\ttype ILoaderProps,\n\ttype ILoaderServices,\n\tLoader,\n} from \"./loader.js\";\nexport {\n\tdriverSupportRequirementsForLoader,\n\tloaderCoreCompatDetails,\n\truntimeSupportRequirementsForLoader,\n\tloaderCompatDetailsForRuntime,\n} from \"./loaderLayerCompatState.js\";\nexport { loadContainerPaused } from \"./loadPaused.js\";\nexport {\n\tloadContainerToSequenceNumber,\n\ttype ILoadContainerToSequenceNumberProps,\n} from \"./loadContainerToSequenceNumber.js\";\nexport {\n\tisLocationRedirectionError,\n\tresolveWithLocationRedirectionHandling,\n} from \"./location-redirection-utilities/index.js\";\nexport type { IProtocolHandler, ProtocolHandlerBuilder } from \"./protocol.js\";\nexport {\n\ttryParseCompatibleResolvedUrl,\n\ttype IParsedUrl,\n} from \"./utils.js\";\nexport type {\n\tIBaseProtocolHandler,\n\tIScribeProtocolState,\n\tIQuorumSnapshot,\n\tQuorumClientsSnapshot,\n\tQuorumProposalsSnapshot,\n} from \"./protocol/index.js\";\nexport { PendingLocalStateStore } from \"./pendingLocalStateStore.js\";\nexport {\n\textractBlobAttachReferences,\n\twireFormatConstants,\n\ttype IBlobAttachReference,\n} from \"./captureReferencedContents.js\";\n"]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import type { IContainer } from "@fluidframework/container-definitions/internal";
|
|
6
|
+
import type { IRequest } from "@fluidframework/core-interfaces";
|
|
7
|
+
import type { IContainerDriverServices, IContainerHostProps } from "./createAndLoadContainerUtils.js";
|
|
8
|
+
/**
|
|
9
|
+
* Properties used to materialize a container at a point in document history.
|
|
10
|
+
*
|
|
11
|
+
* @remarks
|
|
12
|
+
* This is distinct from normal container loading. The supplied
|
|
13
|
+
* {@link IContainerDriverServices.documentServiceFactory} must be able to materialize the document
|
|
14
|
+
* at {@link ILoadContainerToSequenceNumberProps.loadToSequenceNumber} - i.e. it must implement the
|
|
15
|
+
* point-in-time capability the loader detects. For ODSP, pass an
|
|
16
|
+
* `OdspPointInTimeDocumentServiceFactory` directly.
|
|
17
|
+
*
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
export interface ILoadContainerToSequenceNumberProps extends IContainerHostProps, IContainerDriverServices {
|
|
21
|
+
/**
|
|
22
|
+
* The request identifying the container instance.
|
|
23
|
+
*/
|
|
24
|
+
readonly request: IRequest;
|
|
25
|
+
/**
|
|
26
|
+
* The sequence number at which to materialize the container.
|
|
27
|
+
*/
|
|
28
|
+
readonly loadToSequenceNumber: number;
|
|
29
|
+
/**
|
|
30
|
+
* Cancels replay while waiting for the target sequence number.
|
|
31
|
+
*/
|
|
32
|
+
readonly signal?: AbortSignal | undefined;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Loads a read-only container at a target sequence number.
|
|
36
|
+
*
|
|
37
|
+
* @remarks
|
|
38
|
+
* The returned container is disconnected with inbound and outbound processing paused. It is a
|
|
39
|
+
* historical view and must not be used as a normal collaborative container.
|
|
40
|
+
*
|
|
41
|
+
* The supplied {@link IContainerDriverServices.documentServiceFactory} must support point-in-time
|
|
42
|
+
* loading: it must be able to serve a snapshot at or before
|
|
43
|
+
* {@link ILoadContainerToSequenceNumberProps.loadToSequenceNumber} and replay the document forward
|
|
44
|
+
* through that sequence number. For ODSP, pass an `OdspPointInTimeDocumentServiceFactory` (from
|
|
45
|
+
* `@fluidframework/odsp-driver`) directly - the loader materializes the point-in-time view itself,
|
|
46
|
+
* so no wrapping or decoration is required.
|
|
47
|
+
*
|
|
48
|
+
* @internal
|
|
49
|
+
*/
|
|
50
|
+
export declare function loadContainerToSequenceNumber(props: ILoadContainerToSequenceNumberProps): Promise<IContainer>;
|
|
51
|
+
//# sourceMappingURL=loadContainerToSequenceNumber.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loadContainerToSequenceNumber.d.ts","sourceRoot":"","sources":["../src/loadContainerToSequenceNumber.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gDAAgD,CAAC;AACjF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAGhE,OAAO,KAAK,EACX,wBAAwB,EACxB,mBAAmB,EACnB,MAAM,kCAAkC,CAAC;AAO1C;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,mCAChB,SAAQ,mBAAmB,EAC1B,wBAAwB;IACzB;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;IAEtC;;OAEG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;CAC1C;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,6BAA6B,CAClD,KAAK,EAAE,mCAAmC,GACxC,OAAO,CAAC,UAAU,CAAC,CA4BrB"}
|
|
@@ -0,0 +1,42 @@
|
|
|
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.loadContainerToSequenceNumber = void 0;
|
|
8
|
+
const internal_1 = require("@fluidframework/driver-utils/internal");
|
|
9
|
+
const loadPaused_js_1 = require("./loadPaused.js");
|
|
10
|
+
const pointInTimeServices_js_1 = require("./pointInTimeServices.js");
|
|
11
|
+
/**
|
|
12
|
+
* Loads a read-only container at a target sequence number.
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* The returned container is disconnected with inbound and outbound processing paused. It is a
|
|
16
|
+
* historical view and must not be used as a normal collaborative container.
|
|
17
|
+
*
|
|
18
|
+
* The supplied {@link IContainerDriverServices.documentServiceFactory} must support point-in-time
|
|
19
|
+
* loading: it must be able to serve a snapshot at or before
|
|
20
|
+
* {@link ILoadContainerToSequenceNumberProps.loadToSequenceNumber} and replay the document forward
|
|
21
|
+
* through that sequence number. For ODSP, pass an `OdspPointInTimeDocumentServiceFactory` (from
|
|
22
|
+
* `@fluidframework/odsp-driver`) directly - the loader materializes the point-in-time view itself,
|
|
23
|
+
* so no wrapping or decoration is required.
|
|
24
|
+
*
|
|
25
|
+
* @internal
|
|
26
|
+
*/
|
|
27
|
+
async function loadContainerToSequenceNumber(props) {
|
|
28
|
+
const { loadToSequenceNumber, documentServiceFactory } = props;
|
|
29
|
+
if (!Number.isInteger(loadToSequenceNumber) || loadToSequenceNumber < 0) {
|
|
30
|
+
throw new internal_1.UsageError(`loadToSequenceNumber must be a non-negative integer, got ${loadToSequenceNumber}.`);
|
|
31
|
+
}
|
|
32
|
+
const capableFactory = (0, pointInTimeServices_js_1.asPointInTimeCapableFactory)(documentServiceFactory);
|
|
33
|
+
if (capableFactory === undefined) {
|
|
34
|
+
throw new internal_1.UsageError("The provided documentServiceFactory does not support point-in-time loading. For ODSP, pass an OdspPointInTimeDocumentServiceFactory.");
|
|
35
|
+
}
|
|
36
|
+
// The loader owns materializing the target: it routes the container's createDocumentService call
|
|
37
|
+
// to the driver's point-in-time service, so the caller never wraps their factory.
|
|
38
|
+
const pointInTimeFactory = new pointInTimeServices_js_1.PointInTimeDocumentServiceFactory(capableFactory, loadToSequenceNumber);
|
|
39
|
+
return (0, loadPaused_js_1.loadContainerPaused)({ ...props, documentServiceFactory: pointInTimeFactory }, props.request, loadToSequenceNumber, props.signal);
|
|
40
|
+
}
|
|
41
|
+
exports.loadContainerToSequenceNumber = loadContainerToSequenceNumber;
|
|
42
|
+
//# sourceMappingURL=loadContainerToSequenceNumber.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loadContainerToSequenceNumber.js","sourceRoot":"","sources":["../src/loadContainerToSequenceNumber.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,oEAAmE;AAMnE,mDAAsD;AACtD,qEAGkC;AAiClC;;;;;;;;;;;;;;;GAeG;AACI,KAAK,UAAU,6BAA6B,CAClD,KAA0C;IAE1C,MAAM,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,GAAG,KAAK,CAAC;IAC/D,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC,IAAI,oBAAoB,GAAG,CAAC,EAAE,CAAC;QACzE,MAAM,IAAI,qBAAU,CACnB,4DAA4D,oBAAoB,GAAG,CACnF,CAAC;IACH,CAAC;IAED,MAAM,cAAc,GAAG,IAAA,oDAA2B,EAAC,sBAAsB,CAAC,CAAC;IAC3E,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;QAClC,MAAM,IAAI,qBAAU,CACnB,sIAAsI,CACtI,CAAC;IACH,CAAC;IAED,iGAAiG;IACjG,kFAAkF;IAClF,MAAM,kBAAkB,GAAG,IAAI,0DAAiC,CAC/D,cAAc,EACd,oBAAoB,CACpB,CAAC;IAEF,OAAO,IAAA,mCAAmB,EACzB,EAAE,GAAG,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,EACxD,KAAK,CAAC,OAAO,EACb,oBAAoB,EACpB,KAAK,CAAC,MAAM,CACZ,CAAC;AACH,CAAC;AA9BD,sEA8BC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IContainer } from \"@fluidframework/container-definitions/internal\";\nimport type { IRequest } from \"@fluidframework/core-interfaces\";\nimport { UsageError } from \"@fluidframework/driver-utils/internal\";\n\nimport type {\n\tIContainerDriverServices,\n\tIContainerHostProps,\n} from \"./createAndLoadContainerUtils.js\";\nimport { loadContainerPaused } from \"./loadPaused.js\";\nimport {\n\tasPointInTimeCapableFactory,\n\tPointInTimeDocumentServiceFactory,\n} from \"./pointInTimeServices.js\";\n\n/**\n * Properties used to materialize a container at a point in document history.\n *\n * @remarks\n * This is distinct from normal container loading. The supplied\n * {@link IContainerDriverServices.documentServiceFactory} must be able to materialize the document\n * at {@link ILoadContainerToSequenceNumberProps.loadToSequenceNumber} - i.e. it must implement the\n * point-in-time capability the loader detects. For ODSP, pass an\n * `OdspPointInTimeDocumentServiceFactory` directly.\n *\n * @internal\n */\nexport interface ILoadContainerToSequenceNumberProps\n\textends IContainerHostProps,\n\t\tIContainerDriverServices {\n\t/**\n\t * The request identifying the container instance.\n\t */\n\treadonly request: IRequest;\n\n\t/**\n\t * The sequence number at which to materialize the container.\n\t */\n\treadonly loadToSequenceNumber: number;\n\n\t/**\n\t * Cancels replay while waiting for the target sequence number.\n\t */\n\treadonly signal?: AbortSignal | undefined;\n}\n\n/**\n * Loads a read-only container at a target sequence number.\n *\n * @remarks\n * The returned container is disconnected with inbound and outbound processing paused. It is a\n * historical view and must not be used as a normal collaborative container.\n *\n * The supplied {@link IContainerDriverServices.documentServiceFactory} must support point-in-time\n * loading: it must be able to serve a snapshot at or before\n * {@link ILoadContainerToSequenceNumberProps.loadToSequenceNumber} and replay the document forward\n * through that sequence number. For ODSP, pass an `OdspPointInTimeDocumentServiceFactory` (from\n * `@fluidframework/odsp-driver`) directly - the loader materializes the point-in-time view itself,\n * so no wrapping or decoration is required.\n *\n * @internal\n */\nexport async function loadContainerToSequenceNumber(\n\tprops: ILoadContainerToSequenceNumberProps,\n): Promise<IContainer> {\n\tconst { loadToSequenceNumber, documentServiceFactory } = props;\n\tif (!Number.isInteger(loadToSequenceNumber) || loadToSequenceNumber < 0) {\n\t\tthrow new UsageError(\n\t\t\t`loadToSequenceNumber must be a non-negative integer, got ${loadToSequenceNumber}.`,\n\t\t);\n\t}\n\n\tconst capableFactory = asPointInTimeCapableFactory(documentServiceFactory);\n\tif (capableFactory === undefined) {\n\t\tthrow new UsageError(\n\t\t\t\"The provided documentServiceFactory does not support point-in-time loading. For ODSP, pass an OdspPointInTimeDocumentServiceFactory.\",\n\t\t);\n\t}\n\n\t// The loader owns materializing the target: it routes the container's createDocumentService call\n\t// to the driver's point-in-time service, so the caller never wraps their factory.\n\tconst pointInTimeFactory = new PointInTimeDocumentServiceFactory(\n\t\tcapableFactory,\n\t\tloadToSequenceNumber,\n\t);\n\n\treturn loadContainerPaused(\n\t\t{ ...props, documentServiceFactory: pointInTimeFactory },\n\t\tprops.request,\n\t\tloadToSequenceNumber,\n\t\tprops.signal,\n\t);\n}\n"]}
|
package/dist/packageVersion.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export declare const pkgName = "@fluidframework/container-loader";
|
|
8
|
-
export declare const pkgVersion = "2.
|
|
8
|
+
export declare const pkgVersion = "2.113.1";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
package/dist/packageVersion.js
CHANGED
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.pkgVersion = exports.pkgName = void 0;
|
|
10
10
|
exports.pkgName = "@fluidframework/container-loader";
|
|
11
|
-
exports.pkgVersion = "2.
|
|
11
|
+
exports.pkgVersion = "2.113.1";
|
|
12
12
|
//# sourceMappingURL=packageVersion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,kCAAkC,CAAC;AAC7C,QAAA,UAAU,GAAG,SAAS,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/container-loader\";\nexport const pkgVersion = \"2.
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,kCAAkC,CAAC;AAC7C,QAAA,UAAU,GAAG,SAAS,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/container-loader\";\nexport const pkgVersion = \"2.113.1\";\n"]}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import type { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
6
|
+
import type { IDocumentService, IDocumentServiceFactory, IResolvedUrl } from "@fluidframework/driver-definitions/internal";
|
|
7
|
+
/**
|
|
8
|
+
* A document service factory that can materialize a document at a specific sequence number.
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
11
|
+
* This is a capability a driver's {@link IDocumentServiceFactory} may additionally implement. The
|
|
12
|
+
* loader detects it (see {@link asPointInTimeCapableFactory}) so that
|
|
13
|
+
* {@link loadContainerToSequenceNumber} can drive point-in-time loading without the caller having to
|
|
14
|
+
* wrap or decorate their factory. The driver owns selecting a snapshot at or before the target and
|
|
15
|
+
* replaying the remaining ops on top of it.
|
|
16
|
+
*/
|
|
17
|
+
interface IPointInTimeCapableDocumentServiceFactory {
|
|
18
|
+
/**
|
|
19
|
+
* Creates a read-only document service materialized at `targetSequenceNumber`: storage serves a
|
|
20
|
+
* snapshot at or before the target and delta storage supplies the ops needed to advance to it.
|
|
21
|
+
*/
|
|
22
|
+
createPointInTimeDocumentService(resolvedUrl: IResolvedUrl, targetSequenceNumber: number, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Returns the factory typed as point-in-time capable if it implements
|
|
26
|
+
* {@link IPointInTimeCapableDocumentServiceFactory}, otherwise `undefined`.
|
|
27
|
+
*/
|
|
28
|
+
export declare function asPointInTimeCapableFactory(factory: IDocumentServiceFactory): (IDocumentServiceFactory & IPointInTimeCapableDocumentServiceFactory) | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Adapts a point-in-time capable factory to a plain {@link IDocumentServiceFactory} that always
|
|
31
|
+
* materializes the configured target sequence number.
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* The loader plumbs the caller's target through this adapter so the container's normal
|
|
35
|
+
* `createDocumentService(resolvedUrl)` call routes to `createPointInTimeDocumentService`. This keeps
|
|
36
|
+
* point-in-time loading a single-call experience for the caller (see
|
|
37
|
+
* {@link loadContainerToSequenceNumber}) - they never build or pass a decorated factory themselves.
|
|
38
|
+
*/
|
|
39
|
+
export declare class PointInTimeDocumentServiceFactory implements IDocumentServiceFactory {
|
|
40
|
+
private readonly inner;
|
|
41
|
+
private readonly targetSequenceNumber;
|
|
42
|
+
constructor(inner: IPointInTimeCapableDocumentServiceFactory, targetSequenceNumber: number);
|
|
43
|
+
createDocumentService(resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
|
|
44
|
+
createContainer(): Promise<IDocumentService>;
|
|
45
|
+
}
|
|
46
|
+
export {};
|
|
47
|
+
//# sourceMappingURL=pointInTimeServices.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pointInTimeServices.d.ts","sourceRoot":"","sources":["../src/pointInTimeServices.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,KAAK,EACX,gBAAgB,EAChB,uBAAuB,EACvB,YAAY,EACZ,MAAM,6CAA6C,CAAC;AAGrD;;;;;;;;;GASG;AACH,UAAU,yCAAyC;IAClD;;;OAGG;IACH,gCAAgC,CAC/B,WAAW,EAAE,YAAY,EACzB,oBAAoB,EAAE,MAAM,EAC5B,MAAM,CAAC,EAAE,oBAAoB,EAC7B,kBAAkB,CAAC,EAAE,OAAO,GAC1B,OAAO,CAAC,gBAAgB,CAAC,CAAC;CAC7B;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CAC1C,OAAO,EAAE,uBAAuB,GAC9B,CAAC,uBAAuB,GAAG,yCAAyC,CAAC,GAAG,SAAS,CAKnF;AAED;;;;;;;;;GASG;AACH,qBAAa,iCAAkC,YAAW,uBAAuB;IAE/E,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,oBAAoB;gBADpB,KAAK,EAAE,yCAAyC,EAChD,oBAAoB,EAAE,MAAM;IAGjC,qBAAqB,CACjC,WAAW,EAAE,YAAY,EACzB,MAAM,CAAC,EAAE,oBAAoB,EAC7B,kBAAkB,CAAC,EAAE,OAAO,GAC1B,OAAO,CAAC,gBAAgB,CAAC;IASf,eAAe,IAAI,OAAO,CAAC,gBAAgB,CAAC;CAKzD"}
|
|
@@ -0,0 +1,43 @@
|
|
|
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.PointInTimeDocumentServiceFactory = exports.asPointInTimeCapableFactory = void 0;
|
|
8
|
+
const internal_1 = require("@fluidframework/driver-utils/internal");
|
|
9
|
+
/**
|
|
10
|
+
* Returns the factory typed as point-in-time capable if it implements
|
|
11
|
+
* {@link IPointInTimeCapableDocumentServiceFactory}, otherwise `undefined`.
|
|
12
|
+
*/
|
|
13
|
+
function asPointInTimeCapableFactory(factory) {
|
|
14
|
+
return typeof factory
|
|
15
|
+
.createPointInTimeDocumentService === "function"
|
|
16
|
+
? factory
|
|
17
|
+
: undefined;
|
|
18
|
+
}
|
|
19
|
+
exports.asPointInTimeCapableFactory = asPointInTimeCapableFactory;
|
|
20
|
+
/**
|
|
21
|
+
* Adapts a point-in-time capable factory to a plain {@link IDocumentServiceFactory} that always
|
|
22
|
+
* materializes the configured target sequence number.
|
|
23
|
+
*
|
|
24
|
+
* @remarks
|
|
25
|
+
* The loader plumbs the caller's target through this adapter so the container's normal
|
|
26
|
+
* `createDocumentService(resolvedUrl)` call routes to `createPointInTimeDocumentService`. This keeps
|
|
27
|
+
* point-in-time loading a single-call experience for the caller (see
|
|
28
|
+
* {@link loadContainerToSequenceNumber}) - they never build or pass a decorated factory themselves.
|
|
29
|
+
*/
|
|
30
|
+
class PointInTimeDocumentServiceFactory {
|
|
31
|
+
constructor(inner, targetSequenceNumber) {
|
|
32
|
+
this.inner = inner;
|
|
33
|
+
this.targetSequenceNumber = targetSequenceNumber;
|
|
34
|
+
}
|
|
35
|
+
async createDocumentService(resolvedUrl, logger, clientIsSummarizer) {
|
|
36
|
+
return this.inner.createPointInTimeDocumentService(resolvedUrl, this.targetSequenceNumber, logger, clientIsSummarizer);
|
|
37
|
+
}
|
|
38
|
+
async createContainer() {
|
|
39
|
+
throw new internal_1.UsageError("A point-in-time document service factory cannot be used to create containers.");
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.PointInTimeDocumentServiceFactory = PointInTimeDocumentServiceFactory;
|
|
43
|
+
//# sourceMappingURL=pointInTimeServices.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pointInTimeServices.js","sourceRoot":"","sources":["../src/pointInTimeServices.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAQH,oEAAmE;AAyBnE;;;GAGG;AACH,SAAgB,2BAA2B,CAC1C,OAAgC;IAEhC,OAAO,OAAQ,OAA8D;SAC3E,gCAAgC,KAAK,UAAU;QAChD,CAAC,CAAE,OAA+E;QAClF,CAAC,CAAC,SAAS,CAAC;AACd,CAAC;AAPD,kEAOC;AAED;;;;;;;;;GASG;AACH,MAAa,iCAAiC;IAC7C,YACkB,KAAgD,EAChD,oBAA4B;QAD5B,UAAK,GAAL,KAAK,CAA2C;QAChD,yBAAoB,GAApB,oBAAoB,CAAQ;IAC3C,CAAC;IAEG,KAAK,CAAC,qBAAqB,CACjC,WAAyB,EACzB,MAA6B,EAC7B,kBAA4B;QAE5B,OAAO,IAAI,CAAC,KAAK,CAAC,gCAAgC,CACjD,WAAW,EACX,IAAI,CAAC,oBAAoB,EACzB,MAAM,EACN,kBAAkB,CAClB,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,eAAe;QAC3B,MAAM,IAAI,qBAAU,CACnB,+EAA+E,CAC/E,CAAC;IACH,CAAC;CACD;AAxBD,8EAwBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ITelemetryBaseLogger } from \"@fluidframework/core-interfaces\";\nimport type {\n\tIDocumentService,\n\tIDocumentServiceFactory,\n\tIResolvedUrl,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { UsageError } from \"@fluidframework/driver-utils/internal\";\n\n/**\n * A document service factory that can materialize a document at a specific sequence number.\n *\n * @remarks\n * This is a capability a driver's {@link IDocumentServiceFactory} may additionally implement. The\n * loader detects it (see {@link asPointInTimeCapableFactory}) so that\n * {@link loadContainerToSequenceNumber} can drive point-in-time loading without the caller having to\n * wrap or decorate their factory. The driver owns selecting a snapshot at or before the target and\n * replaying the remaining ops on top of it.\n */\ninterface IPointInTimeCapableDocumentServiceFactory {\n\t/**\n\t * Creates a read-only document service materialized at `targetSequenceNumber`: storage serves a\n\t * snapshot at or before the target and delta storage supplies the ops needed to advance to it.\n\t */\n\tcreatePointInTimeDocumentService(\n\t\tresolvedUrl: IResolvedUrl,\n\t\ttargetSequenceNumber: number,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService>;\n}\n\n/**\n * Returns the factory typed as point-in-time capable if it implements\n * {@link IPointInTimeCapableDocumentServiceFactory}, otherwise `undefined`.\n */\nexport function asPointInTimeCapableFactory(\n\tfactory: IDocumentServiceFactory,\n): (IDocumentServiceFactory & IPointInTimeCapableDocumentServiceFactory) | undefined {\n\treturn typeof (factory as Partial<IPointInTimeCapableDocumentServiceFactory>)\n\t\t.createPointInTimeDocumentService === \"function\"\n\t\t? (factory as IDocumentServiceFactory & IPointInTimeCapableDocumentServiceFactory)\n\t\t: undefined;\n}\n\n/**\n * Adapts a point-in-time capable factory to a plain {@link IDocumentServiceFactory} that always\n * materializes the configured target sequence number.\n *\n * @remarks\n * The loader plumbs the caller's target through this adapter so the container's normal\n * `createDocumentService(resolvedUrl)` call routes to `createPointInTimeDocumentService`. This keeps\n * point-in-time loading a single-call experience for the caller (see\n * {@link loadContainerToSequenceNumber}) - they never build or pass a decorated factory themselves.\n */\nexport class PointInTimeDocumentServiceFactory implements IDocumentServiceFactory {\n\tpublic constructor(\n\t\tprivate readonly inner: IPointInTimeCapableDocumentServiceFactory,\n\t\tprivate readonly targetSequenceNumber: number,\n\t) {}\n\n\tpublic async createDocumentService(\n\t\tresolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\treturn this.inner.createPointInTimeDocumentService(\n\t\t\tresolvedUrl,\n\t\t\tthis.targetSequenceNumber,\n\t\t\tlogger,\n\t\t\tclientIsSummarizer,\n\t\t);\n\t}\n\n\tpublic async createContainer(): Promise<IDocumentService> {\n\t\tthrow new UsageError(\n\t\t\t\"A point-in-time document service factory cannot be used to create containers.\",\n\t\t);\n\t}\n}\n"]}
|
package/lib/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export type { LoadSummarizerSummaryResult, OnDemandSummaryResults, SummaryStage,
|
|
|
10
10
|
export { type ICodeDetailsLoader, type IFluidModuleWithDetails, type ILoaderProps, type ILoaderServices, Loader, } from "./loader.js";
|
|
11
11
|
export { driverSupportRequirementsForLoader, loaderCoreCompatDetails, runtimeSupportRequirementsForLoader, loaderCompatDetailsForRuntime, } from "./loaderLayerCompatState.js";
|
|
12
12
|
export { loadContainerPaused } from "./loadPaused.js";
|
|
13
|
+
export { loadContainerToSequenceNumber, type ILoadContainerToSequenceNumberProps, } from "./loadContainerToSequenceNumber.js";
|
|
13
14
|
export { isLocationRedirectionError, resolveWithLocationRedirectionHandling, } from "./location-redirection-utilities/index.js";
|
|
14
15
|
export type { IProtocolHandler, ProtocolHandlerBuilder } from "./protocol.js";
|
|
15
16
|
export { tryParseCompatibleResolvedUrl, type IParsedUrl, } from "./utils.js";
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,KAAK,cAAc,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC5F,OAAO,EAAE,kCAAkC,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EACN,yBAAyB,EACzB,uBAAuB,EACvB,qBAAqB,EACrB,0BAA0B,EAC1B,mCAAmC,EACnC,qCAAqC,EACrC,KAAK,+BAA+B,EACpC,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,EAC9B,KAAK,4BAA4B,EACjC,KAAK,6BAA6B,EAClC,KAAK,2BAA2B,EAChC,KAAK,6BAA6B,EAClC,KAAK,gCAAgC,EACrC,KAAK,yCAAyC,GAC9C,MAAM,kCAAkC,CAAC;AAC1C,YAAY,EACX,2BAA2B,EAC3B,sBAAsB,EACtB,YAAY,GACZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACN,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,MAAM,GACN,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,kCAAkC,EAClC,uBAAuB,EACvB,mCAAmC,EACnC,6BAA6B,GAC7B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EACN,0BAA0B,EAC1B,sCAAsC,GACtC,MAAM,2CAA2C,CAAC;AACnD,YAAY,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAC9E,OAAO,EACN,6BAA6B,EAC7B,KAAK,UAAU,GACf,MAAM,YAAY,CAAC;AACpB,YAAY,EACX,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EACf,qBAAqB,EACrB,uBAAuB,GACvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EACN,2BAA2B,EAC3B,mBAAmB,EACnB,KAAK,oBAAoB,GACzB,MAAM,gCAAgC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,KAAK,cAAc,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC5F,OAAO,EAAE,kCAAkC,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EACN,yBAAyB,EACzB,uBAAuB,EACvB,qBAAqB,EACrB,0BAA0B,EAC1B,mCAAmC,EACnC,qCAAqC,EACrC,KAAK,+BAA+B,EACpC,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,EAC9B,KAAK,4BAA4B,EACjC,KAAK,6BAA6B,EAClC,KAAK,2BAA2B,EAChC,KAAK,6BAA6B,EAClC,KAAK,gCAAgC,EACrC,KAAK,yCAAyC,GAC9C,MAAM,kCAAkC,CAAC;AAC1C,YAAY,EACX,2BAA2B,EAC3B,sBAAsB,EACtB,YAAY,GACZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACN,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,MAAM,GACN,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,kCAAkC,EAClC,uBAAuB,EACvB,mCAAmC,EACnC,6BAA6B,GAC7B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EACN,6BAA6B,EAC7B,KAAK,mCAAmC,GACxC,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACN,0BAA0B,EAC1B,sCAAsC,GACtC,MAAM,2CAA2C,CAAC;AACnD,YAAY,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAC9E,OAAO,EACN,6BAA6B,EAC7B,KAAK,UAAU,GACf,MAAM,YAAY,CAAC;AACpB,YAAY,EACX,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EACf,qBAAqB,EACrB,uBAAuB,GACvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EACN,2BAA2B,EAC3B,mBAAmB,EACnB,KAAK,oBAAoB,GACzB,MAAM,gCAAgC,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -9,6 +9,7 @@ export { captureFullContainerState, createDetachedContainer, loadExistingContain
|
|
|
9
9
|
export { Loader, } from "./loader.js";
|
|
10
10
|
export { driverSupportRequirementsForLoader, loaderCoreCompatDetails, runtimeSupportRequirementsForLoader, loaderCompatDetailsForRuntime, } from "./loaderLayerCompatState.js";
|
|
11
11
|
export { loadContainerPaused } from "./loadPaused.js";
|
|
12
|
+
export { loadContainerToSequenceNumber, } from "./loadContainerToSequenceNumber.js";
|
|
12
13
|
export { isLocationRedirectionError, resolveWithLocationRedirectionHandling, } from "./location-redirection-utilities/index.js";
|
|
13
14
|
export { tryParseCompatibleResolvedUrl, } from "./utils.js";
|
|
14
15
|
export { PendingLocalStateStore } from "./pendingLocalStateStore.js";
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAuB,sBAAsB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC5F,OAAO,EAAE,kCAAkC,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EACN,yBAAyB,EACzB,uBAAuB,EACvB,qBAAqB,EACrB,0BAA0B,EAC1B,mCAAmC,EACnC,qCAAqC,GAWrC,MAAM,kCAAkC,CAAC;AAM1C,OAAO,EAKN,MAAM,GACN,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,kCAAkC,EAClC,uBAAuB,EACvB,mCAAmC,EACnC,6BAA6B,GAC7B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EACN,0BAA0B,EAC1B,sCAAsC,GACtC,MAAM,2CAA2C,CAAC;AAEnD,OAAO,EACN,6BAA6B,GAE7B,MAAM,YAAY,CAAC;AAQpB,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EACN,2BAA2B,EAC3B,mBAAmB,GAEnB,MAAM,gCAAgC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { ConnectionState } from \"./connectionState.js\";\nexport { type ContainerAlpha, waitContainerToCatchUp, asLegacyAlpha } from \"./container.js\";\nexport { createFrozenDocumentServiceFactory } from \"./frozenServices.js\";\nexport {\n\tcaptureFullContainerState,\n\tcreateDetachedContainer,\n\tloadExistingContainer,\n\trehydrateDetachedContainer,\n\tloadFrozenContainerFromPendingState,\n\tloadSummarizerContainerAndMakeSummary,\n\ttype ICaptureFullContainerStateProps,\n\ttype IContainerDriverServices,\n\ttype IContainerHostProps,\n\ttype IContainerLoadDriverProps,\n\ttype ICreateAndLoadContainerProps,\n\ttype ICreateDetachedContainerProps,\n\ttype ILoadExistingContainerProps,\n\ttype ILoadSummarizerContainerProps,\n\ttype IRehydrateDetachedContainerProps,\n\ttype ILoadFrozenContainerFromPendingStateProps,\n} from \"./createAndLoadContainerUtils.js\";\nexport type {\n\tLoadSummarizerSummaryResult,\n\tOnDemandSummaryResults,\n\tSummaryStage,\n} from \"./summarizerResultTypes.js\";\nexport {\n\ttype ICodeDetailsLoader,\n\ttype IFluidModuleWithDetails,\n\ttype ILoaderProps,\n\ttype ILoaderServices,\n\tLoader,\n} from \"./loader.js\";\nexport {\n\tdriverSupportRequirementsForLoader,\n\tloaderCoreCompatDetails,\n\truntimeSupportRequirementsForLoader,\n\tloaderCompatDetailsForRuntime,\n} from \"./loaderLayerCompatState.js\";\nexport { loadContainerPaused } from \"./loadPaused.js\";\nexport {\n\tisLocationRedirectionError,\n\tresolveWithLocationRedirectionHandling,\n} from \"./location-redirection-utilities/index.js\";\nexport type { IProtocolHandler, ProtocolHandlerBuilder } from \"./protocol.js\";\nexport {\n\ttryParseCompatibleResolvedUrl,\n\ttype IParsedUrl,\n} from \"./utils.js\";\nexport type {\n\tIBaseProtocolHandler,\n\tIScribeProtocolState,\n\tIQuorumSnapshot,\n\tQuorumClientsSnapshot,\n\tQuorumProposalsSnapshot,\n} from \"./protocol/index.js\";\nexport { PendingLocalStateStore } from \"./pendingLocalStateStore.js\";\nexport {\n\textractBlobAttachReferences,\n\twireFormatConstants,\n\ttype IBlobAttachReference,\n} from \"./captureReferencedContents.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAuB,sBAAsB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC5F,OAAO,EAAE,kCAAkC,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EACN,yBAAyB,EACzB,uBAAuB,EACvB,qBAAqB,EACrB,0BAA0B,EAC1B,mCAAmC,EACnC,qCAAqC,GAWrC,MAAM,kCAAkC,CAAC;AAM1C,OAAO,EAKN,MAAM,GACN,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,kCAAkC,EAClC,uBAAuB,EACvB,mCAAmC,EACnC,6BAA6B,GAC7B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EACN,6BAA6B,GAE7B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACN,0BAA0B,EAC1B,sCAAsC,GACtC,MAAM,2CAA2C,CAAC;AAEnD,OAAO,EACN,6BAA6B,GAE7B,MAAM,YAAY,CAAC;AAQpB,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EACN,2BAA2B,EAC3B,mBAAmB,GAEnB,MAAM,gCAAgC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { ConnectionState } from \"./connectionState.js\";\nexport { type ContainerAlpha, waitContainerToCatchUp, asLegacyAlpha } from \"./container.js\";\nexport { createFrozenDocumentServiceFactory } from \"./frozenServices.js\";\nexport {\n\tcaptureFullContainerState,\n\tcreateDetachedContainer,\n\tloadExistingContainer,\n\trehydrateDetachedContainer,\n\tloadFrozenContainerFromPendingState,\n\tloadSummarizerContainerAndMakeSummary,\n\ttype ICaptureFullContainerStateProps,\n\ttype IContainerDriverServices,\n\ttype IContainerHostProps,\n\ttype IContainerLoadDriverProps,\n\ttype ICreateAndLoadContainerProps,\n\ttype ICreateDetachedContainerProps,\n\ttype ILoadExistingContainerProps,\n\ttype ILoadSummarizerContainerProps,\n\ttype IRehydrateDetachedContainerProps,\n\ttype ILoadFrozenContainerFromPendingStateProps,\n} from \"./createAndLoadContainerUtils.js\";\nexport type {\n\tLoadSummarizerSummaryResult,\n\tOnDemandSummaryResults,\n\tSummaryStage,\n} from \"./summarizerResultTypes.js\";\nexport {\n\ttype ICodeDetailsLoader,\n\ttype IFluidModuleWithDetails,\n\ttype ILoaderProps,\n\ttype ILoaderServices,\n\tLoader,\n} from \"./loader.js\";\nexport {\n\tdriverSupportRequirementsForLoader,\n\tloaderCoreCompatDetails,\n\truntimeSupportRequirementsForLoader,\n\tloaderCompatDetailsForRuntime,\n} from \"./loaderLayerCompatState.js\";\nexport { loadContainerPaused } from \"./loadPaused.js\";\nexport {\n\tloadContainerToSequenceNumber,\n\ttype ILoadContainerToSequenceNumberProps,\n} from \"./loadContainerToSequenceNumber.js\";\nexport {\n\tisLocationRedirectionError,\n\tresolveWithLocationRedirectionHandling,\n} from \"./location-redirection-utilities/index.js\";\nexport type { IProtocolHandler, ProtocolHandlerBuilder } from \"./protocol.js\";\nexport {\n\ttryParseCompatibleResolvedUrl,\n\ttype IParsedUrl,\n} from \"./utils.js\";\nexport type {\n\tIBaseProtocolHandler,\n\tIScribeProtocolState,\n\tIQuorumSnapshot,\n\tQuorumClientsSnapshot,\n\tQuorumProposalsSnapshot,\n} from \"./protocol/index.js\";\nexport { PendingLocalStateStore } from \"./pendingLocalStateStore.js\";\nexport {\n\textractBlobAttachReferences,\n\twireFormatConstants,\n\ttype IBlobAttachReference,\n} from \"./captureReferencedContents.js\";\n"]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import type { IContainer } from "@fluidframework/container-definitions/internal";
|
|
6
|
+
import type { IRequest } from "@fluidframework/core-interfaces";
|
|
7
|
+
import type { IContainerDriverServices, IContainerHostProps } from "./createAndLoadContainerUtils.js";
|
|
8
|
+
/**
|
|
9
|
+
* Properties used to materialize a container at a point in document history.
|
|
10
|
+
*
|
|
11
|
+
* @remarks
|
|
12
|
+
* This is distinct from normal container loading. The supplied
|
|
13
|
+
* {@link IContainerDriverServices.documentServiceFactory} must be able to materialize the document
|
|
14
|
+
* at {@link ILoadContainerToSequenceNumberProps.loadToSequenceNumber} - i.e. it must implement the
|
|
15
|
+
* point-in-time capability the loader detects. For ODSP, pass an
|
|
16
|
+
* `OdspPointInTimeDocumentServiceFactory` directly.
|
|
17
|
+
*
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
export interface ILoadContainerToSequenceNumberProps extends IContainerHostProps, IContainerDriverServices {
|
|
21
|
+
/**
|
|
22
|
+
* The request identifying the container instance.
|
|
23
|
+
*/
|
|
24
|
+
readonly request: IRequest;
|
|
25
|
+
/**
|
|
26
|
+
* The sequence number at which to materialize the container.
|
|
27
|
+
*/
|
|
28
|
+
readonly loadToSequenceNumber: number;
|
|
29
|
+
/**
|
|
30
|
+
* Cancels replay while waiting for the target sequence number.
|
|
31
|
+
*/
|
|
32
|
+
readonly signal?: AbortSignal | undefined;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Loads a read-only container at a target sequence number.
|
|
36
|
+
*
|
|
37
|
+
* @remarks
|
|
38
|
+
* The returned container is disconnected with inbound and outbound processing paused. It is a
|
|
39
|
+
* historical view and must not be used as a normal collaborative container.
|
|
40
|
+
*
|
|
41
|
+
* The supplied {@link IContainerDriverServices.documentServiceFactory} must support point-in-time
|
|
42
|
+
* loading: it must be able to serve a snapshot at or before
|
|
43
|
+
* {@link ILoadContainerToSequenceNumberProps.loadToSequenceNumber} and replay the document forward
|
|
44
|
+
* through that sequence number. For ODSP, pass an `OdspPointInTimeDocumentServiceFactory` (from
|
|
45
|
+
* `@fluidframework/odsp-driver`) directly - the loader materializes the point-in-time view itself,
|
|
46
|
+
* so no wrapping or decoration is required.
|
|
47
|
+
*
|
|
48
|
+
* @internal
|
|
49
|
+
*/
|
|
50
|
+
export declare function loadContainerToSequenceNumber(props: ILoadContainerToSequenceNumberProps): Promise<IContainer>;
|
|
51
|
+
//# sourceMappingURL=loadContainerToSequenceNumber.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loadContainerToSequenceNumber.d.ts","sourceRoot":"","sources":["../src/loadContainerToSequenceNumber.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gDAAgD,CAAC;AACjF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAGhE,OAAO,KAAK,EACX,wBAAwB,EACxB,mBAAmB,EACnB,MAAM,kCAAkC,CAAC;AAO1C;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,mCAChB,SAAQ,mBAAmB,EAC1B,wBAAwB;IACzB;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;IAEtC;;OAEG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;CAC1C;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,6BAA6B,CAClD,KAAK,EAAE,mCAAmC,GACxC,OAAO,CAAC,UAAU,CAAC,CA4BrB"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import { UsageError } from "@fluidframework/driver-utils/internal";
|
|
6
|
+
import { loadContainerPaused } from "./loadPaused.js";
|
|
7
|
+
import { asPointInTimeCapableFactory, PointInTimeDocumentServiceFactory, } from "./pointInTimeServices.js";
|
|
8
|
+
/**
|
|
9
|
+
* Loads a read-only container at a target sequence number.
|
|
10
|
+
*
|
|
11
|
+
* @remarks
|
|
12
|
+
* The returned container is disconnected with inbound and outbound processing paused. It is a
|
|
13
|
+
* historical view and must not be used as a normal collaborative container.
|
|
14
|
+
*
|
|
15
|
+
* The supplied {@link IContainerDriverServices.documentServiceFactory} must support point-in-time
|
|
16
|
+
* loading: it must be able to serve a snapshot at or before
|
|
17
|
+
* {@link ILoadContainerToSequenceNumberProps.loadToSequenceNumber} and replay the document forward
|
|
18
|
+
* through that sequence number. For ODSP, pass an `OdspPointInTimeDocumentServiceFactory` (from
|
|
19
|
+
* `@fluidframework/odsp-driver`) directly - the loader materializes the point-in-time view itself,
|
|
20
|
+
* so no wrapping or decoration is required.
|
|
21
|
+
*
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
24
|
+
export async function loadContainerToSequenceNumber(props) {
|
|
25
|
+
const { loadToSequenceNumber, documentServiceFactory } = props;
|
|
26
|
+
if (!Number.isInteger(loadToSequenceNumber) || loadToSequenceNumber < 0) {
|
|
27
|
+
throw new UsageError(`loadToSequenceNumber must be a non-negative integer, got ${loadToSequenceNumber}.`);
|
|
28
|
+
}
|
|
29
|
+
const capableFactory = asPointInTimeCapableFactory(documentServiceFactory);
|
|
30
|
+
if (capableFactory === undefined) {
|
|
31
|
+
throw new UsageError("The provided documentServiceFactory does not support point-in-time loading. For ODSP, pass an OdspPointInTimeDocumentServiceFactory.");
|
|
32
|
+
}
|
|
33
|
+
// The loader owns materializing the target: it routes the container's createDocumentService call
|
|
34
|
+
// to the driver's point-in-time service, so the caller never wraps their factory.
|
|
35
|
+
const pointInTimeFactory = new PointInTimeDocumentServiceFactory(capableFactory, loadToSequenceNumber);
|
|
36
|
+
return loadContainerPaused({ ...props, documentServiceFactory: pointInTimeFactory }, props.request, loadToSequenceNumber, props.signal);
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=loadContainerToSequenceNumber.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loadContainerToSequenceNumber.js","sourceRoot":"","sources":["../src/loadContainerToSequenceNumber.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AAMnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EACN,2BAA2B,EAC3B,iCAAiC,GACjC,MAAM,0BAA0B,CAAC;AAiClC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,KAAK,UAAU,6BAA6B,CAClD,KAA0C;IAE1C,MAAM,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,GAAG,KAAK,CAAC;IAC/D,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC,IAAI,oBAAoB,GAAG,CAAC,EAAE,CAAC;QACzE,MAAM,IAAI,UAAU,CACnB,4DAA4D,oBAAoB,GAAG,CACnF,CAAC;IACH,CAAC;IAED,MAAM,cAAc,GAAG,2BAA2B,CAAC,sBAAsB,CAAC,CAAC;IAC3E,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;QAClC,MAAM,IAAI,UAAU,CACnB,sIAAsI,CACtI,CAAC;IACH,CAAC;IAED,iGAAiG;IACjG,kFAAkF;IAClF,MAAM,kBAAkB,GAAG,IAAI,iCAAiC,CAC/D,cAAc,EACd,oBAAoB,CACpB,CAAC;IAEF,OAAO,mBAAmB,CACzB,EAAE,GAAG,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,EACxD,KAAK,CAAC,OAAO,EACb,oBAAoB,EACpB,KAAK,CAAC,MAAM,CACZ,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IContainer } from \"@fluidframework/container-definitions/internal\";\nimport type { IRequest } from \"@fluidframework/core-interfaces\";\nimport { UsageError } from \"@fluidframework/driver-utils/internal\";\n\nimport type {\n\tIContainerDriverServices,\n\tIContainerHostProps,\n} from \"./createAndLoadContainerUtils.js\";\nimport { loadContainerPaused } from \"./loadPaused.js\";\nimport {\n\tasPointInTimeCapableFactory,\n\tPointInTimeDocumentServiceFactory,\n} from \"./pointInTimeServices.js\";\n\n/**\n * Properties used to materialize a container at a point in document history.\n *\n * @remarks\n * This is distinct from normal container loading. The supplied\n * {@link IContainerDriverServices.documentServiceFactory} must be able to materialize the document\n * at {@link ILoadContainerToSequenceNumberProps.loadToSequenceNumber} - i.e. it must implement the\n * point-in-time capability the loader detects. For ODSP, pass an\n * `OdspPointInTimeDocumentServiceFactory` directly.\n *\n * @internal\n */\nexport interface ILoadContainerToSequenceNumberProps\n\textends IContainerHostProps,\n\t\tIContainerDriverServices {\n\t/**\n\t * The request identifying the container instance.\n\t */\n\treadonly request: IRequest;\n\n\t/**\n\t * The sequence number at which to materialize the container.\n\t */\n\treadonly loadToSequenceNumber: number;\n\n\t/**\n\t * Cancels replay while waiting for the target sequence number.\n\t */\n\treadonly signal?: AbortSignal | undefined;\n}\n\n/**\n * Loads a read-only container at a target sequence number.\n *\n * @remarks\n * The returned container is disconnected with inbound and outbound processing paused. It is a\n * historical view and must not be used as a normal collaborative container.\n *\n * The supplied {@link IContainerDriverServices.documentServiceFactory} must support point-in-time\n * loading: it must be able to serve a snapshot at or before\n * {@link ILoadContainerToSequenceNumberProps.loadToSequenceNumber} and replay the document forward\n * through that sequence number. For ODSP, pass an `OdspPointInTimeDocumentServiceFactory` (from\n * `@fluidframework/odsp-driver`) directly - the loader materializes the point-in-time view itself,\n * so no wrapping or decoration is required.\n *\n * @internal\n */\nexport async function loadContainerToSequenceNumber(\n\tprops: ILoadContainerToSequenceNumberProps,\n): Promise<IContainer> {\n\tconst { loadToSequenceNumber, documentServiceFactory } = props;\n\tif (!Number.isInteger(loadToSequenceNumber) || loadToSequenceNumber < 0) {\n\t\tthrow new UsageError(\n\t\t\t`loadToSequenceNumber must be a non-negative integer, got ${loadToSequenceNumber}.`,\n\t\t);\n\t}\n\n\tconst capableFactory = asPointInTimeCapableFactory(documentServiceFactory);\n\tif (capableFactory === undefined) {\n\t\tthrow new UsageError(\n\t\t\t\"The provided documentServiceFactory does not support point-in-time loading. For ODSP, pass an OdspPointInTimeDocumentServiceFactory.\",\n\t\t);\n\t}\n\n\t// The loader owns materializing the target: it routes the container's createDocumentService call\n\t// to the driver's point-in-time service, so the caller never wraps their factory.\n\tconst pointInTimeFactory = new PointInTimeDocumentServiceFactory(\n\t\tcapableFactory,\n\t\tloadToSequenceNumber,\n\t);\n\n\treturn loadContainerPaused(\n\t\t{ ...props, documentServiceFactory: pointInTimeFactory },\n\t\tprops.request,\n\t\tloadToSequenceNumber,\n\t\tprops.signal,\n\t);\n}\n"]}
|
package/lib/packageVersion.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export declare const pkgName = "@fluidframework/container-loader";
|
|
8
|
-
export declare const pkgVersion = "2.
|
|
8
|
+
export declare const pkgVersion = "2.113.1";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
package/lib/packageVersion.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,kCAAkC,CAAC;AAC1D,MAAM,CAAC,MAAM,UAAU,GAAG,SAAS,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/container-loader\";\nexport const pkgVersion = \"2.
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,kCAAkC,CAAC;AAC1D,MAAM,CAAC,MAAM,UAAU,GAAG,SAAS,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/container-loader\";\nexport const pkgVersion = \"2.113.1\";\n"]}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import type { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
6
|
+
import type { IDocumentService, IDocumentServiceFactory, IResolvedUrl } from "@fluidframework/driver-definitions/internal";
|
|
7
|
+
/**
|
|
8
|
+
* A document service factory that can materialize a document at a specific sequence number.
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
11
|
+
* This is a capability a driver's {@link IDocumentServiceFactory} may additionally implement. The
|
|
12
|
+
* loader detects it (see {@link asPointInTimeCapableFactory}) so that
|
|
13
|
+
* {@link loadContainerToSequenceNumber} can drive point-in-time loading without the caller having to
|
|
14
|
+
* wrap or decorate their factory. The driver owns selecting a snapshot at or before the target and
|
|
15
|
+
* replaying the remaining ops on top of it.
|
|
16
|
+
*/
|
|
17
|
+
interface IPointInTimeCapableDocumentServiceFactory {
|
|
18
|
+
/**
|
|
19
|
+
* Creates a read-only document service materialized at `targetSequenceNumber`: storage serves a
|
|
20
|
+
* snapshot at or before the target and delta storage supplies the ops needed to advance to it.
|
|
21
|
+
*/
|
|
22
|
+
createPointInTimeDocumentService(resolvedUrl: IResolvedUrl, targetSequenceNumber: number, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Returns the factory typed as point-in-time capable if it implements
|
|
26
|
+
* {@link IPointInTimeCapableDocumentServiceFactory}, otherwise `undefined`.
|
|
27
|
+
*/
|
|
28
|
+
export declare function asPointInTimeCapableFactory(factory: IDocumentServiceFactory): (IDocumentServiceFactory & IPointInTimeCapableDocumentServiceFactory) | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Adapts a point-in-time capable factory to a plain {@link IDocumentServiceFactory} that always
|
|
31
|
+
* materializes the configured target sequence number.
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* The loader plumbs the caller's target through this adapter so the container's normal
|
|
35
|
+
* `createDocumentService(resolvedUrl)` call routes to `createPointInTimeDocumentService`. This keeps
|
|
36
|
+
* point-in-time loading a single-call experience for the caller (see
|
|
37
|
+
* {@link loadContainerToSequenceNumber}) - they never build or pass a decorated factory themselves.
|
|
38
|
+
*/
|
|
39
|
+
export declare class PointInTimeDocumentServiceFactory implements IDocumentServiceFactory {
|
|
40
|
+
private readonly inner;
|
|
41
|
+
private readonly targetSequenceNumber;
|
|
42
|
+
constructor(inner: IPointInTimeCapableDocumentServiceFactory, targetSequenceNumber: number);
|
|
43
|
+
createDocumentService(resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
|
|
44
|
+
createContainer(): Promise<IDocumentService>;
|
|
45
|
+
}
|
|
46
|
+
export {};
|
|
47
|
+
//# sourceMappingURL=pointInTimeServices.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pointInTimeServices.d.ts","sourceRoot":"","sources":["../src/pointInTimeServices.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,KAAK,EACX,gBAAgB,EAChB,uBAAuB,EACvB,YAAY,EACZ,MAAM,6CAA6C,CAAC;AAGrD;;;;;;;;;GASG;AACH,UAAU,yCAAyC;IAClD;;;OAGG;IACH,gCAAgC,CAC/B,WAAW,EAAE,YAAY,EACzB,oBAAoB,EAAE,MAAM,EAC5B,MAAM,CAAC,EAAE,oBAAoB,EAC7B,kBAAkB,CAAC,EAAE,OAAO,GAC1B,OAAO,CAAC,gBAAgB,CAAC,CAAC;CAC7B;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CAC1C,OAAO,EAAE,uBAAuB,GAC9B,CAAC,uBAAuB,GAAG,yCAAyC,CAAC,GAAG,SAAS,CAKnF;AAED;;;;;;;;;GASG;AACH,qBAAa,iCAAkC,YAAW,uBAAuB;IAE/E,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,oBAAoB;gBADpB,KAAK,EAAE,yCAAyC,EAChD,oBAAoB,EAAE,MAAM;IAGjC,qBAAqB,CACjC,WAAW,EAAE,YAAY,EACzB,MAAM,CAAC,EAAE,oBAAoB,EAC7B,kBAAkB,CAAC,EAAE,OAAO,GAC1B,OAAO,CAAC,gBAAgB,CAAC;IASf,eAAe,IAAI,OAAO,CAAC,gBAAgB,CAAC;CAKzD"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import { UsageError } from "@fluidframework/driver-utils/internal";
|
|
6
|
+
/**
|
|
7
|
+
* Returns the factory typed as point-in-time capable if it implements
|
|
8
|
+
* {@link IPointInTimeCapableDocumentServiceFactory}, otherwise `undefined`.
|
|
9
|
+
*/
|
|
10
|
+
export function asPointInTimeCapableFactory(factory) {
|
|
11
|
+
return typeof factory
|
|
12
|
+
.createPointInTimeDocumentService === "function"
|
|
13
|
+
? factory
|
|
14
|
+
: undefined;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Adapts a point-in-time capable factory to a plain {@link IDocumentServiceFactory} that always
|
|
18
|
+
* materializes the configured target sequence number.
|
|
19
|
+
*
|
|
20
|
+
* @remarks
|
|
21
|
+
* The loader plumbs the caller's target through this adapter so the container's normal
|
|
22
|
+
* `createDocumentService(resolvedUrl)` call routes to `createPointInTimeDocumentService`. This keeps
|
|
23
|
+
* point-in-time loading a single-call experience for the caller (see
|
|
24
|
+
* {@link loadContainerToSequenceNumber}) - they never build or pass a decorated factory themselves.
|
|
25
|
+
*/
|
|
26
|
+
export class PointInTimeDocumentServiceFactory {
|
|
27
|
+
constructor(inner, targetSequenceNumber) {
|
|
28
|
+
this.inner = inner;
|
|
29
|
+
this.targetSequenceNumber = targetSequenceNumber;
|
|
30
|
+
}
|
|
31
|
+
async createDocumentService(resolvedUrl, logger, clientIsSummarizer) {
|
|
32
|
+
return this.inner.createPointInTimeDocumentService(resolvedUrl, this.targetSequenceNumber, logger, clientIsSummarizer);
|
|
33
|
+
}
|
|
34
|
+
async createContainer() {
|
|
35
|
+
throw new UsageError("A point-in-time document service factory cannot be used to create containers.");
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=pointInTimeServices.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pointInTimeServices.js","sourceRoot":"","sources":["../src/pointInTimeServices.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AAyBnE;;;GAGG;AACH,MAAM,UAAU,2BAA2B,CAC1C,OAAgC;IAEhC,OAAO,OAAQ,OAA8D;SAC3E,gCAAgC,KAAK,UAAU;QAChD,CAAC,CAAE,OAA+E;QAClF,CAAC,CAAC,SAAS,CAAC;AACd,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,OAAO,iCAAiC;IAC7C,YACkB,KAAgD,EAChD,oBAA4B;QAD5B,UAAK,GAAL,KAAK,CAA2C;QAChD,yBAAoB,GAApB,oBAAoB,CAAQ;IAC3C,CAAC;IAEG,KAAK,CAAC,qBAAqB,CACjC,WAAyB,EACzB,MAA6B,EAC7B,kBAA4B;QAE5B,OAAO,IAAI,CAAC,KAAK,CAAC,gCAAgC,CACjD,WAAW,EACX,IAAI,CAAC,oBAAoB,EACzB,MAAM,EACN,kBAAkB,CAClB,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,eAAe;QAC3B,MAAM,IAAI,UAAU,CACnB,+EAA+E,CAC/E,CAAC;IACH,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ITelemetryBaseLogger } from \"@fluidframework/core-interfaces\";\nimport type {\n\tIDocumentService,\n\tIDocumentServiceFactory,\n\tIResolvedUrl,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { UsageError } from \"@fluidframework/driver-utils/internal\";\n\n/**\n * A document service factory that can materialize a document at a specific sequence number.\n *\n * @remarks\n * This is a capability a driver's {@link IDocumentServiceFactory} may additionally implement. The\n * loader detects it (see {@link asPointInTimeCapableFactory}) so that\n * {@link loadContainerToSequenceNumber} can drive point-in-time loading without the caller having to\n * wrap or decorate their factory. The driver owns selecting a snapshot at or before the target and\n * replaying the remaining ops on top of it.\n */\ninterface IPointInTimeCapableDocumentServiceFactory {\n\t/**\n\t * Creates a read-only document service materialized at `targetSequenceNumber`: storage serves a\n\t * snapshot at or before the target and delta storage supplies the ops needed to advance to it.\n\t */\n\tcreatePointInTimeDocumentService(\n\t\tresolvedUrl: IResolvedUrl,\n\t\ttargetSequenceNumber: number,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService>;\n}\n\n/**\n * Returns the factory typed as point-in-time capable if it implements\n * {@link IPointInTimeCapableDocumentServiceFactory}, otherwise `undefined`.\n */\nexport function asPointInTimeCapableFactory(\n\tfactory: IDocumentServiceFactory,\n): (IDocumentServiceFactory & IPointInTimeCapableDocumentServiceFactory) | undefined {\n\treturn typeof (factory as Partial<IPointInTimeCapableDocumentServiceFactory>)\n\t\t.createPointInTimeDocumentService === \"function\"\n\t\t? (factory as IDocumentServiceFactory & IPointInTimeCapableDocumentServiceFactory)\n\t\t: undefined;\n}\n\n/**\n * Adapts a point-in-time capable factory to a plain {@link IDocumentServiceFactory} that always\n * materializes the configured target sequence number.\n *\n * @remarks\n * The loader plumbs the caller's target through this adapter so the container's normal\n * `createDocumentService(resolvedUrl)` call routes to `createPointInTimeDocumentService`. This keeps\n * point-in-time loading a single-call experience for the caller (see\n * {@link loadContainerToSequenceNumber}) - they never build or pass a decorated factory themselves.\n */\nexport class PointInTimeDocumentServiceFactory implements IDocumentServiceFactory {\n\tpublic constructor(\n\t\tprivate readonly inner: IPointInTimeCapableDocumentServiceFactory,\n\t\tprivate readonly targetSequenceNumber: number,\n\t) {}\n\n\tpublic async createDocumentService(\n\t\tresolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\treturn this.inner.createPointInTimeDocumentService(\n\t\t\tresolvedUrl,\n\t\t\tthis.targetSequenceNumber,\n\t\t\tlogger,\n\t\t\tclientIsSummarizer,\n\t\t);\n\t}\n\n\tpublic async createContainer(): Promise<IDocumentService> {\n\t\tthrow new UsageError(\n\t\t\t\"A point-in-time document service factory cannot be used to create containers.\",\n\t\t);\n\t}\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/container-loader",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.113.1",
|
|
4
4
|
"description": "Fluid container loader",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -129,13 +129,13 @@
|
|
|
129
129
|
"temp-directory": "nyc/.nyc_output"
|
|
130
130
|
},
|
|
131
131
|
"dependencies": {
|
|
132
|
-
"@fluid-internal/client-utils": "~2.
|
|
133
|
-
"@fluidframework/container-definitions": "~2.
|
|
134
|
-
"@fluidframework/core-interfaces": "~2.
|
|
135
|
-
"@fluidframework/core-utils": "~2.
|
|
136
|
-
"@fluidframework/driver-definitions": "~2.
|
|
137
|
-
"@fluidframework/driver-utils": "~2.
|
|
138
|
-
"@fluidframework/telemetry-utils": "~2.
|
|
132
|
+
"@fluid-internal/client-utils": "~2.113.1",
|
|
133
|
+
"@fluidframework/container-definitions": "~2.113.1",
|
|
134
|
+
"@fluidframework/core-interfaces": "~2.113.1",
|
|
135
|
+
"@fluidframework/core-utils": "~2.113.1",
|
|
136
|
+
"@fluidframework/driver-definitions": "~2.113.1",
|
|
137
|
+
"@fluidframework/driver-utils": "~2.113.1",
|
|
138
|
+
"@fluidframework/telemetry-utils": "~2.113.1",
|
|
139
139
|
"debug": "^4.3.4",
|
|
140
140
|
"double-ended-queue": "^2.1.0-0",
|
|
141
141
|
"events_pkg": "npm:events@^3.1.0",
|
|
@@ -144,9 +144,9 @@
|
|
|
144
144
|
"devDependencies": {
|
|
145
145
|
"@arethetypeswrong/cli": "^0.18.2",
|
|
146
146
|
"@biomejs/biome": "~2.4.5",
|
|
147
|
-
"@fluid-internal/client-utils": "~2.
|
|
148
|
-
"@fluid-internal/mocha-test-setup": "~2.
|
|
149
|
-
"@fluid-private/test-loader-utils": "~2.
|
|
147
|
+
"@fluid-internal/client-utils": "~2.113.1",
|
|
148
|
+
"@fluid-internal/mocha-test-setup": "~2.113.1",
|
|
149
|
+
"@fluid-private/test-loader-utils": "~2.113.1",
|
|
150
150
|
"@fluid-tools/build-cli": "^0.65.0",
|
|
151
151
|
"@fluidframework/build-common": "^2.0.3",
|
|
152
152
|
"@fluidframework/build-tools": "^0.65.0",
|
package/src/index.ts
CHANGED
|
@@ -43,6 +43,10 @@ export {
|
|
|
43
43
|
loaderCompatDetailsForRuntime,
|
|
44
44
|
} from "./loaderLayerCompatState.js";
|
|
45
45
|
export { loadContainerPaused } from "./loadPaused.js";
|
|
46
|
+
export {
|
|
47
|
+
loadContainerToSequenceNumber,
|
|
48
|
+
type ILoadContainerToSequenceNumberProps,
|
|
49
|
+
} from "./loadContainerToSequenceNumber.js";
|
|
46
50
|
export {
|
|
47
51
|
isLocationRedirectionError,
|
|
48
52
|
resolveWithLocationRedirectionHandling,
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { IContainer } from "@fluidframework/container-definitions/internal";
|
|
7
|
+
import type { IRequest } from "@fluidframework/core-interfaces";
|
|
8
|
+
import { UsageError } from "@fluidframework/driver-utils/internal";
|
|
9
|
+
|
|
10
|
+
import type {
|
|
11
|
+
IContainerDriverServices,
|
|
12
|
+
IContainerHostProps,
|
|
13
|
+
} from "./createAndLoadContainerUtils.js";
|
|
14
|
+
import { loadContainerPaused } from "./loadPaused.js";
|
|
15
|
+
import {
|
|
16
|
+
asPointInTimeCapableFactory,
|
|
17
|
+
PointInTimeDocumentServiceFactory,
|
|
18
|
+
} from "./pointInTimeServices.js";
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Properties used to materialize a container at a point in document history.
|
|
22
|
+
*
|
|
23
|
+
* @remarks
|
|
24
|
+
* This is distinct from normal container loading. The supplied
|
|
25
|
+
* {@link IContainerDriverServices.documentServiceFactory} must be able to materialize the document
|
|
26
|
+
* at {@link ILoadContainerToSequenceNumberProps.loadToSequenceNumber} - i.e. it must implement the
|
|
27
|
+
* point-in-time capability the loader detects. For ODSP, pass an
|
|
28
|
+
* `OdspPointInTimeDocumentServiceFactory` directly.
|
|
29
|
+
*
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
32
|
+
export interface ILoadContainerToSequenceNumberProps
|
|
33
|
+
extends IContainerHostProps,
|
|
34
|
+
IContainerDriverServices {
|
|
35
|
+
/**
|
|
36
|
+
* The request identifying the container instance.
|
|
37
|
+
*/
|
|
38
|
+
readonly request: IRequest;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The sequence number at which to materialize the container.
|
|
42
|
+
*/
|
|
43
|
+
readonly loadToSequenceNumber: number;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Cancels replay while waiting for the target sequence number.
|
|
47
|
+
*/
|
|
48
|
+
readonly signal?: AbortSignal | undefined;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Loads a read-only container at a target sequence number.
|
|
53
|
+
*
|
|
54
|
+
* @remarks
|
|
55
|
+
* The returned container is disconnected with inbound and outbound processing paused. It is a
|
|
56
|
+
* historical view and must not be used as a normal collaborative container.
|
|
57
|
+
*
|
|
58
|
+
* The supplied {@link IContainerDriverServices.documentServiceFactory} must support point-in-time
|
|
59
|
+
* loading: it must be able to serve a snapshot at or before
|
|
60
|
+
* {@link ILoadContainerToSequenceNumberProps.loadToSequenceNumber} and replay the document forward
|
|
61
|
+
* through that sequence number. For ODSP, pass an `OdspPointInTimeDocumentServiceFactory` (from
|
|
62
|
+
* `@fluidframework/odsp-driver`) directly - the loader materializes the point-in-time view itself,
|
|
63
|
+
* so no wrapping or decoration is required.
|
|
64
|
+
*
|
|
65
|
+
* @internal
|
|
66
|
+
*/
|
|
67
|
+
export async function loadContainerToSequenceNumber(
|
|
68
|
+
props: ILoadContainerToSequenceNumberProps,
|
|
69
|
+
): Promise<IContainer> {
|
|
70
|
+
const { loadToSequenceNumber, documentServiceFactory } = props;
|
|
71
|
+
if (!Number.isInteger(loadToSequenceNumber) || loadToSequenceNumber < 0) {
|
|
72
|
+
throw new UsageError(
|
|
73
|
+
`loadToSequenceNumber must be a non-negative integer, got ${loadToSequenceNumber}.`,
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const capableFactory = asPointInTimeCapableFactory(documentServiceFactory);
|
|
78
|
+
if (capableFactory === undefined) {
|
|
79
|
+
throw new UsageError(
|
|
80
|
+
"The provided documentServiceFactory does not support point-in-time loading. For ODSP, pass an OdspPointInTimeDocumentServiceFactory.",
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// The loader owns materializing the target: it routes the container's createDocumentService call
|
|
85
|
+
// to the driver's point-in-time service, so the caller never wraps their factory.
|
|
86
|
+
const pointInTimeFactory = new PointInTimeDocumentServiceFactory(
|
|
87
|
+
capableFactory,
|
|
88
|
+
loadToSequenceNumber,
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
return loadContainerPaused(
|
|
92
|
+
{ ...props, documentServiceFactory: pointInTimeFactory },
|
|
93
|
+
props.request,
|
|
94
|
+
loadToSequenceNumber,
|
|
95
|
+
props.signal,
|
|
96
|
+
);
|
|
97
|
+
}
|
package/src/packageVersion.ts
CHANGED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
7
|
+
import type {
|
|
8
|
+
IDocumentService,
|
|
9
|
+
IDocumentServiceFactory,
|
|
10
|
+
IResolvedUrl,
|
|
11
|
+
} from "@fluidframework/driver-definitions/internal";
|
|
12
|
+
import { UsageError } from "@fluidframework/driver-utils/internal";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* A document service factory that can materialize a document at a specific sequence number.
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* This is a capability a driver's {@link IDocumentServiceFactory} may additionally implement. The
|
|
19
|
+
* loader detects it (see {@link asPointInTimeCapableFactory}) so that
|
|
20
|
+
* {@link loadContainerToSequenceNumber} can drive point-in-time loading without the caller having to
|
|
21
|
+
* wrap or decorate their factory. The driver owns selecting a snapshot at or before the target and
|
|
22
|
+
* replaying the remaining ops on top of it.
|
|
23
|
+
*/
|
|
24
|
+
interface IPointInTimeCapableDocumentServiceFactory {
|
|
25
|
+
/**
|
|
26
|
+
* Creates a read-only document service materialized at `targetSequenceNumber`: storage serves a
|
|
27
|
+
* snapshot at or before the target and delta storage supplies the ops needed to advance to it.
|
|
28
|
+
*/
|
|
29
|
+
createPointInTimeDocumentService(
|
|
30
|
+
resolvedUrl: IResolvedUrl,
|
|
31
|
+
targetSequenceNumber: number,
|
|
32
|
+
logger?: ITelemetryBaseLogger,
|
|
33
|
+
clientIsSummarizer?: boolean,
|
|
34
|
+
): Promise<IDocumentService>;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Returns the factory typed as point-in-time capable if it implements
|
|
39
|
+
* {@link IPointInTimeCapableDocumentServiceFactory}, otherwise `undefined`.
|
|
40
|
+
*/
|
|
41
|
+
export function asPointInTimeCapableFactory(
|
|
42
|
+
factory: IDocumentServiceFactory,
|
|
43
|
+
): (IDocumentServiceFactory & IPointInTimeCapableDocumentServiceFactory) | undefined {
|
|
44
|
+
return typeof (factory as Partial<IPointInTimeCapableDocumentServiceFactory>)
|
|
45
|
+
.createPointInTimeDocumentService === "function"
|
|
46
|
+
? (factory as IDocumentServiceFactory & IPointInTimeCapableDocumentServiceFactory)
|
|
47
|
+
: undefined;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Adapts a point-in-time capable factory to a plain {@link IDocumentServiceFactory} that always
|
|
52
|
+
* materializes the configured target sequence number.
|
|
53
|
+
*
|
|
54
|
+
* @remarks
|
|
55
|
+
* The loader plumbs the caller's target through this adapter so the container's normal
|
|
56
|
+
* `createDocumentService(resolvedUrl)` call routes to `createPointInTimeDocumentService`. This keeps
|
|
57
|
+
* point-in-time loading a single-call experience for the caller (see
|
|
58
|
+
* {@link loadContainerToSequenceNumber}) - they never build or pass a decorated factory themselves.
|
|
59
|
+
*/
|
|
60
|
+
export class PointInTimeDocumentServiceFactory implements IDocumentServiceFactory {
|
|
61
|
+
public constructor(
|
|
62
|
+
private readonly inner: IPointInTimeCapableDocumentServiceFactory,
|
|
63
|
+
private readonly targetSequenceNumber: number,
|
|
64
|
+
) {}
|
|
65
|
+
|
|
66
|
+
public async createDocumentService(
|
|
67
|
+
resolvedUrl: IResolvedUrl,
|
|
68
|
+
logger?: ITelemetryBaseLogger,
|
|
69
|
+
clientIsSummarizer?: boolean,
|
|
70
|
+
): Promise<IDocumentService> {
|
|
71
|
+
return this.inner.createPointInTimeDocumentService(
|
|
72
|
+
resolvedUrl,
|
|
73
|
+
this.targetSequenceNumber,
|
|
74
|
+
logger,
|
|
75
|
+
clientIsSummarizer,
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
public async createContainer(): Promise<IDocumentService> {
|
|
80
|
+
throw new UsageError(
|
|
81
|
+
"A point-in-time document service factory cannot be used to create containers.",
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
}
|