@fluidframework/replay-driver 2.0.0-internal.7.2.2 → 2.0.0-internal.7.4.0
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 +8 -0
- package/README.md +1 -2
- package/api-extractor-lint.json +13 -0
- package/api-extractor.json +3 -3
- package/api-report/replay-driver.api.md +9 -9
- package/dist/{emptyDeltaStorageService.js → emptyDeltaStorageService.cjs} +1 -1
- package/dist/emptyDeltaStorageService.cjs.map +1 -0
- package/dist/{index.js → index.cjs} +5 -5
- package/dist/index.cjs.map +1 -0
- package/dist/replay-driver-alpha.d.ts +34 -0
- package/dist/replay-driver-beta.d.ts +48 -0
- package/dist/replay-driver-public.d.ts +48 -0
- package/dist/replay-driver-untrimmed.d.ts +187 -0
- package/dist/{replayController.js → replayController.cjs} +3 -1
- package/dist/replayController.cjs.map +1 -0
- package/dist/replayController.d.ts +2 -0
- package/dist/replayController.d.ts.map +1 -1
- package/dist/{replayDocumentDeltaConnection.js → replayDocumentDeltaConnection.cjs} +2 -2
- package/dist/replayDocumentDeltaConnection.cjs.map +1 -0
- package/dist/{replayDocumentService.js → replayDocumentService.cjs} +4 -3
- package/dist/replayDocumentService.cjs.map +1 -0
- package/dist/replayDocumentService.d.ts +1 -0
- package/dist/replayDocumentService.d.ts.map +1 -1
- package/dist/{replayDocumentServiceFactory.js → replayDocumentServiceFactory.cjs} +6 -3
- package/dist/replayDocumentServiceFactory.cjs.map +1 -0
- package/dist/replayDocumentServiceFactory.d.ts +3 -0
- package/dist/replayDocumentServiceFactory.d.ts.map +1 -1
- package/dist/{storageImplementations.js → storageImplementations.cjs} +15 -3
- package/dist/storageImplementations.cjs.map +1 -0
- package/dist/storageImplementations.d.ts +13 -0
- package/dist/storageImplementations.d.ts.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/lib/emptyDeltaStorageService.d.ts.map +1 -1
- package/lib/{emptyDeltaStorageService.js → emptyDeltaStorageService.mjs} +1 -1
- package/lib/emptyDeltaStorageService.mjs.map +1 -0
- package/lib/index.d.ts +4 -4
- package/lib/index.d.ts.map +1 -1
- package/lib/{index.js → index.mjs} +5 -5
- package/lib/index.mjs.map +1 -0
- package/lib/replay-driver-alpha.d.ts +34 -0
- package/lib/replay-driver-beta.d.ts +48 -0
- package/lib/replay-driver-public.d.ts +48 -0
- package/lib/replay-driver-untrimmed.d.ts +187 -0
- package/lib/replayController.d.ts +2 -0
- package/lib/replayController.d.ts.map +1 -1
- package/lib/{replayController.js → replayController.mjs} +3 -1
- package/lib/replayController.mjs.map +1 -0
- package/lib/replayDocumentDeltaConnection.d.ts +1 -1
- package/lib/replayDocumentDeltaConnection.d.ts.map +1 -1
- package/lib/{replayDocumentDeltaConnection.js → replayDocumentDeltaConnection.mjs} +2 -2
- package/lib/replayDocumentDeltaConnection.mjs.map +1 -0
- package/lib/replayDocumentService.d.ts +2 -1
- package/lib/replayDocumentService.d.ts.map +1 -1
- package/lib/{replayDocumentService.js → replayDocumentService.mjs} +4 -3
- package/lib/replayDocumentService.mjs.map +1 -0
- package/lib/replayDocumentServiceFactory.d.ts +4 -1
- package/lib/replayDocumentServiceFactory.d.ts.map +1 -1
- package/lib/{replayDocumentServiceFactory.js → replayDocumentServiceFactory.mjs} +6 -3
- package/lib/replayDocumentServiceFactory.mjs.map +1 -0
- package/lib/storageImplementations.d.ts +14 -1
- package/lib/storageImplementations.d.ts.map +1 -1
- package/lib/{storageImplementations.js → storageImplementations.mjs} +15 -3
- package/lib/storageImplementations.mjs.map +1 -0
- package/lib/test/types/{validateReplayDriverPrevious.generated.js → validateReplayDriverPrevious.generated.mjs} +1 -1
- package/lib/test/types/validateReplayDriverPrevious.generated.mjs.map +1 -0
- package/package.json +38 -22
- package/src/replayController.ts +2 -0
- package/src/replayDocumentService.ts +1 -0
- package/src/replayDocumentServiceFactory.ts +3 -0
- package/src/storageImplementations.ts +13 -0
- package/tsconfig.json +5 -2
- package/dist/emptyDeltaStorageService.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/replayController.js.map +0 -1
- package/dist/replayDocumentDeltaConnection.js.map +0 -1
- package/dist/replayDocumentService.js.map +0 -1
- package/dist/replayDocumentServiceFactory.js.map +0 -1
- package/dist/storageImplementations.js.map +0 -1
- package/lib/emptyDeltaStorageService.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/replayController.js.map +0 -1
- package/lib/replayDocumentDeltaConnection.js.map +0 -1
- package/lib/replayDocumentService.js.map +0 -1
- package/lib/replayDocumentServiceFactory.js.map +0 -1
- package/lib/storageImplementations.js.map +0 -1
- package/lib/test/types/validateReplayDriverPrevious.generated.js.map +0 -1
- package/tsconfig.esnext.json +0 -7
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replayDocumentService.cjs","sourceRoot":"","sources":["../src/replayDocumentService.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,6EAAsE;AAEtE,uFAAgF;AAEhF;;;;;GAKG;AACH,4CAA4C;AAC5C,MAAa,qBAAqB;IAC1B,MAAM,CAAC,KAAK,CAAC,MAAM,CACzB,eAAqC,EACrC,UAA4B;QAE5B,MAAM,aAAa,GAAG,MAAM,UAAU,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;QACpE,IAAI,CAAC,aAAa,EAAE;YACnB,OAAO,eAAe,CAAC;SACvB;QAED,MAAM,eAAe,GAAG,6DAA6B,CAAC,MAAM,CAC3D,MAAM,eAAe,CAAC,qBAAqB,EAAE,EAC7C,UAAU,CACV,CAAC;QACF,OAAO,IAAI,qBAAqB,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;IAC/D,CAAC;IAED,YACkB,UAAuC,EACvC,YAA0C;QAD1C,eAAU,GAAV,UAAU,CAA6B;QACvC,iBAAY,GAAZ,YAAY,CAA8B;IACzD,CAAC;IAEG,OAAO,KAAI,CAAC;IAEnB,8EAA8E;IAC9E,IAAW,WAAW;QACrB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACpC,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,gBAAgB;QAC5B,OAAO,IAAI,CAAC,UAAU,CAAC;IACxB,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,qBAAqB;QACjC,OAAO,IAAI,mDAAwB,EAAE,CAAC;IACvC,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,oBAAoB,CAAC,MAAe;QAChD,OAAO,IAAI,CAAC,YAAY,CAAC;IAC1B,CAAC;CACD;AAtDD,sDAsDC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as api from \"@fluidframework/driver-definitions\";\nimport { IClient } from \"@fluidframework/protocol-definitions\";\nimport { EmptyDeltaStorageService } from \"./emptyDeltaStorageService\";\nimport { ReplayController } from \"./replayController\";\nimport { ReplayDocumentDeltaConnection } from \"./replayDocumentDeltaConnection\";\n\n/**\n * The Replay document service dummies out the snapshot and the delta storage.\n * Delta connection simulates the socket by fetching the ops from delta storage\n * and emitting them with a pre determined delay\n * @internal\n */\n// eslint-disable-next-line import/namespace\nexport class ReplayDocumentService implements api.IDocumentService {\n\tpublic static async create(\n\t\tdocumentService: api.IDocumentService,\n\t\tcontroller: ReplayController,\n\t): Promise<api.IDocumentService> {\n\t\tconst useController = await controller.initStorage(documentService);\n\t\tif (!useController) {\n\t\t\treturn documentService;\n\t\t}\n\n\t\tconst deltaConnection = ReplayDocumentDeltaConnection.create(\n\t\t\tawait documentService.connectToDeltaStorage(),\n\t\t\tcontroller,\n\t\t);\n\t\treturn new ReplayDocumentService(controller, deltaConnection);\n\t}\n\n\tconstructor(\n\t\tprivate readonly controller: api.IDocumentStorageService,\n\t\tprivate readonly deltaStorage: api.IDocumentDeltaConnection,\n\t) {}\n\n\tpublic dispose() {}\n\n\t// TODO: Issue-2109 Implement detach container api or put appropriate comment.\n\tpublic get resolvedUrl(): api.IResolvedUrl {\n\t\tthrow new Error(\"Not implemented\");\n\t}\n\n\t/**\n\t * Connects to a storage endpoint for snapshot service and blobs.\n\t * @returns returns the dummy document storage service for replay driver.\n\t */\n\tpublic async connectToStorage(): Promise<api.IDocumentStorageService> {\n\t\treturn this.controller;\n\t}\n\n\t/**\n\t * Connects to a delta storage endpoint for getting ops between a range.\n\t * @returns returns the dummy document delta storage service for replay driver.\n\t */\n\tpublic async connectToDeltaStorage(): Promise<api.IDocumentDeltaStorageService> {\n\t\treturn new EmptyDeltaStorageService();\n\t}\n\n\t/**\n\t * Connects to a delta storage endpoint of provided documentService to get ops and then replaying\n\t * them so as to mimic a delta stream endpoint.\n\t * @param client - Client that connects to socket.\n\t * @returns returns the delta stream service which replay ops from --from to --to arguments.\n\t */\n\tpublic async connectToDeltaStream(client: IClient): Promise<api.IDocumentDeltaConnection> {\n\t\treturn this.deltaStorage;\n\t}\n}\n"]}
|
|
@@ -9,6 +9,7 @@ import { ReplayController } from "./replayController";
|
|
|
9
9
|
* The Replay document service dummies out the snapshot and the delta storage.
|
|
10
10
|
* Delta connection simulates the socket by fetching the ops from delta storage
|
|
11
11
|
* and emitting them with a pre determined delay
|
|
12
|
+
* @internal
|
|
12
13
|
*/
|
|
13
14
|
export declare class ReplayDocumentService implements api.IDocumentService {
|
|
14
15
|
private readonly controller;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replayDocumentService.d.ts","sourceRoot":"","sources":["../src/replayDocumentService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,GAAG,MAAM,oCAAoC,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAC;AAE/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD
|
|
1
|
+
{"version":3,"file":"replayDocumentService.d.ts","sourceRoot":"","sources":["../src/replayDocumentService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,GAAG,MAAM,oCAAoC,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAC;AAE/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD;;;;;GAKG;AAEH,qBAAa,qBAAsB,YAAW,GAAG,CAAC,gBAAgB;IAkBhE,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,YAAY;WAlBV,MAAM,CACzB,eAAe,EAAE,GAAG,CAAC,gBAAgB,EACrC,UAAU,EAAE,gBAAgB,GAC1B,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;gBAcd,UAAU,EAAE,GAAG,CAAC,uBAAuB,EACvC,YAAY,EAAE,GAAG,CAAC,wBAAwB;IAGrD,OAAO;IAGd,IAAW,WAAW,IAAI,GAAG,CAAC,YAAY,CAEzC;IAED;;;OAGG;IACU,gBAAgB,IAAI,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC;IAIrE;;;OAGG;IACU,qBAAqB,IAAI,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC;IAI/E;;;;;OAKG;IACU,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC;CAGzF"}
|
|
@@ -6,8 +6,11 @@
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.ReplayDocumentServiceFactory = void 0;
|
|
8
8
|
const telemetry_utils_1 = require("@fluidframework/telemetry-utils");
|
|
9
|
-
const replayDocumentDeltaConnection_1 = require("./replayDocumentDeltaConnection");
|
|
10
|
-
const replayDocumentService_1 = require("./replayDocumentService");
|
|
9
|
+
const replayDocumentDeltaConnection_1 = require("./replayDocumentDeltaConnection.cjs");
|
|
10
|
+
const replayDocumentService_1 = require("./replayDocumentService.cjs");
|
|
11
|
+
/**
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
11
14
|
class ReplayDocumentServiceFactory {
|
|
12
15
|
static create(from, to, documentServiceFactory) {
|
|
13
16
|
return new ReplayDocumentServiceFactory(documentServiceFactory, new replayDocumentDeltaConnection_1.ReplayControllerStatic(from, to));
|
|
@@ -37,4 +40,4 @@ class ReplayDocumentServiceFactory {
|
|
|
37
40
|
}
|
|
38
41
|
}
|
|
39
42
|
exports.ReplayDocumentServiceFactory = ReplayDocumentServiceFactory;
|
|
40
|
-
//# sourceMappingURL=replayDocumentServiceFactory.
|
|
43
|
+
//# sourceMappingURL=replayDocumentServiceFactory.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replayDocumentServiceFactory.cjs","sourceRoot":"","sources":["../src/replayDocumentServiceFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AASH,qEAAoE;AAEpE,uFAAyE;AACzE,uEAAgE;AAEhE;;GAEG;AACH,MAAa,4BAA4B;IACjC,MAAM,CAAC,MAAM,CACnB,IAAY,EACZ,EAAU,EACV,sBAA+C;QAE/C,OAAO,IAAI,4BAA4B,CACtC,sBAAsB,EACtB,IAAI,sDAAsB,CAAC,IAAI,EAAE,EAAE,CAAC,CACpC,CAAC;IACH,CAAC;IAED,YACkB,sBAA+C,EAC/C,UAA4B;QAD5B,2BAAsB,GAAtB,sBAAsB,CAAyB;QAC/C,eAAU,GAAV,UAAU,CAAkB;IAC3C,CAAC;IAEJ;;;;;OAKG;IACI,KAAK,CAAC,qBAAqB,CACjC,WAAyB,EACzB,MAA6B,EAC7B,kBAA4B;QAE5B,iEAAiE;QACjE,wGAAwG;QACxG,MAAM,YAAY,GAAG,IAAA,mCAAiB,EAAC;YACtC,MAAM;YACN,UAAU,EAAE,EAAE,GAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE;SACvC,CAAC,CAAC;QAEH,OAAO,6CAAqB,CAAC,MAAM,CAClC,MAAM,IAAI,CAAC,sBAAsB,CAAC,qBAAqB,CACtD,WAAW,EACX,YAAY,EACZ,kBAAkB,CAClB,EACD,IAAI,CAAC,UAAU,CACf,CAAC;IACH,CAAC;IAED,8EAA8E;IACvE,KAAK,CAAC,eAAe,CAC3B,gBAA8B,EAC9B,WAAyB,EACzB,MAA6B,EAC7B,kBAA4B;QAE5B,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACpC,CAAC;CACD;AAtDD,oEAsDC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIDocumentService,\n\tIDocumentServiceFactory,\n\tIResolvedUrl,\n} from \"@fluidframework/driver-definitions\";\nimport { ISummaryTree } from \"@fluidframework/protocol-definitions\";\nimport { ITelemetryBaseLogger } from \"@fluidframework/core-interfaces\";\nimport { createChildLogger } from \"@fluidframework/telemetry-utils\";\nimport { ReplayController } from \"./replayController\";\nimport { ReplayControllerStatic } from \"./replayDocumentDeltaConnection\";\nimport { ReplayDocumentService } from \"./replayDocumentService\";\n\n/**\n * @internal\n */\nexport class ReplayDocumentServiceFactory implements IDocumentServiceFactory {\n\tpublic static create(\n\t\tfrom: number,\n\t\tto: number,\n\t\tdocumentServiceFactory: IDocumentServiceFactory,\n\t) {\n\t\treturn new ReplayDocumentServiceFactory(\n\t\t\tdocumentServiceFactory,\n\t\t\tnew ReplayControllerStatic(from, to),\n\t\t);\n\t}\n\n\tpublic constructor(\n\t\tprivate readonly documentServiceFactory: IDocumentServiceFactory,\n\t\tprivate readonly controller: ReplayController,\n\t) {}\n\n\t/**\n\t * Creates a replay document service which uses the document service of provided\n\t * documentServiceFactory for connecting to delta stream endpoint.\n\t * @param resolvedUrl - URL to be used for connecting to endpoints.\n\t * @returns returns the requested document service\n\t */\n\tpublic async createDocumentService(\n\t\tresolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\t// Always include isReplay: true on events for the Replay Driver.\n\t\t// It's used in testing/debugging scenarios, so we want to be able to filter these events out sometimes.\n\t\tconst replayLogger = createChildLogger({\n\t\t\tlogger,\n\t\t\tproperties: { all: { isReplay: true } },\n\t\t});\n\n\t\treturn ReplayDocumentService.create(\n\t\t\tawait this.documentServiceFactory.createDocumentService(\n\t\t\t\tresolvedUrl,\n\t\t\t\treplayLogger,\n\t\t\t\tclientIsSummarizer,\n\t\t\t),\n\t\t\tthis.controller,\n\t\t);\n\t}\n\n\t// TODO: Issue-2109 Implement detach container api or put appropriate comment.\n\tpublic async createContainer(\n\t\tcreateNewSummary: ISummaryTree,\n\t\tresolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\tthrow new Error(\"Not implemented\");\n\t}\n}\n"]}
|
|
@@ -6,6 +6,9 @@ import { IDocumentService, IDocumentServiceFactory, IResolvedUrl } from "@fluidf
|
|
|
6
6
|
import { ISummaryTree } from "@fluidframework/protocol-definitions";
|
|
7
7
|
import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
8
8
|
import { ReplayController } from "./replayController";
|
|
9
|
+
/**
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
9
12
|
export declare class ReplayDocumentServiceFactory implements IDocumentServiceFactory {
|
|
10
13
|
private readonly documentServiceFactory;
|
|
11
14
|
private readonly controller;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replayDocumentServiceFactory.d.ts","sourceRoot":"","sources":["../src/replayDocumentServiceFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,gBAAgB,EAChB,uBAAuB,EACvB,YAAY,EACZ,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAEvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAItD,qBAAa,4BAA6B,YAAW,uBAAuB;IAa1E,OAAO,CAAC,QAA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AE,oBAAoB,EAC7B,kBAAkB,CAAC,EAAE,OAAO,GAC1B,OAAO,CAAC,gBAAgB,CAAC;IAmBf,eAAe,CAC3B,gBAAgB,EAAE,YAAY,EAC9B,WAAW,EAAE,YAAY,EACzB,MAAM,CAAC,EAAE,oBAAoB,EAC7B,kBAAkB,CAAC,EAAE,OAAO,GAC1B,OAAO,CAAC,gBAAgB,CAAC;CAG5B"}
|
|
@@ -7,8 +7,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
exports.StaticStorageDocumentServiceFactory = exports.StaticStorageDocumentService = exports.OpStorage = exports.SnapshotStorage = exports.FileSnapshotReader = void 0;
|
|
8
8
|
const core_utils_1 = require("@fluidframework/core-utils");
|
|
9
9
|
const driver_utils_1 = require("@fluidframework/driver-utils");
|
|
10
|
-
const emptyDeltaStorageService_1 = require("./emptyDeltaStorageService");
|
|
11
|
-
const replayController_1 = require("./replayController");
|
|
10
|
+
const emptyDeltaStorageService_1 = require("./emptyDeltaStorageService.cjs");
|
|
11
|
+
const replayController_1 = require("./replayController.cjs");
|
|
12
|
+
/**
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
12
15
|
class FileSnapshotReader extends replayController_1.ReadDocumentStorageServiceBase {
|
|
13
16
|
constructor(json) {
|
|
14
17
|
super();
|
|
@@ -59,6 +62,9 @@ class FileSnapshotReader extends replayController_1.ReadDocumentStorageServiceBa
|
|
|
59
62
|
exports.FileSnapshotReader = FileSnapshotReader;
|
|
60
63
|
// IVersion.treeId used to communicate between getVersions() & getSnapshotTree() calls to indicate IVersion is ours.
|
|
61
64
|
FileSnapshotReader.FileStorageVersionTreeId = "FileStorageTreeId";
|
|
65
|
+
/**
|
|
66
|
+
* @internal
|
|
67
|
+
*/
|
|
62
68
|
class SnapshotStorage extends replayController_1.ReadDocumentStorageServiceBase {
|
|
63
69
|
constructor(storage, docTree) {
|
|
64
70
|
super();
|
|
@@ -86,6 +92,9 @@ class SnapshotStorage extends replayController_1.ReadDocumentStorageServiceBase
|
|
|
86
92
|
}
|
|
87
93
|
}
|
|
88
94
|
exports.SnapshotStorage = SnapshotStorage;
|
|
95
|
+
/**
|
|
96
|
+
* @internal
|
|
97
|
+
*/
|
|
89
98
|
class OpStorage extends replayController_1.ReadDocumentStorageServiceBase {
|
|
90
99
|
async getVersions(versionId, count) {
|
|
91
100
|
return [];
|
|
@@ -116,6 +125,9 @@ class StaticStorageDocumentService {
|
|
|
116
125
|
}
|
|
117
126
|
}
|
|
118
127
|
exports.StaticStorageDocumentService = StaticStorageDocumentService;
|
|
128
|
+
/**
|
|
129
|
+
* @internal
|
|
130
|
+
*/
|
|
119
131
|
class StaticStorageDocumentServiceFactory {
|
|
120
132
|
constructor(storage) {
|
|
121
133
|
this.storage = storage;
|
|
@@ -129,4 +141,4 @@ class StaticStorageDocumentServiceFactory {
|
|
|
129
141
|
}
|
|
130
142
|
}
|
|
131
143
|
exports.StaticStorageDocumentServiceFactory = StaticStorageDocumentServiceFactory;
|
|
132
|
-
//# sourceMappingURL=storageImplementations.
|
|
144
|
+
//# sourceMappingURL=storageImplementations.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storageImplementations.cjs","sourceRoot":"","sources":["../src/storageImplementations.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2DAAoD;AASpD,+DAAiE;AASjE,6EAAsE;AACtE,6DAAoE;AAWpE;;GAEG;AACH,MAAa,kBACZ,SAAQ,iDAA8B;IAYtC,YAAmB,IAAmB;QACrC,KAAK,EAAE,CAAC;QAJU,YAAO,GAA6B,EAAE,CAAC;QACvC,UAAK,GAAqC,EAAE,CAAC;QAI/D,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAE5B,IAAI,CAAC,KAAK,GAAG,IAAI,GAAG,EAA2B,CAAC;QAChD,IAAI,CAAC,OAAO,GAAG,IAAA,gCAAiB,EAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,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C,OAAgC;QAAhC,YAAO,GAAP,OAAO,CAAyB;IAAG,CAAC;IAEnE,KAAK,CAAC,qBAAqB,CACjC,OAAqB,EACrB,MAA4B,EAC5B,kBAA4B;QAE5B,OAAO,IAAI,4BAA4B,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAChE,CAAC;IAED,8EAA8E;IACvE,KAAK,CAAC,eAAe,CAC3B,gBAA8B,EAC9B,WAAyB,EACzB,MAA2B,EAC3B,kBAA4B;QAE5B,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACpC,CAAC;CACD;AApBD,kFAoBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils\";\nimport {\n\tIDocumentDeltaConnection,\n\tIDocumentDeltaStorageService,\n\tIDocumentService,\n\tIDocumentServiceFactory,\n\tIDocumentStorageService,\n\tIResolvedUrl,\n} from \"@fluidframework/driver-definitions\";\nimport { buildSnapshotTree } from \"@fluidframework/driver-utils\";\nimport {\n\tIClient,\n\tISnapshotTree,\n\tITree,\n\tIVersion,\n\tISummaryTree,\n} from \"@fluidframework/protocol-definitions\";\nimport { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils\";\nimport { EmptyDeltaStorageService } from \"./emptyDeltaStorageService\";\nimport { ReadDocumentStorageServiceBase } from \"./replayController\";\n\n/**\n * Structure of snapshot on disk, when we store snapshot as single file\n * @internal\n */\nexport interface IFileSnapshot {\n\ttree: ITree;\n\tcommits: { [key: string]: ITree };\n}\n\n/**\n * @internal\n */\nexport class FileSnapshotReader\n\textends ReadDocumentStorageServiceBase\n\timplements IDocumentStorageService\n{\n\t// IVersion.treeId used to communicate between getVersions() & getSnapshotTree() calls to indicate IVersion is ours.\n\tprotected static readonly FileStorageVersionTreeId = \"FileStorageTreeId\";\n\n\tprotected docId?: string;\n\tprotected docTree: ISnapshotTree;\n\tprotected blobs: Map<string, ArrayBufferLike>;\n\tprotected readonly commits: { [key: string]: ITree } = {};\n\tprotected readonly trees: { [key: string]: ISnapshotTree } = {};\n\n\tpublic constructor(json: IFileSnapshot) {\n\t\tsuper();\n\t\tthis.commits = json.commits;\n\n\t\tthis.blobs = new Map<string, ArrayBufferLike>();\n\t\tthis.docTree = buildSnapshotTree(json.tree.entries, this.blobs);\n\t}\n\n\tpublic async getVersions(versionId: string | null, count: number): Promise<IVersion[]> {\n\t\tif (this.docId === undefined || this.docId === versionId || versionId === null) {\n\t\t\tif (versionId !== null) {\n\t\t\t\tthis.docId = versionId;\n\t\t\t}\n\t\t\treturn [{ id: \"latest\", treeId: \"\" }];\n\t\t}\n\n\t\tif (this.commits[versionId] !== undefined) {\n\t\t\treturn [{ id: versionId, treeId: FileSnapshotReader.FileStorageVersionTreeId }];\n\t\t}\n\t\tthrow new Error(`Unknown version ID: ${versionId}`);\n\t}\n\n\tpublic async getSnapshotTree(versionRequested?: IVersion): Promise<ISnapshotTree | null> {\n\t\tif (!versionRequested || versionRequested.id === \"latest\") {\n\t\t\treturn this.docTree;\n\t\t}\n\t\tif (versionRequested.treeId !== FileSnapshotReader.FileStorageVersionTreeId) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-base-to-string\n\t\t\tthrow new Error(`Unknown version id: ${versionRequested}`);\n\t\t}\n\n\t\tlet snapshotTree = this.trees[versionRequested.id];\n\t\tif (snapshotTree === undefined) {\n\t\t\tconst tree = this.commits[versionRequested.id];\n\t\t\tif (tree === undefined) {\n\t\t\t\tthrow new Error(`Can't find version ${versionRequested.id}`);\n\t\t\t}\n\n\t\t\tthis.trees[versionRequested.id] = snapshotTree = buildSnapshotTree(\n\t\t\t\ttree.entries,\n\t\t\t\tthis.blobs,\n\t\t\t);\n\t\t}\n\t\treturn snapshotTree;\n\t}\n\n\tpublic async readBlob(blobId: string): Promise<ArrayBufferLike> {\n\t\tconst blob = this.blobs.get(blobId);\n\t\tif (blob !== undefined) {\n\t\t\treturn blob;\n\t\t}\n\t\tthrow new Error(`Unknown blob ID: ${blobId}`);\n\t}\n}\n\n/**\n * @internal\n */\nexport class SnapshotStorage extends ReadDocumentStorageServiceBase {\n\tprotected docId?: string;\n\n\tconstructor(\n\t\tprotected readonly storage: IDocumentStorageService,\n\t\tprotected readonly docTree: ISnapshotTree | null,\n\t) {\n\t\tsuper();\n\t\tassert(!!this.docTree, 0x0b0 /* \"Missing document snapshot tree!\" */);\n\t}\n\n\tpublic async getVersions(versionId: string | null, count: number): Promise<IVersion[]> {\n\t\tif (this.docId === undefined || this.docId === versionId || versionId === null) {\n\t\t\tif (versionId !== null) {\n\t\t\t\tthis.docId = versionId;\n\t\t\t}\n\t\t\treturn [{ id: \"latest\", treeId: \"\" }];\n\t\t}\n\t\treturn this.storage.getVersions(versionId, count);\n\t}\n\n\tpublic async getSnapshotTree(versionRequested?: IVersion): Promise<ISnapshotTree | null> {\n\t\tif (versionRequested && versionRequested.id !== \"latest\") {\n\t\t\treturn this.storage.getSnapshotTree(versionRequested);\n\t\t}\n\n\t\treturn this.docTree;\n\t}\n\n\tpublic async readBlob(blobId: string): Promise<ArrayBufferLike> {\n\t\treturn this.storage.readBlob(blobId);\n\t}\n}\n\n/**\n * @internal\n */\nexport class OpStorage extends ReadDocumentStorageServiceBase {\n\tpublic async getVersions(versionId: string | null, count: number): Promise<IVersion[]> {\n\t\treturn [];\n\t}\n\n\tpublic async getSnapshotTree(version?: IVersion): Promise<ISnapshotTree | null> {\n\t\tthrow new Error(\"no snapshot tree should be asked when playing ops\");\n\t}\n\n\tpublic async readBlob(blobId: string): Promise<ArrayBufferLike> {\n\t\tthrow new Error(`Unknown blob ID: ${blobId}`);\n\t}\n}\n\nexport class StaticStorageDocumentService implements IDocumentService {\n\tconstructor(\n\t\tpublic readonly resolvedUrl: IResolvedUrl,\n\t\tprivate readonly storage: IDocumentStorageService,\n\t) {}\n\n\tpublic dispose() {}\n\n\tpublic async connectToStorage(): Promise<IDocumentStorageService> {\n\t\treturn this.storage;\n\t}\n\n\tpublic async connectToDeltaStorage(): Promise<IDocumentDeltaStorageService> {\n\t\treturn new EmptyDeltaStorageService();\n\t}\n\n\tpublic async connectToDeltaStream(client: IClient): Promise<IDocumentDeltaConnection> {\n\t\t// We have no delta stream, so make it not return forever...\n\t\treturn new Promise(() => {});\n\t}\n}\n\n/**\n * @internal\n */\nexport class StaticStorageDocumentServiceFactory implements IDocumentServiceFactory {\n\tpublic constructor(protected readonly storage: IDocumentStorageService) {}\n\n\tpublic async createDocumentService(\n\t\tfileURL: IResolvedUrl,\n\t\tlogger?: ITelemetryLoggerExt,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\treturn new StaticStorageDocumentService(fileURL, this.storage);\n\t}\n\n\t// TODO: Issue-2109 Implement detach container api or put appropriate comment.\n\tpublic async createContainer(\n\t\tcreateNewSummary: ISummaryTree,\n\t\tresolvedUrl: IResolvedUrl,\n\t\tlogger: ITelemetryLoggerExt,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\tthrow new Error(\"Not implemented\");\n\t}\n}\n"]}
|
|
@@ -8,6 +8,7 @@ import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
|
|
|
8
8
|
import { ReadDocumentStorageServiceBase } from "./replayController";
|
|
9
9
|
/**
|
|
10
10
|
* Structure of snapshot on disk, when we store snapshot as single file
|
|
11
|
+
* @internal
|
|
11
12
|
*/
|
|
12
13
|
export interface IFileSnapshot {
|
|
13
14
|
tree: ITree;
|
|
@@ -15,6 +16,9 @@ export interface IFileSnapshot {
|
|
|
15
16
|
[key: string]: ITree;
|
|
16
17
|
};
|
|
17
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
18
22
|
export declare class FileSnapshotReader extends ReadDocumentStorageServiceBase implements IDocumentStorageService {
|
|
19
23
|
protected static readonly FileStorageVersionTreeId = "FileStorageTreeId";
|
|
20
24
|
protected docId?: string;
|
|
@@ -31,6 +35,9 @@ export declare class FileSnapshotReader extends ReadDocumentStorageServiceBase i
|
|
|
31
35
|
getSnapshotTree(versionRequested?: IVersion): Promise<ISnapshotTree | null>;
|
|
32
36
|
readBlob(blobId: string): Promise<ArrayBufferLike>;
|
|
33
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* @internal
|
|
40
|
+
*/
|
|
34
41
|
export declare class SnapshotStorage extends ReadDocumentStorageServiceBase {
|
|
35
42
|
protected readonly storage: IDocumentStorageService;
|
|
36
43
|
protected readonly docTree: ISnapshotTree | null;
|
|
@@ -40,6 +47,9 @@ export declare class SnapshotStorage extends ReadDocumentStorageServiceBase {
|
|
|
40
47
|
getSnapshotTree(versionRequested?: IVersion): Promise<ISnapshotTree | null>;
|
|
41
48
|
readBlob(blobId: string): Promise<ArrayBufferLike>;
|
|
42
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* @internal
|
|
52
|
+
*/
|
|
43
53
|
export declare class OpStorage extends ReadDocumentStorageServiceBase {
|
|
44
54
|
getVersions(versionId: string | null, count: number): Promise<IVersion[]>;
|
|
45
55
|
getSnapshotTree(version?: IVersion): Promise<ISnapshotTree | null>;
|
|
@@ -54,6 +64,9 @@ export declare class StaticStorageDocumentService implements IDocumentService {
|
|
|
54
64
|
connectToDeltaStorage(): Promise<IDocumentDeltaStorageService>;
|
|
55
65
|
connectToDeltaStream(client: IClient): Promise<IDocumentDeltaConnection>;
|
|
56
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* @internal
|
|
69
|
+
*/
|
|
57
70
|
export declare class StaticStorageDocumentServiceFactory implements IDocumentServiceFactory {
|
|
58
71
|
protected readonly storage: IDocumentStorageService;
|
|
59
72
|
constructor(storage: IDocumentStorageService);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storageImplementations.d.ts","sourceRoot":"","sources":["../src/storageImplementations.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,wBAAwB,EACxB,4BAA4B,EAC5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QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;CAG/D;AAED,qBAAa,4BAA6B,YAAW,gBAAgB;aAEnD,WAAW,EAAE,YAAY;IACzC,OAAO,CAAC,QAAQ,CAAC,OAAO;gBADR,WAAW,EAAE,YAAY,EACxB,OAAO,EAAE,uBAAuB;IAG3C,OAAO;IAED,gBAAgB,IAAI,OAAO,CAAC,uBAAuB,CAAC;IAIpD,qBAAqB,IAAI,OAAO,CAAC,4BAA4B,CAAC;IAI9D,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,wBAAwB,CAAC;CAIrF;AAED;;GAEG;AACH,qBAAa,mCAAoC,YAAW,uBAAuB;IAC/D,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,uBAAuB;gBAAhC,OAAO,EAAE,uBAAuB;IAEzD,qBAAqB,CACjC,OAAO,EAAE,YAAY,EACrB,MAAM,CAAC,EAAE,mBAAmB,EAC5B,kBAAkB,CAAC,EAAE,OAAO,GAC1B,OAAO,CAAC,gBAAgB,CAAC;IAKf,eAAe,CAC3B,gBAAgB,EAAE,YAAY,EAC9B,WAAW,EAAE,YAAY,EACzB,MAAM,EAAE,mBAAmB,EAC3B,kBAAkB,CAAC,EAAE,OAAO,GAC1B,OAAO,CAAC,gBAAgB,CAAC;CAG5B"}
|
package/dist/tsdoc-metadata.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emptyDeltaStorageService.d.ts","sourceRoot":"","sources":["../src/emptyDeltaStorageService.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"emptyDeltaStorageService.d.ts","sourceRoot":"","sources":["../src/emptyDeltaStorageService.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,4BAA4B,EAAE,OAAO,EAAE,MAAM,oCAAoC;OACnF,EAAE,yBAAyB,EAAE,MAAM,sCAAsC;AAGhF,qBAAa,wBAAyB,YAAW,4BAA4B;IAC5E;;;;;OAKG;IACI,aAAa,CACnB,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,GAAG,SAAS,EACtB,WAAW,CAAC,EAAE,WAAW,EACzB,UAAU,CAAC,EAAE,OAAO,GAClB,OAAO,CAAC,yBAAyB,EAAE,CAAC;CAGvC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emptyDeltaStorageService.mjs","sourceRoot":"","sources":["../src/emptyDeltaStorageService.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAII,EAAE,kBAAkB,EAAE,MAAM,8BAA8B;AAEjE,MAAM,OAAO,wBAAwB;IACpC;;;;;OAKG;IACI,aAAa,CACnB,IAAY,EACZ,EAAsB,EACtB,WAAyB,EACzB,UAAoB;QAEpB,OAAO,kBAAkB,CAAC;IAC3B,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IDocumentDeltaStorageService, IStream } from \"@fluidframework/driver-definitions\";\nimport { ISequencedDocumentMessage } from \"@fluidframework/protocol-definitions\";\nimport { emptyMessageStream } from \"@fluidframework/driver-utils\";\n\nexport class EmptyDeltaStorageService implements IDocumentDeltaStorageService {\n\t/**\n\t * Returns ops from the list of ops generated till now.\n\t * @param from - Ops are returned from + 1.\n\t * @param to - Op are returned from to - 1.\n\t * @returns Array of ops requested by the user.\n\t */\n\tpublic fetchMessages(\n\t\tfrom: number,\n\t\tto: number | undefined,\n\t\tabortSignal?: AbortSignal,\n\t\tcachedOnly?: boolean,\n\t): IStream<ISequencedDocumentMessage[]> {\n\t\treturn emptyMessageStream;\n\t}\n}\n"]}
|
package/lib/index.d.ts
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
export { ReadDocumentStorageServiceBase, ReplayController } from "./replayController";
|
|
6
|
-
export { ReplayDocumentService } from "./replayDocumentService";
|
|
7
|
-
export { ReplayDocumentServiceFactory } from "./replayDocumentServiceFactory";
|
|
8
|
-
export { FileSnapshotReader, IFileSnapshot, OpStorage, SnapshotStorage, StaticStorageDocumentServiceFactory, } from "./storageImplementations";
|
|
5
|
+
export { ReadDocumentStorageServiceBase, ReplayController } from "./replayController.mjs";
|
|
6
|
+
export { ReplayDocumentService } from "./replayDocumentService.mjs";
|
|
7
|
+
export { ReplayDocumentServiceFactory } from "./replayDocumentServiceFactory.mjs";
|
|
8
|
+
export { FileSnapshotReader, IFileSnapshot, OpStorage, SnapshotStorage, StaticStorageDocumentServiceFactory, } from "./storageImplementations.mjs";
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
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;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,8BAA8B,EAAE,gBAAgB,EAAE;OACpD,EAAE,qBAAqB,EAAE;OACzB,EAAE,4BAA4B,EAAE;OAChC,EACN,kBAAkB,EAClB,aAAa,EACb,SAAS,EACT,eAAe,EACf,mCAAmC,GACnC"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
export { ReadDocumentStorageServiceBase, ReplayController } from "./replayController";
|
|
6
|
-
export { ReplayDocumentService } from "./replayDocumentService";
|
|
7
|
-
export { ReplayDocumentServiceFactory } from "./replayDocumentServiceFactory";
|
|
8
|
-
export { FileSnapshotReader, OpStorage, SnapshotStorage, StaticStorageDocumentServiceFactory, } from "./storageImplementations";
|
|
9
|
-
//# sourceMappingURL=index.
|
|
5
|
+
export { ReadDocumentStorageServiceBase, ReplayController } from "./replayController.mjs";
|
|
6
|
+
export { ReplayDocumentService } from "./replayDocumentService.mjs";
|
|
7
|
+
export { ReplayDocumentServiceFactory } from "./replayDocumentServiceFactory.mjs";
|
|
8
|
+
export { FileSnapshotReader, OpStorage, SnapshotStorage, StaticStorageDocumentServiceFactory, } from "./storageImplementations.mjs";
|
|
9
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,8BAA8B,EAAE,gBAAgB,EAAE;OACpD,EAAE,qBAAqB,EAAE;OACzB,EAAE,4BAA4B,EAAE;OAChC,EACN,kBAAkB,EAElB,SAAS,EACT,eAAe,EACf,mCAAmC,GACnC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { ReadDocumentStorageServiceBase, ReplayController } from \"./replayController\";\nexport { ReplayDocumentService } from \"./replayDocumentService\";\nexport { ReplayDocumentServiceFactory } from \"./replayDocumentServiceFactory\";\nexport {\n\tFileSnapshotReader,\n\tIFileSnapshot,\n\tOpStorage,\n\tSnapshotStorage,\n\tStaticStorageDocumentServiceFactory,\n} from \"./storageImplementations\";\n"]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as api from '@fluidframework/protocol-definitions';
|
|
2
|
+
import * as api_2 from '@fluidframework/driver-definitions';
|
|
3
|
+
import { IClient } from '@fluidframework/protocol-definitions';
|
|
4
|
+
import { IDocumentService } from '@fluidframework/driver-definitions';
|
|
5
|
+
import { IDocumentServiceFactory } from '@fluidframework/driver-definitions';
|
|
6
|
+
import { IDocumentStorageService } from '@fluidframework/driver-definitions';
|
|
7
|
+
import { IResolvedUrl } from '@fluidframework/driver-definitions';
|
|
8
|
+
import { ISnapshotTree } from '@fluidframework/protocol-definitions';
|
|
9
|
+
import { ISummaryContext } from '@fluidframework/driver-definitions';
|
|
10
|
+
import { ISummaryTree } from '@fluidframework/protocol-definitions';
|
|
11
|
+
import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
|
|
12
|
+
import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
|
|
13
|
+
import { ITree } from '@fluidframework/protocol-definitions';
|
|
14
|
+
import { IVersion } from '@fluidframework/protocol-definitions';
|
|
15
|
+
|
|
16
|
+
/* Excluded from this release type: FileSnapshotReader */
|
|
17
|
+
|
|
18
|
+
/* Excluded from this release type: IFileSnapshot */
|
|
19
|
+
|
|
20
|
+
/* Excluded from this release type: OpStorage */
|
|
21
|
+
|
|
22
|
+
/* Excluded from this release type: ReadDocumentStorageServiceBase */
|
|
23
|
+
|
|
24
|
+
/* Excluded from this release type: ReplayController */
|
|
25
|
+
|
|
26
|
+
/* Excluded from this release type: ReplayDocumentService */
|
|
27
|
+
|
|
28
|
+
/* Excluded from this release type: ReplayDocumentServiceFactory */
|
|
29
|
+
|
|
30
|
+
/* Excluded from this release type: SnapshotStorage */
|
|
31
|
+
|
|
32
|
+
/* Excluded from this release type: StaticStorageDocumentServiceFactory */
|
|
33
|
+
|
|
34
|
+
export { }
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as api from '@fluidframework/protocol-definitions';
|
|
2
|
+
import * as api_2 from '@fluidframework/driver-definitions';
|
|
3
|
+
import { IClient } from '@fluidframework/protocol-definitions';
|
|
4
|
+
import { IDocumentService } from '@fluidframework/driver-definitions';
|
|
5
|
+
import { IDocumentServiceFactory } from '@fluidframework/driver-definitions';
|
|
6
|
+
import { IDocumentStorageService } from '@fluidframework/driver-definitions';
|
|
7
|
+
import { IResolvedUrl } from '@fluidframework/driver-definitions';
|
|
8
|
+
import { ISnapshotTree } from '@fluidframework/protocol-definitions';
|
|
9
|
+
import { ISummaryContext } from '@fluidframework/driver-definitions';
|
|
10
|
+
import { ISummaryTree } from '@fluidframework/protocol-definitions';
|
|
11
|
+
import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
|
|
12
|
+
import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
|
|
13
|
+
import { ITree } from '@fluidframework/protocol-definitions';
|
|
14
|
+
import { IVersion } from '@fluidframework/protocol-definitions';
|
|
15
|
+
|
|
16
|
+
/* Excluded from this release type: FileSnapshotReader */
|
|
17
|
+
|
|
18
|
+
/* Excluded from this release type: IDocumentService */
|
|
19
|
+
|
|
20
|
+
/* Excluded from this release type: IDocumentServiceFactory */
|
|
21
|
+
|
|
22
|
+
/* Excluded from this release type: IDocumentStorageService */
|
|
23
|
+
|
|
24
|
+
/* Excluded from this release type: IFileSnapshot */
|
|
25
|
+
|
|
26
|
+
/* Excluded from this release type: IResolvedUrl */
|
|
27
|
+
|
|
28
|
+
/* Excluded from this release type: ISummaryContext */
|
|
29
|
+
|
|
30
|
+
/* Excluded from this release type: ITelemetryBaseLogger */
|
|
31
|
+
|
|
32
|
+
/* Excluded from this release type: ITelemetryLoggerExt */
|
|
33
|
+
|
|
34
|
+
/* Excluded from this release type: OpStorage */
|
|
35
|
+
|
|
36
|
+
/* Excluded from this release type: ReadDocumentStorageServiceBase */
|
|
37
|
+
|
|
38
|
+
/* Excluded from this release type: ReplayController */
|
|
39
|
+
|
|
40
|
+
/* Excluded from this release type: ReplayDocumentService */
|
|
41
|
+
|
|
42
|
+
/* Excluded from this release type: ReplayDocumentServiceFactory */
|
|
43
|
+
|
|
44
|
+
/* Excluded from this release type: SnapshotStorage */
|
|
45
|
+
|
|
46
|
+
/* Excluded from this release type: StaticStorageDocumentServiceFactory */
|
|
47
|
+
|
|
48
|
+
export { }
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as api from '@fluidframework/protocol-definitions';
|
|
2
|
+
import * as api_2 from '@fluidframework/driver-definitions';
|
|
3
|
+
import { IClient } from '@fluidframework/protocol-definitions';
|
|
4
|
+
import { IDocumentService } from '@fluidframework/driver-definitions';
|
|
5
|
+
import { IDocumentServiceFactory } from '@fluidframework/driver-definitions';
|
|
6
|
+
import { IDocumentStorageService } from '@fluidframework/driver-definitions';
|
|
7
|
+
import { IResolvedUrl } from '@fluidframework/driver-definitions';
|
|
8
|
+
import { ISnapshotTree } from '@fluidframework/protocol-definitions';
|
|
9
|
+
import { ISummaryContext } from '@fluidframework/driver-definitions';
|
|
10
|
+
import { ISummaryTree } from '@fluidframework/protocol-definitions';
|
|
11
|
+
import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
|
|
12
|
+
import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
|
|
13
|
+
import { ITree } from '@fluidframework/protocol-definitions';
|
|
14
|
+
import { IVersion } from '@fluidframework/protocol-definitions';
|
|
15
|
+
|
|
16
|
+
/* Excluded from this release type: FileSnapshotReader */
|
|
17
|
+
|
|
18
|
+
/* Excluded from this release type: IDocumentService */
|
|
19
|
+
|
|
20
|
+
/* Excluded from this release type: IDocumentServiceFactory */
|
|
21
|
+
|
|
22
|
+
/* Excluded from this release type: IDocumentStorageService */
|
|
23
|
+
|
|
24
|
+
/* Excluded from this release type: IFileSnapshot */
|
|
25
|
+
|
|
26
|
+
/* Excluded from this release type: IResolvedUrl */
|
|
27
|
+
|
|
28
|
+
/* Excluded from this release type: ISummaryContext */
|
|
29
|
+
|
|
30
|
+
/* Excluded from this release type: ITelemetryBaseLogger */
|
|
31
|
+
|
|
32
|
+
/* Excluded from this release type: ITelemetryLoggerExt */
|
|
33
|
+
|
|
34
|
+
/* Excluded from this release type: OpStorage */
|
|
35
|
+
|
|
36
|
+
/* Excluded from this release type: ReadDocumentStorageServiceBase */
|
|
37
|
+
|
|
38
|
+
/* Excluded from this release type: ReplayController */
|
|
39
|
+
|
|
40
|
+
/* Excluded from this release type: ReplayDocumentService */
|
|
41
|
+
|
|
42
|
+
/* Excluded from this release type: ReplayDocumentServiceFactory */
|
|
43
|
+
|
|
44
|
+
/* Excluded from this release type: SnapshotStorage */
|
|
45
|
+
|
|
46
|
+
/* Excluded from this release type: StaticStorageDocumentServiceFactory */
|
|
47
|
+
|
|
48
|
+
export { }
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import * as api from '@fluidframework/protocol-definitions';
|
|
2
|
+
import * as api_2 from '@fluidframework/driver-definitions';
|
|
3
|
+
import { IClient } from '@fluidframework/protocol-definitions';
|
|
4
|
+
import { IDocumentService } from '@fluidframework/driver-definitions';
|
|
5
|
+
import { IDocumentServiceFactory } from '@fluidframework/driver-definitions';
|
|
6
|
+
import { IDocumentStorageService } from '@fluidframework/driver-definitions';
|
|
7
|
+
import { IResolvedUrl } from '@fluidframework/driver-definitions';
|
|
8
|
+
import { ISnapshotTree } from '@fluidframework/protocol-definitions';
|
|
9
|
+
import { ISummaryContext } from '@fluidframework/driver-definitions';
|
|
10
|
+
import { ISummaryTree } from '@fluidframework/protocol-definitions';
|
|
11
|
+
import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
|
|
12
|
+
import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
|
|
13
|
+
import { ITree } from '@fluidframework/protocol-definitions';
|
|
14
|
+
import { IVersion } from '@fluidframework/protocol-definitions';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
export declare class FileSnapshotReader extends ReadDocumentStorageServiceBase implements IDocumentStorageService {
|
|
20
|
+
protected static readonly FileStorageVersionTreeId = "FileStorageTreeId";
|
|
21
|
+
protected docId?: string;
|
|
22
|
+
protected docTree: ISnapshotTree;
|
|
23
|
+
protected blobs: Map<string, ArrayBufferLike>;
|
|
24
|
+
protected readonly commits: {
|
|
25
|
+
[key: string]: ITree;
|
|
26
|
+
};
|
|
27
|
+
protected readonly trees: {
|
|
28
|
+
[key: string]: ISnapshotTree;
|
|
29
|
+
};
|
|
30
|
+
constructor(json: IFileSnapshot);
|
|
31
|
+
getVersions(versionId: string | null, count: number): Promise<IVersion[]>;
|
|
32
|
+
getSnapshotTree(versionRequested?: IVersion): Promise<ISnapshotTree | null>;
|
|
33
|
+
readBlob(blobId: string): Promise<ArrayBufferLike>;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Structure of snapshot on disk, when we store snapshot as single file
|
|
38
|
+
* @internal
|
|
39
|
+
*/
|
|
40
|
+
export declare interface IFileSnapshot {
|
|
41
|
+
tree: ITree;
|
|
42
|
+
commits: {
|
|
43
|
+
[key: string]: ITree;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @internal
|
|
49
|
+
*/
|
|
50
|
+
export declare class OpStorage extends ReadDocumentStorageServiceBase {
|
|
51
|
+
getVersions(versionId: string | null, count: number): Promise<IVersion[]>;
|
|
52
|
+
getSnapshotTree(version?: IVersion): Promise<ISnapshotTree | null>;
|
|
53
|
+
readBlob(blobId: string): Promise<ArrayBufferLike>;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Partial implementation of IDocumentStorageService
|
|
58
|
+
* @internal
|
|
59
|
+
*/
|
|
60
|
+
export declare abstract class ReadDocumentStorageServiceBase implements IDocumentStorageService {
|
|
61
|
+
abstract getVersions(versionId: string | null, count: number): Promise<api.IVersion[]>;
|
|
62
|
+
abstract getSnapshotTree(version?: api.IVersion): Promise<api.ISnapshotTree | null>;
|
|
63
|
+
abstract readBlob(blobId: string): Promise<ArrayBufferLike>;
|
|
64
|
+
uploadSummaryWithContext(summary: api.ISummaryTree, context: ISummaryContext): Promise<string>;
|
|
65
|
+
createBlob(file: ArrayBufferLike): Promise<api.ICreateBlobResponse>;
|
|
66
|
+
downloadSummary(handle: api.ISummaryHandle): Promise<api.ISummaryTree>;
|
|
67
|
+
get repositoryUrl(): string;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Replay controller object
|
|
72
|
+
* It controls where we start (snapshot, local file, no snapshots)
|
|
73
|
+
* As well as dispatch of ops
|
|
74
|
+
* @internal
|
|
75
|
+
*/
|
|
76
|
+
export declare abstract class ReplayController extends ReadDocumentStorageServiceBase {
|
|
77
|
+
/**
|
|
78
|
+
* Initialize reply controller
|
|
79
|
+
* @param documentService - the real document service
|
|
80
|
+
* @returns Whether or not the controller should be used.
|
|
81
|
+
* If `false` is returned, caller should fallback to original storage.
|
|
82
|
+
*/
|
|
83
|
+
abstract initStorage(documentService: IDocumentService): Promise<boolean>;
|
|
84
|
+
/**
|
|
85
|
+
* Returns sequence number to start processing ops
|
|
86
|
+
* Should be zero if not using snapshot, and snapshot seq# otherwise
|
|
87
|
+
*/
|
|
88
|
+
abstract getStartingOpSequence(): Promise<number>;
|
|
89
|
+
/**
|
|
90
|
+
* Returns last op number to fetch from current op
|
|
91
|
+
* Note: this API is called while replay() is in progress - next batch of ops is downloaded in parallel
|
|
92
|
+
* @param currentOp - current op
|
|
93
|
+
*/
|
|
94
|
+
abstract fetchTo(currentOp: number): number | undefined;
|
|
95
|
+
/**
|
|
96
|
+
* Returns true if no more ops should be processed (or downloaded for future processing).
|
|
97
|
+
* It's called at end of each batch with latest op timestamp.
|
|
98
|
+
* Also it's called when there are no more ops available (lastTimeStamp === undefined).
|
|
99
|
+
* If false is returned and there are no more ops, request for more ops is made every 2 seconds.
|
|
100
|
+
* Note: this API is called while replay() is in progress - next batch of ops is downloaded in parallel
|
|
101
|
+
* @param currentOp - current op
|
|
102
|
+
* @param lastTimeStamp - timestamp of last op (if more ops are available). Undefined otherwise.
|
|
103
|
+
*/
|
|
104
|
+
abstract isDoneFetch(currentOp: number, lastTimeStamp?: number): boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Replay batch of ops
|
|
107
|
+
* NOTE: new batch of ops is fetched (fetchTo() & isDoneFetch() APIs are called) while this call is in flights
|
|
108
|
+
* @param emitter - callback to emit ops
|
|
109
|
+
* @param fetchedOps - ops to process
|
|
110
|
+
*/
|
|
111
|
+
abstract replay(emitter: (op: api.ISequencedDocumentMessage[]) => void, fetchedOps: api.ISequencedDocumentMessage[]): Promise<void>;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* The Replay document service dummies out the snapshot and the delta storage.
|
|
116
|
+
* Delta connection simulates the socket by fetching the ops from delta storage
|
|
117
|
+
* and emitting them with a pre determined delay
|
|
118
|
+
* @internal
|
|
119
|
+
*/
|
|
120
|
+
export declare class ReplayDocumentService implements api_2.IDocumentService {
|
|
121
|
+
private readonly controller;
|
|
122
|
+
private readonly deltaStorage;
|
|
123
|
+
static create(documentService: api_2.IDocumentService, controller: ReplayController): Promise<api_2.IDocumentService>;
|
|
124
|
+
constructor(controller: api_2.IDocumentStorageService, deltaStorage: api_2.IDocumentDeltaConnection);
|
|
125
|
+
dispose(): void;
|
|
126
|
+
get resolvedUrl(): api_2.IResolvedUrl;
|
|
127
|
+
/**
|
|
128
|
+
* Connects to a storage endpoint for snapshot service and blobs.
|
|
129
|
+
* @returns returns the dummy document storage service for replay driver.
|
|
130
|
+
*/
|
|
131
|
+
connectToStorage(): Promise<api_2.IDocumentStorageService>;
|
|
132
|
+
/**
|
|
133
|
+
* Connects to a delta storage endpoint for getting ops between a range.
|
|
134
|
+
* @returns returns the dummy document delta storage service for replay driver.
|
|
135
|
+
*/
|
|
136
|
+
connectToDeltaStorage(): Promise<api_2.IDocumentDeltaStorageService>;
|
|
137
|
+
/**
|
|
138
|
+
* Connects to a delta storage endpoint of provided documentService to get ops and then replaying
|
|
139
|
+
* them so as to mimic a delta stream endpoint.
|
|
140
|
+
* @param client - Client that connects to socket.
|
|
141
|
+
* @returns returns the delta stream service which replay ops from --from to --to arguments.
|
|
142
|
+
*/
|
|
143
|
+
connectToDeltaStream(client: IClient): Promise<api_2.IDocumentDeltaConnection>;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* @internal
|
|
148
|
+
*/
|
|
149
|
+
export declare class ReplayDocumentServiceFactory implements IDocumentServiceFactory {
|
|
150
|
+
private readonly documentServiceFactory;
|
|
151
|
+
private readonly controller;
|
|
152
|
+
static create(from: number, to: number, documentServiceFactory: IDocumentServiceFactory): ReplayDocumentServiceFactory;
|
|
153
|
+
constructor(documentServiceFactory: IDocumentServiceFactory, controller: ReplayController);
|
|
154
|
+
/**
|
|
155
|
+
* Creates a replay document service which uses the document service of provided
|
|
156
|
+
* documentServiceFactory for connecting to delta stream endpoint.
|
|
157
|
+
* @param resolvedUrl - URL to be used for connecting to endpoints.
|
|
158
|
+
* @returns returns the requested document service
|
|
159
|
+
*/
|
|
160
|
+
createDocumentService(resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
|
|
161
|
+
createContainer(createNewSummary: ISummaryTree, resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* @internal
|
|
166
|
+
*/
|
|
167
|
+
export declare class SnapshotStorage extends ReadDocumentStorageServiceBase {
|
|
168
|
+
protected readonly storage: IDocumentStorageService;
|
|
169
|
+
protected readonly docTree: ISnapshotTree | null;
|
|
170
|
+
protected docId?: string;
|
|
171
|
+
constructor(storage: IDocumentStorageService, docTree: ISnapshotTree | null);
|
|
172
|
+
getVersions(versionId: string | null, count: number): Promise<IVersion[]>;
|
|
173
|
+
getSnapshotTree(versionRequested?: IVersion): Promise<ISnapshotTree | null>;
|
|
174
|
+
readBlob(blobId: string): Promise<ArrayBufferLike>;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* @internal
|
|
179
|
+
*/
|
|
180
|
+
export declare class StaticStorageDocumentServiceFactory implements IDocumentServiceFactory {
|
|
181
|
+
protected readonly storage: IDocumentStorageService;
|
|
182
|
+
constructor(storage: IDocumentStorageService);
|
|
183
|
+
createDocumentService(fileURL: IResolvedUrl, logger?: ITelemetryLoggerExt, clientIsSummarizer?: boolean): Promise<IDocumentService>;
|
|
184
|
+
createContainer(createNewSummary: ISummaryTree, resolvedUrl: IResolvedUrl, logger: ITelemetryLoggerExt, clientIsSummarizer?: boolean): Promise<IDocumentService>;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export { }
|
|
@@ -6,6 +6,7 @@ import { IDocumentService, IDocumentStorageService, ISummaryContext } from "@flu
|
|
|
6
6
|
import * as api from "@fluidframework/protocol-definitions";
|
|
7
7
|
/**
|
|
8
8
|
* Partial implementation of IDocumentStorageService
|
|
9
|
+
* @internal
|
|
9
10
|
*/
|
|
10
11
|
export declare abstract class ReadDocumentStorageServiceBase implements IDocumentStorageService {
|
|
11
12
|
abstract getVersions(versionId: string | null, count: number): Promise<api.IVersion[]>;
|
|
@@ -20,6 +21,7 @@ export declare abstract class ReadDocumentStorageServiceBase implements IDocumen
|
|
|
20
21
|
* Replay controller object
|
|
21
22
|
* It controls where we start (snapshot, local file, no snapshots)
|
|
22
23
|
* As well as dispatch of ops
|
|
24
|
+
* @internal
|
|
23
25
|
*/
|
|
24
26
|
export declare abstract class ReplayController extends ReadDocumentStorageServiceBase {
|
|
25
27
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replayController.d.ts","sourceRoot":"","sources":["../src/replayController.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"replayController.d.ts","sourceRoot":"","sources":["../src/replayController.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EACN,gBAAgB,EAChB,uBAAuB,EACvB,eAAe,EACf,MAAM,oCAAoC;OACpC,KAAK,GAAG,MAAM,sCAAsC;AAE3D;;;GAGG;AACH,8BAAsB,8BAA+B,YAAW,uBAAuB;aACtE,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;aAC7E,eAAe,CA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