@fluidframework/replay-driver 2.0.0-internal.4.3.0 → 2.0.0-internal.5.0.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/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/storageImplementations.d.ts +5 -5
- package/dist/storageImplementations.d.ts.map +1 -1
- package/dist/storageImplementations.js +3 -6
- package/dist/storageImplementations.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/storageImplementations.d.ts +5 -5
- package/lib/storageImplementations.d.ts.map +1 -1
- package/lib/storageImplementations.js +3 -6
- package/lib/storageImplementations.js.map +1 -1
- package/lib/test/types/validateReplayDriverPrevious.generated.js +3 -3
- package/lib/test/types/validateReplayDriverPrevious.generated.js.map +1 -1
- package/package.json +13 -5
- package/src/index.ts +0 -1
- package/src/storageImplementations.ts +8 -10
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
export { ReadDocumentStorageServiceBase, ReplayController } from "./replayController";
|
|
6
6
|
export { ReplayDocumentService } from "./replayDocumentService";
|
|
7
7
|
export { ReplayDocumentServiceFactory } from "./replayDocumentServiceFactory";
|
|
8
|
-
export { FileSnapshotReader, IFileSnapshot, OpStorage, SnapshotStorage,
|
|
8
|
+
export { FileSnapshotReader, IFileSnapshot, OpStorage, SnapshotStorage, StaticStorageDocumentServiceFactory, } from "./storageImplementations";
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
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,8BAA8B,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtF,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EACN,kBAAkB,EAClB,aAAa,EACb,SAAS,EACT,eAAe,EACf,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,8BAA8B,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtF,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EACN,kBAAkB,EAClB,aAAa,EACb,SAAS,EACT,eAAe,EACf,mCAAmC,GACnC,MAAM,0BAA0B,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.StaticStorageDocumentServiceFactory = exports.
|
|
7
|
+
exports.StaticStorageDocumentServiceFactory = exports.SnapshotStorage = exports.OpStorage = exports.FileSnapshotReader = exports.ReplayDocumentServiceFactory = exports.ReplayDocumentService = exports.ReplayController = exports.ReadDocumentStorageServiceBase = void 0;
|
|
8
8
|
var replayController_1 = require("./replayController");
|
|
9
9
|
Object.defineProperty(exports, "ReadDocumentStorageServiceBase", { enumerable: true, get: function () { return replayController_1.ReadDocumentStorageServiceBase; } });
|
|
10
10
|
Object.defineProperty(exports, "ReplayController", { enumerable: true, get: function () { return replayController_1.ReplayController; } });
|
|
@@ -16,6 +16,5 @@ var storageImplementations_1 = require("./storageImplementations");
|
|
|
16
16
|
Object.defineProperty(exports, "FileSnapshotReader", { enumerable: true, get: function () { return storageImplementations_1.FileSnapshotReader; } });
|
|
17
17
|
Object.defineProperty(exports, "OpStorage", { enumerable: true, get: function () { return storageImplementations_1.OpStorage; } });
|
|
18
18
|
Object.defineProperty(exports, "SnapshotStorage", { enumerable: true, get: function () { return storageImplementations_1.SnapshotStorage; } });
|
|
19
|
-
Object.defineProperty(exports, "StaticStorageDocumentService", { enumerable: true, get: function () { return storageImplementations_1.StaticStorageDocumentService; } });
|
|
20
19
|
Object.defineProperty(exports, "StaticStorageDocumentServiceFactory", { enumerable: true, get: function () { return storageImplementations_1.StaticStorageDocumentServiceFactory; } });
|
|
21
20
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,uDAAsF;AAA7E,kIAAA,8BAA8B,OAAA;AAAE,oHAAA,gBAAgB,OAAA;AACzD,iEAAgE;AAAvD,8HAAA,qBAAqB,OAAA;AAC9B,+EAA8E;AAArE,4IAAA,4BAA4B,OAAA;AACrC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,uDAAsF;AAA7E,kIAAA,8BAA8B,OAAA;AAAE,oHAAA,gBAAgB,OAAA;AACzD,iEAAgE;AAAvD,8HAAA,qBAAqB,OAAA;AAC9B,+EAA8E;AAArE,4IAAA,4BAA4B,OAAA;AACrC,mEAMkC;AALjC,4HAAA,kBAAkB,OAAA;AAElB,mHAAA,SAAS,OAAA;AACT,yHAAA,eAAe,OAAA;AACf,6IAAA,mCAAmC,OAAA","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"]}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { IDocumentDeltaConnection, IDocumentDeltaStorageService, IDocumentService, IDocumentServiceFactory, IDocumentStorageService, IResolvedUrl } from "@fluidframework/driver-definitions";
|
|
6
6
|
import { IClient, ISnapshotTree, ITree, IVersion, ISummaryTree } from "@fluidframework/protocol-definitions";
|
|
7
|
-
import {
|
|
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
|
|
@@ -46,10 +46,10 @@ export declare class OpStorage extends ReadDocumentStorageServiceBase {
|
|
|
46
46
|
readBlob(blobId: string): Promise<ArrayBufferLike>;
|
|
47
47
|
}
|
|
48
48
|
export declare class StaticStorageDocumentService implements IDocumentService {
|
|
49
|
+
readonly resolvedUrl: IResolvedUrl;
|
|
49
50
|
private readonly storage;
|
|
50
|
-
constructor(storage: IDocumentStorageService);
|
|
51
|
+
constructor(resolvedUrl: IResolvedUrl, storage: IDocumentStorageService);
|
|
51
52
|
dispose(): void;
|
|
52
|
-
get resolvedUrl(): IResolvedUrl;
|
|
53
53
|
connectToStorage(): Promise<IDocumentStorageService>;
|
|
54
54
|
connectToDeltaStorage(): Promise<IDocumentDeltaStorageService>;
|
|
55
55
|
connectToDeltaStream(client: IClient): Promise<IDocumentDeltaConnection>;
|
|
@@ -57,7 +57,7 @@ export declare class StaticStorageDocumentService implements IDocumentService {
|
|
|
57
57
|
export declare class StaticStorageDocumentServiceFactory implements IDocumentServiceFactory {
|
|
58
58
|
protected readonly storage: IDocumentStorageService;
|
|
59
59
|
constructor(storage: IDocumentStorageService);
|
|
60
|
-
createDocumentService(fileURL: IResolvedUrl, logger?:
|
|
61
|
-
createContainer(createNewSummary: ISummaryTree, resolvedUrl: IResolvedUrl, logger:
|
|
60
|
+
createDocumentService(fileURL: IResolvedUrl, logger?: ITelemetryLoggerExt, clientIsSummarizer?: boolean): Promise<IDocumentService>;
|
|
61
|
+
createContainer(createNewSummary: ISummaryTree, resolvedUrl: IResolvedUrl, logger: ITelemetryLoggerExt, clientIsSummarizer?: boolean): Promise<IDocumentService>;
|
|
62
62
|
}
|
|
63
63
|
//# sourceMappingURL=storageImplementations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storageImplementations.d.ts","sourceRoot":"","sources":["../src/storageImplementations.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,wBAAwB,EACxB,4BAA4B,EAC5B,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,EACvB,YAAY,EACZ,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EACN,OAAO,EACP,aAAa,EACb,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"storageImplementations.d.ts","sourceRoot":"","sources":["../src/storageImplementations.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,wBAAwB,EACxB,4BAA4B,EAC5B,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,EACvB,YAAY,EACZ,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EACN,OAAO,EACP,aAAa,EACb,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEtE,OAAO,EAAE,8BAA8B,EAAE,MAAM,oBAAoB,CAAC;AAEpE;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B,IAAI,EAAE,KAAK,CAAC;IACZ,OAAO,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,K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umentStorageServiceBase {
|
|
|
98
98
|
}
|
|
99
99
|
exports.OpStorage = OpStorage;
|
|
100
100
|
class StaticStorageDocumentService {
|
|
101
|
-
constructor(storage) {
|
|
101
|
+
constructor(resolvedUrl, storage) {
|
|
102
|
+
this.resolvedUrl = resolvedUrl;
|
|
102
103
|
this.storage = storage;
|
|
103
104
|
}
|
|
104
105
|
dispose() { }
|
|
105
|
-
// TODO: Issue-2109 Implement detach container api or put appropriate comment.
|
|
106
|
-
get resolvedUrl() {
|
|
107
|
-
throw new Error("Not implemented");
|
|
108
|
-
}
|
|
109
106
|
async connectToStorage() {
|
|
110
107
|
return this.storage;
|
|
111
108
|
}
|
|
@@ -123,7 +120,7 @@ class StaticStorageDocumentServiceFactory {
|
|
|
123
120
|
this.storage = storage;
|
|
124
121
|
}
|
|
125
122
|
async createDocumentService(fileURL, logger, clientIsSummarizer) {
|
|
126
|
-
return new StaticStorageDocumentService(this.storage);
|
|
123
|
+
return new StaticStorageDocumentService(fileURL, this.storage);
|
|
127
124
|
}
|
|
128
125
|
// TODO: Issue-2109 Implement detach container api or put appropriate comment.
|
|
129
126
|
async createContainer(createNewSummary, resolvedUrl, logger, clientIsSummarizer) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storageImplementations.js","sourceRoot":"","sources":["../src/storageImplementations.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAsD;AAStD,+DAAiE;AASjE,yEAAsE;AACtE,yDAAoE;AAUpE,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,CA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AED,MAAa,mCAAmC;IAC/C,YAAsC,OAAgC;QAAhC,YAAO,GAAP,OAAO,CAAyB;IAAG,CAAC;IAEnE,KAAK,CAAC,qBAAqB,CACjC,OAAqB,EACrB,MAAyB,EACzB,kBAA4B;QAE5B,OAAO,IAAI,4BAA4B,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACvD,CAAC;IAED,8EAA8E;IACvE,KAAK,CAAC,eAAe,CAC3B,gBAA8B,EAC9B,WAAyB,EACzB,MAAwB,EACxB,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/common-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 { ITelemetryLogger } from \"@fluidframework/common-definitions\";\nimport { EmptyDeltaStorageService } from \"./emptyDeltaStorageService\";\nimport { ReadDocumentStorageServiceBase } from \"./replayController\";\n\n/**\n * Structure of snapshot on disk, when we store snapshot as single file\n */\nexport interface IFileSnapshot {\n\ttree: ITree;\n\tcommits: { [key: string]: ITree };\n}\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\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\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\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(private readonly storage: IDocumentStorageService) {}\n\n\tpublic dispose() {}\n\n\t// TODO: Issue-2109 Implement detach container api or put appropriate comment.\n\tpublic get resolvedUrl(): IResolvedUrl {\n\t\tthrow new Error(\"Not implemented\");\n\t}\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\nexport class StaticStorageDocumentServiceFactory implements IDocumentServiceFactory {\n\tpublic constructor(protected readonly storage: IDocumentStorageService) {}\n\n\tpublic async createDocumentService(\n\t\tfileURL: IResolvedUrl,\n\t\tlogger?: ITelemetryLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\treturn new StaticStorageDocumentService(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: ITelemetryLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\tthrow new Error(\"Not implemented\");\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"storageImplementations.js","sourceRoot":"","sources":["../src/storageImplementations.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAsD;AAStD,+DAAiE;AASjE,yEAAsE;AACtE,yDAAoE;AAUpE,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,CAAC,KAAK,CAAC,CAAC;IACjE,CAAC;IAEM,KAAK,CAAC,WAAW,CAAC,SAAwB,EAAE,KAAa;QAC/D,IAAI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,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/common-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 */\nexport interface IFileSnapshot {\n\ttree: ITree;\n\tcommits: { [key: string]: ITree };\n}\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\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\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\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\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"]}
|
package/lib/index.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
export { ReadDocumentStorageServiceBase, ReplayController } from "./replayController";
|
|
6
6
|
export { ReplayDocumentService } from "./replayDocumentService";
|
|
7
7
|
export { ReplayDocumentServiceFactory } from "./replayDocumentServiceFactory";
|
|
8
|
-
export { FileSnapshotReader, IFileSnapshot, OpStorage, SnapshotStorage,
|
|
8
|
+
export { FileSnapshotReader, IFileSnapshot, OpStorage, SnapshotStorage, StaticStorageDocumentServiceFactory, } from "./storageImplementations";
|
|
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;AAEH,OAAO,EAAE,8BAA8B,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtF,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EACN,kBAAkB,EAClB,aAAa,EACb,SAAS,EACT,eAAe,EACf,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,8BAA8B,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtF,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EACN,kBAAkB,EAClB,aAAa,EACb,SAAS,EACT,eAAe,EACf,mCAAmC,GACnC,MAAM,0BAA0B,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
export { ReadDocumentStorageServiceBase, ReplayController } from "./replayController";
|
|
6
6
|
export { ReplayDocumentService } from "./replayDocumentService";
|
|
7
7
|
export { ReplayDocumentServiceFactory } from "./replayDocumentServiceFactory";
|
|
8
|
-
export { FileSnapshotReader, OpStorage, SnapshotStorage,
|
|
8
|
+
export { FileSnapshotReader, OpStorage, SnapshotStorage, StaticStorageDocumentServiceFactory, } from "./storageImplementations";
|
|
9
9
|
//# sourceMappingURL=index.js.map
|
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,8BAA8B,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtF,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EACN,kBAAkB,EAElB,SAAS,EACT,eAAe,EACf,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,8BAA8B,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtF,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EACN,kBAAkB,EAElB,SAAS,EACT,eAAe,EACf,mCAAmC,GACnC,MAAM,0BAA0B,CAAC","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"]}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { IDocumentDeltaConnection, IDocumentDeltaStorageService, IDocumentService, IDocumentServiceFactory, IDocumentStorageService, IResolvedUrl } from "@fluidframework/driver-definitions";
|
|
6
6
|
import { IClient, ISnapshotTree, ITree, IVersion, ISummaryTree } from "@fluidframework/protocol-definitions";
|
|
7
|
-
import {
|
|
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
|
|
@@ -46,10 +46,10 @@ export declare class OpStorage extends ReadDocumentStorageServiceBase {
|
|
|
46
46
|
readBlob(blobId: string): Promise<ArrayBufferLike>;
|
|
47
47
|
}
|
|
48
48
|
export declare class StaticStorageDocumentService implements IDocumentService {
|
|
49
|
+
readonly resolvedUrl: IResolvedUrl;
|
|
49
50
|
private readonly storage;
|
|
50
|
-
constructor(storage: IDocumentStorageService);
|
|
51
|
+
constructor(resolvedUrl: IResolvedUrl, storage: IDocumentStorageService);
|
|
51
52
|
dispose(): void;
|
|
52
|
-
get resolvedUrl(): IResolvedUrl;
|
|
53
53
|
connectToStorage(): Promise<IDocumentStorageService>;
|
|
54
54
|
connectToDeltaStorage(): Promise<IDocumentDeltaStorageService>;
|
|
55
55
|
connectToDeltaStream(client: IClient): Promise<IDocumentDeltaConnection>;
|
|
@@ -57,7 +57,7 @@ export declare class StaticStorageDocumentService implements IDocumentService {
|
|
|
57
57
|
export declare class StaticStorageDocumentServiceFactory implements IDocumentServiceFactory {
|
|
58
58
|
protected readonly storage: IDocumentStorageService;
|
|
59
59
|
constructor(storage: IDocumentStorageService);
|
|
60
|
-
createDocumentService(fileURL: IResolvedUrl, logger?:
|
|
61
|
-
createContainer(createNewSummary: ISummaryTree, resolvedUrl: IResolvedUrl, logger:
|
|
60
|
+
createDocumentService(fileURL: IResolvedUrl, logger?: ITelemetryLoggerExt, clientIsSummarizer?: boolean): Promise<IDocumentService>;
|
|
61
|
+
createContainer(createNewSummary: ISummaryTree, resolvedUrl: IResolvedUrl, logger: ITelemetryLoggerExt, clientIsSummarizer?: boolean): Promise<IDocumentService>;
|
|
62
62
|
}
|
|
63
63
|
//# sourceMappingURL=storageImplementations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storageImplementations.d.ts","sourceRoot":"","sources":["../src/storageImplementations.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,wBAAwB,EACxB,4BAA4B,EAC5B,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,EACvB,YAAY,EACZ,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EACN,OAAO,EACP,aAAa,EACb,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"storageImplementations.d.ts","sourceRoot":"","sources":["../src/storageImplementations.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,wBAAwB,EACxB,4BAA4B,EAC5B,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,EACvB,YAAY,EACZ,MAAM,oCAAoC,CAAC;AAE5C,OA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Y,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"}
|
|
@@ -92,14 +92,11 @@ export class OpStorage extends ReadDocumentStorageServiceBase {
|
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
export class StaticStorageDocumentService {
|
|
95
|
-
constructor(storage) {
|
|
95
|
+
constructor(resolvedUrl, storage) {
|
|
96
|
+
this.resolvedUrl = resolvedUrl;
|
|
96
97
|
this.storage = storage;
|
|
97
98
|
}
|
|
98
99
|
dispose() { }
|
|
99
|
-
// TODO: Issue-2109 Implement detach container api or put appropriate comment.
|
|
100
|
-
get resolvedUrl() {
|
|
101
|
-
throw new Error("Not implemented");
|
|
102
|
-
}
|
|
103
100
|
async connectToStorage() {
|
|
104
101
|
return this.storage;
|
|
105
102
|
}
|
|
@@ -116,7 +113,7 @@ export class StaticStorageDocumentServiceFactory {
|
|
|
116
113
|
this.storage = storage;
|
|
117
114
|
}
|
|
118
115
|
async createDocumentService(fileURL, logger, clientIsSummarizer) {
|
|
119
|
-
return new StaticStorageDocumentService(this.storage);
|
|
116
|
+
return new StaticStorageDocumentService(fileURL, this.storage);
|
|
120
117
|
}
|
|
121
118
|
// TODO: Issue-2109 Implement detach container api or put appropriate comment.
|
|
122
119
|
async createContainer(createNewSummary, resolvedUrl, logger, clientIsSummarizer) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storageImplementations.js","sourceRoot":"","sources":["../src/storageImplementations.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAStD,OAAO,EAAE,iBAAiB,E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;IAEnB,8EAA8E;IAC9E,IAAW,WAAW;QACrB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACpC,CAAC;IAEM,KAAK,CAAC,gBAAgB;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC;IAEM,KAAK,CAAC,qBAAqB;QACjC,OAAO,IAAI,wBAAwB,EAAE,CAAC;IACvC,CAAC;IAEM,KAAK,CAAC,oBAAoB,CAAC,MAAe;QAChD,4DAA4D;QAC5D,OAAO,IAAI,OAAO,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAC9B,CAAC;CACD;AAED,MAAM,OAAO,mCAAmC;IAC/C,YAAsC,OAAgC;QAAhC,YAAO,GAAP,OAAO,CAAyB;IAAG,CAAC;IAEnE,KAAK,CAAC,qBAAqB,CACjC,OAAqB,EACrB,MAAyB,EACzB,kBAA4B;QAE5B,OAAO,IAAI,4BAA4B,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACvD,CAAC;IAED,8EAA8E;IACvE,KAAK,CAAC,eAAe,CAC3B,gBAA8B,EAC9B,WAAyB,EACzB,MAAwB,EACxB,kBAA4B;QAE5B,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACpC,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/common-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 { ITelemetryLogger } from \"@fluidframework/common-definitions\";\nimport { EmptyDeltaStorageService } from \"./emptyDeltaStorageService\";\nimport { ReadDocumentStorageServiceBase } from \"./replayController\";\n\n/**\n * Structure of snapshot on disk, when we store snapshot as single file\n */\nexport interface IFileSnapshot {\n\ttree: ITree;\n\tcommits: { [key: string]: ITree };\n}\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\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\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\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(private readonly storage: IDocumentStorageService) {}\n\n\tpublic dispose() {}\n\n\t// TODO: Issue-2109 Implement detach container api or put appropriate comment.\n\tpublic get resolvedUrl(): IResolvedUrl {\n\t\tthrow new Error(\"Not implemented\");\n\t}\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\nexport class StaticStorageDocumentServiceFactory implements IDocumentServiceFactory {\n\tpublic constructor(protected readonly storage: IDocumentStorageService) {}\n\n\tpublic async createDocumentService(\n\t\tfileURL: IResolvedUrl,\n\t\tlogger?: ITelemetryLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\treturn new StaticStorageDocumentService(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: ITelemetryLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\tthrow new Error(\"Not implemented\");\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"storageImplementations.js","sourceRoot":"","sources":["../src/storageImplementations.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAStD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AASjE,OAAO,EAAE,wB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EZ,KAAK,CAAC,gBAAgB;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC;IAEM,KAAK,CAAC,qBAAqB;QACjC,OAAO,IAAI,wBAAwB,EAAE,CAAC;IACvC,CAAC;IAEM,KAAK,CAAC,oBAAoB,CAAC,MAAe;QAChD,4DAA4D;QAC5D,OAAO,IAAI,OAAO,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAC9B,CAAC;CACD;AAED,MAAM,OAAO,mCAAmC;IAC/C,YAAsC,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","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/common-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 */\nexport interface IFileSnapshot {\n\ttree: ITree;\n\tcommits: { [key: string]: ITree };\n}\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\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\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\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\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,14 +8,14 @@ use_current_ClassDeclaration_ReadDocumentStorageServiceBase(get_old_ClassDeclara
|
|
|
8
8
|
use_old_ClassDeclaration_ReadDocumentStorageServiceBase(get_current_ClassDeclaration_ReadDocumentStorageServiceBase());
|
|
9
9
|
use_current_ClassDeclaration_ReplayController(get_old_ClassDeclaration_ReplayController());
|
|
10
10
|
use_old_ClassDeclaration_ReplayController(get_current_ClassDeclaration_ReplayController());
|
|
11
|
-
use_current_ClassDeclaration_ReplayDocumentService(
|
|
11
|
+
use_current_ClassDeclaration_ReplayDocumentService(
|
|
12
|
+
// @ts-expect-error compatibility expected to be broken
|
|
13
|
+
get_old_ClassDeclaration_ReplayDocumentService());
|
|
12
14
|
use_old_ClassDeclaration_ReplayDocumentService(get_current_ClassDeclaration_ReplayDocumentService());
|
|
13
15
|
use_current_ClassDeclaration_ReplayDocumentServiceFactory(get_old_ClassDeclaration_ReplayDocumentServiceFactory());
|
|
14
16
|
use_old_ClassDeclaration_ReplayDocumentServiceFactory(get_current_ClassDeclaration_ReplayDocumentServiceFactory());
|
|
15
17
|
use_current_ClassDeclaration_SnapshotStorage(get_old_ClassDeclaration_SnapshotStorage());
|
|
16
18
|
use_old_ClassDeclaration_SnapshotStorage(get_current_ClassDeclaration_SnapshotStorage());
|
|
17
|
-
use_current_ClassDeclaration_StaticStorageDocumentService(get_old_ClassDeclaration_StaticStorageDocumentService());
|
|
18
|
-
use_old_ClassDeclaration_StaticStorageDocumentService(get_current_ClassDeclaration_StaticStorageDocumentService());
|
|
19
19
|
use_current_ClassDeclaration_StaticStorageDocumentServiceFactory(get_old_ClassDeclaration_StaticStorageDocumentServiceFactory());
|
|
20
20
|
use_old_ClassDeclaration_StaticStorageDocumentServiceFactory(get_current_ClassDeclaration_StaticStorageDocumentServiceFactory());
|
|
21
21
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validateReplayDriverPrevious.generated.js","sourceRoot":"","sources":["../../../src/test/types/validateReplayDriverPrevious.generated.ts"],"names":[],"mappings":"AAwBA,+CAA+C,CAC3C,2CAA2C,EAAE,CAAC,CAAC;AAWnD,2CAA2C,CACvC,+CAA+C,EAAE,CAAC,CAAC;AAWvD,8CAA8C,CAC1C,0CAA0C,EAAE,CAAC,CAAC;AAWlD,0CAA0C,CACtC,8CAA8C,EAAE,CAAC,CAAC;AAWtD,sCAAsC,CAClC,kCAAkC,EAAE,CAAC,CAAC;AAW1C,kCAAkC,CAC9B,sCAAsC,EAAE,CAAC,CAAC;AAW9C,2DAA2D,CACvD,uDAAuD,EAAE,CAAC,CAAC;AAW/D,uDAAuD,CACnD,2DAA2D,EAAE,CAAC,CAAC;AAWnE,6CAA6C,CACzC,yCAAyC,EAAE,CAAC,CAAC;AAWjD,yCAAyC,CACrC,6CAA6C,EAAE,CAAC,CAAC;AAWrD,kDAAkD,CAC9C,8CAA8C,EAAE,CAAC,CAAC;AAWtD,8CAA8C,CAC1C,kDAAkD,EAAE,CAAC,CAAC;AAW1D,yDAAyD,CACrD,qDAAqD,EAAE,CAAC,CAAC;AAW7D,qDAAqD,CACjD,yDAAyD,EAAE,CAAC,CAAC;AAWjE,4CAA4C,CACxC,wCAAwC,EAAE,CAAC,CAAC;AAWhD,wCAAwC,CACpC,4CAA4C,EAAE,CAAC,CAAC;AAWpD,yDAAyD,CACrD,qDAAqD,EAAE,CAAC,CAAC;AAW7D,qDAAqD,CACjD,yDAAyD,EAAE,CAAC,CAAC;AAWjE,gEAAgE,CAC5D,4DAA4D,EAAE,CAAC,CAAC;AAWpE,4DAA4D,CACxD,gEAAgE,EAAE,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/*\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.\n * Generated by fluid-type-test-generator in @fluidframework/build-tools.\n */\nimport * as old from \"@fluidframework/replay-driver-previous\";\nimport * as current from \"../../index\";\n\ntype TypeOnly<T> = {\n [P in keyof T]: TypeOnly<T[P]>;\n};\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_FileSnapshotReader\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_FileSnapshotReader():\n TypeOnly<old.FileSnapshotReader>;\ndeclare function use_current_ClassDeclaration_FileSnapshotReader(\n use: TypeOnly<current.FileSnapshotReader>);\nuse_current_ClassDeclaration_FileSnapshotReader(\n get_old_ClassDeclaration_FileSnapshotReader());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_FileSnapshotReader\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_FileSnapshotReader():\n TypeOnly<current.FileSnapshotReader>;\ndeclare function use_old_ClassDeclaration_FileSnapshotReader(\n use: TypeOnly<old.FileSnapshotReader>);\nuse_old_ClassDeclaration_FileSnapshotReader(\n get_current_ClassDeclaration_FileSnapshotReader());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"InterfaceDeclaration_IFileSnapshot\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_InterfaceDeclaration_IFileSnapshot():\n TypeOnly<old.IFileSnapshot>;\ndeclare function use_current_InterfaceDeclaration_IFileSnapshot(\n use: TypeOnly<current.IFileSnapshot>);\nuse_current_InterfaceDeclaration_IFileSnapshot(\n get_old_InterfaceDeclaration_IFileSnapshot());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"InterfaceDeclaration_IFileSnapshot\": {\"backCompat\": false}\n*/\ndeclare function get_current_InterfaceDeclaration_IFileSnapshot():\n TypeOnly<current.IFileSnapshot>;\ndeclare function use_old_InterfaceDeclaration_IFileSnapshot(\n use: TypeOnly<old.IFileSnapshot>);\nuse_old_InterfaceDeclaration_IFileSnapshot(\n get_current_InterfaceDeclaration_IFileSnapshot());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_OpStorage\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_OpStorage():\n TypeOnly<old.OpStorage>;\ndeclare function use_current_ClassDeclaration_OpStorage(\n use: TypeOnly<current.OpStorage>);\nuse_current_ClassDeclaration_OpStorage(\n get_old_ClassDeclaration_OpStorage());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_OpStorage\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_OpStorage():\n TypeOnly<current.OpStorage>;\ndeclare function use_old_ClassDeclaration_OpStorage(\n use: TypeOnly<old.OpStorage>);\nuse_old_ClassDeclaration_OpStorage(\n get_current_ClassDeclaration_OpStorage());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_ReadDocumentStorageServiceBase\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_ReadDocumentStorageServiceBase():\n TypeOnly<old.ReadDocumentStorageServiceBase>;\ndeclare function use_current_ClassDeclaration_ReadDocumentStorageServiceBase(\n use: TypeOnly<current.ReadDocumentStorageServiceBase>);\nuse_current_ClassDeclaration_ReadDocumentStorageServiceBase(\n get_old_ClassDeclaration_ReadDocumentStorageServiceBase());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_ReadDocumentStorageServiceBase\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_ReadDocumentStorageServiceBase():\n TypeOnly<current.ReadDocumentStorageServiceBase>;\ndeclare function use_old_ClassDeclaration_ReadDocumentStorageServiceBase(\n use: TypeOnly<old.ReadDocumentStorageServiceBase>);\nuse_old_ClassDeclaration_ReadDocumentStorageServiceBase(\n get_current_ClassDeclaration_ReadDocumentStorageServiceBase());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_ReplayController\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_ReplayController():\n TypeOnly<old.ReplayController>;\ndeclare function use_current_ClassDeclaration_ReplayController(\n use: TypeOnly<current.ReplayController>);\nuse_current_ClassDeclaration_ReplayController(\n get_old_ClassDeclaration_ReplayController());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_ReplayController\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_ReplayController():\n TypeOnly<current.ReplayController>;\ndeclare function use_old_ClassDeclaration_ReplayController(\n use: TypeOnly<old.ReplayController>);\nuse_old_ClassDeclaration_ReplayController(\n get_current_ClassDeclaration_ReplayController());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_ReplayDocumentService\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_ReplayDocumentService():\n TypeOnly<old.ReplayDocumentService>;\ndeclare function use_current_ClassDeclaration_ReplayDocumentService(\n use: TypeOnly<current.ReplayDocumentService>);\nuse_current_ClassDeclaration_ReplayDocumentService(\n get_old_ClassDeclaration_ReplayDocumentService());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_ReplayDocumentService\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_ReplayDocumentService():\n TypeOnly<current.ReplayDocumentService>;\ndeclare function use_old_ClassDeclaration_ReplayDocumentService(\n use: TypeOnly<old.ReplayDocumentService>);\nuse_old_ClassDeclaration_ReplayDocumentService(\n get_current_ClassDeclaration_ReplayDocumentService());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_ReplayDocumentServiceFactory\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_ReplayDocumentServiceFactory():\n TypeOnly<old.ReplayDocumentServiceFactory>;\ndeclare function use_current_ClassDeclaration_ReplayDocumentServiceFactory(\n use: TypeOnly<current.ReplayDocumentServiceFactory>);\nuse_current_ClassDeclaration_ReplayDocumentServiceFactory(\n get_old_ClassDeclaration_ReplayDocumentServiceFactory());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_ReplayDocumentServiceFactory\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_ReplayDocumentServiceFactory():\n TypeOnly<current.ReplayDocumentServiceFactory>;\ndeclare function use_old_ClassDeclaration_ReplayDocumentServiceFactory(\n use: TypeOnly<old.ReplayDocumentServiceFactory>);\nuse_old_ClassDeclaration_ReplayDocumentServiceFactory(\n get_current_ClassDeclaration_ReplayDocumentServiceFactory());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_SnapshotStorage\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_SnapshotStorage():\n TypeOnly<old.SnapshotStorage>;\ndeclare function use_current_ClassDeclaration_SnapshotStorage(\n use: TypeOnly<current.SnapshotStorage>);\nuse_current_ClassDeclaration_SnapshotStorage(\n get_old_ClassDeclaration_SnapshotStorage());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_SnapshotStorage\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_SnapshotStorage():\n TypeOnly<current.SnapshotStorage>;\ndeclare function use_old_ClassDeclaration_SnapshotStorage(\n use: TypeOnly<old.SnapshotStorage>);\nuse_old_ClassDeclaration_SnapshotStorage(\n get_current_ClassDeclaration_SnapshotStorage());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_StaticStorageDocumentService\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_StaticStorageDocumentService():\n TypeOnly<old.StaticStorageDocumentService>;\ndeclare function use_current_ClassDeclaration_StaticStorageDocumentService(\n use: TypeOnly<current.StaticStorageDocumentService>);\nuse_current_ClassDeclaration_StaticStorageDocumentService(\n get_old_ClassDeclaration_StaticStorageDocumentService());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_StaticStorageDocumentService\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_StaticStorageDocumentService():\n TypeOnly<current.StaticStorageDocumentService>;\ndeclare function use_old_ClassDeclaration_StaticStorageDocumentService(\n use: TypeOnly<old.StaticStorageDocumentService>);\nuse_old_ClassDeclaration_StaticStorageDocumentService(\n get_current_ClassDeclaration_StaticStorageDocumentService());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_StaticStorageDocumentServiceFactory\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_StaticStorageDocumentServiceFactory():\n TypeOnly<old.StaticStorageDocumentServiceFactory>;\ndeclare function use_current_ClassDeclaration_StaticStorageDocumentServiceFactory(\n use: TypeOnly<current.StaticStorageDocumentServiceFactory>);\nuse_current_ClassDeclaration_StaticStorageDocumentServiceFactory(\n get_old_ClassDeclaration_StaticStorageDocumentServiceFactory());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_StaticStorageDocumentServiceFactory\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_StaticStorageDocumentServiceFactory():\n TypeOnly<current.StaticStorageDocumentServiceFactory>;\ndeclare function use_old_ClassDeclaration_StaticStorageDocumentServiceFactory(\n use: TypeOnly<old.StaticStorageDocumentServiceFactory>);\nuse_old_ClassDeclaration_StaticStorageDocumentServiceFactory(\n get_current_ClassDeclaration_StaticStorageDocumentServiceFactory());\n"]}
|
|
1
|
+
{"version":3,"file":"validateReplayDriverPrevious.generated.js","sourceRoot":"","sources":["../../../src/test/types/validateReplayDriverPrevious.generated.ts"],"names":[],"mappings":"AAwBA,+CAA+C,CAC3C,2CAA2C,EAAE,CAAC,CAAC;AAWnD,2CAA2C,CACvC,+CAA+C,EAAE,CAAC,CAAC;AAWvD,8CAA8C,CAC1C,0CAA0C,EAAE,CAAC,CAAC;AAWlD,0CAA0C,CACtC,8CAA8C,EAAE,CAAC,CAAC;AAWtD,sCAAsC,CAClC,kCAAkC,EAAE,CAAC,CAAC;AAW1C,kCAAkC,CAC9B,sCAAsC,EAAE,CAAC,CAAC;AAW9C,2DAA2D,CACvD,uDAAuD,EAAE,CAAC,CAAC;AAW/D,uDAAuD,CACnD,2DAA2D,EAAE,CAAC,CAAC;AAWnE,6CAA6C,CACzC,yCAAyC,EAAE,CAAC,CAAC;AAWjD,yCAAyC,CACrC,6CAA6C,EAAE,CAAC,CAAC;AAWrD,kDAAkD;AAC9C,uDAAuD;AACvD,8CAA8C,EAAE,CAAC,CAAC;AAWtD,8CAA8C,CAC1C,kDAAkD,EAAE,CAAC,CAAC;AAW1D,yDAAyD,CACrD,qDAAqD,EAAE,CAAC,CAAC;AAW7D,qDAAqD,CACjD,yDAAyD,EAAE,CAAC,CAAC;AAWjE,4CAA4C,CACxC,wCAAwC,EAAE,CAAC,CAAC;AAWhD,wCAAwC,CACpC,4CAA4C,EAAE,CAAC,CAAC;AAuBpD,gEAAgE,CAC5D,4DAA4D,EAAE,CAAC,CAAC;AAWpE,4DAA4D,CACxD,gEAAgE,EAAE,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/*\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.\n * Generated by fluid-type-test-generator in @fluidframework/build-tools.\n */\nimport * as old from \"@fluidframework/replay-driver-previous\";\nimport * as current from \"../../index\";\n\ntype TypeOnly<T> = {\n [P in keyof T]: TypeOnly<T[P]>;\n};\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_FileSnapshotReader\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_FileSnapshotReader():\n TypeOnly<old.FileSnapshotReader>;\ndeclare function use_current_ClassDeclaration_FileSnapshotReader(\n use: TypeOnly<current.FileSnapshotReader>);\nuse_current_ClassDeclaration_FileSnapshotReader(\n get_old_ClassDeclaration_FileSnapshotReader());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_FileSnapshotReader\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_FileSnapshotReader():\n TypeOnly<current.FileSnapshotReader>;\ndeclare function use_old_ClassDeclaration_FileSnapshotReader(\n use: TypeOnly<old.FileSnapshotReader>);\nuse_old_ClassDeclaration_FileSnapshotReader(\n get_current_ClassDeclaration_FileSnapshotReader());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"InterfaceDeclaration_IFileSnapshot\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_InterfaceDeclaration_IFileSnapshot():\n TypeOnly<old.IFileSnapshot>;\ndeclare function use_current_InterfaceDeclaration_IFileSnapshot(\n use: TypeOnly<current.IFileSnapshot>);\nuse_current_InterfaceDeclaration_IFileSnapshot(\n get_old_InterfaceDeclaration_IFileSnapshot());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"InterfaceDeclaration_IFileSnapshot\": {\"backCompat\": false}\n*/\ndeclare function get_current_InterfaceDeclaration_IFileSnapshot():\n TypeOnly<current.IFileSnapshot>;\ndeclare function use_old_InterfaceDeclaration_IFileSnapshot(\n use: TypeOnly<old.IFileSnapshot>);\nuse_old_InterfaceDeclaration_IFileSnapshot(\n get_current_InterfaceDeclaration_IFileSnapshot());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_OpStorage\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_OpStorage():\n TypeOnly<old.OpStorage>;\ndeclare function use_current_ClassDeclaration_OpStorage(\n use: TypeOnly<current.OpStorage>);\nuse_current_ClassDeclaration_OpStorage(\n get_old_ClassDeclaration_OpStorage());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_OpStorage\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_OpStorage():\n TypeOnly<current.OpStorage>;\ndeclare function use_old_ClassDeclaration_OpStorage(\n use: TypeOnly<old.OpStorage>);\nuse_old_ClassDeclaration_OpStorage(\n get_current_ClassDeclaration_OpStorage());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_ReadDocumentStorageServiceBase\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_ReadDocumentStorageServiceBase():\n TypeOnly<old.ReadDocumentStorageServiceBase>;\ndeclare function use_current_ClassDeclaration_ReadDocumentStorageServiceBase(\n use: TypeOnly<current.ReadDocumentStorageServiceBase>);\nuse_current_ClassDeclaration_ReadDocumentStorageServiceBase(\n get_old_ClassDeclaration_ReadDocumentStorageServiceBase());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_ReadDocumentStorageServiceBase\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_ReadDocumentStorageServiceBase():\n TypeOnly<current.ReadDocumentStorageServiceBase>;\ndeclare function use_old_ClassDeclaration_ReadDocumentStorageServiceBase(\n use: TypeOnly<old.ReadDocumentStorageServiceBase>);\nuse_old_ClassDeclaration_ReadDocumentStorageServiceBase(\n get_current_ClassDeclaration_ReadDocumentStorageServiceBase());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_ReplayController\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_ReplayController():\n TypeOnly<old.ReplayController>;\ndeclare function use_current_ClassDeclaration_ReplayController(\n use: TypeOnly<current.ReplayController>);\nuse_current_ClassDeclaration_ReplayController(\n get_old_ClassDeclaration_ReplayController());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_ReplayController\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_ReplayController():\n TypeOnly<current.ReplayController>;\ndeclare function use_old_ClassDeclaration_ReplayController(\n use: TypeOnly<old.ReplayController>);\nuse_old_ClassDeclaration_ReplayController(\n get_current_ClassDeclaration_ReplayController());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_ReplayDocumentService\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_ReplayDocumentService():\n TypeOnly<old.ReplayDocumentService>;\ndeclare function use_current_ClassDeclaration_ReplayDocumentService(\n use: TypeOnly<current.ReplayDocumentService>);\nuse_current_ClassDeclaration_ReplayDocumentService(\n // @ts-expect-error compatibility expected to be broken\n get_old_ClassDeclaration_ReplayDocumentService());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_ReplayDocumentService\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_ReplayDocumentService():\n TypeOnly<current.ReplayDocumentService>;\ndeclare function use_old_ClassDeclaration_ReplayDocumentService(\n use: TypeOnly<old.ReplayDocumentService>);\nuse_old_ClassDeclaration_ReplayDocumentService(\n get_current_ClassDeclaration_ReplayDocumentService());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_ReplayDocumentServiceFactory\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_ReplayDocumentServiceFactory():\n TypeOnly<old.ReplayDocumentServiceFactory>;\ndeclare function use_current_ClassDeclaration_ReplayDocumentServiceFactory(\n use: TypeOnly<current.ReplayDocumentServiceFactory>);\nuse_current_ClassDeclaration_ReplayDocumentServiceFactory(\n get_old_ClassDeclaration_ReplayDocumentServiceFactory());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_ReplayDocumentServiceFactory\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_ReplayDocumentServiceFactory():\n TypeOnly<current.ReplayDocumentServiceFactory>;\ndeclare function use_old_ClassDeclaration_ReplayDocumentServiceFactory(\n use: TypeOnly<old.ReplayDocumentServiceFactory>);\nuse_old_ClassDeclaration_ReplayDocumentServiceFactory(\n get_current_ClassDeclaration_ReplayDocumentServiceFactory());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_SnapshotStorage\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_SnapshotStorage():\n TypeOnly<old.SnapshotStorage>;\ndeclare function use_current_ClassDeclaration_SnapshotStorage(\n use: TypeOnly<current.SnapshotStorage>);\nuse_current_ClassDeclaration_SnapshotStorage(\n get_old_ClassDeclaration_SnapshotStorage());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_SnapshotStorage\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_SnapshotStorage():\n TypeOnly<current.SnapshotStorage>;\ndeclare function use_old_ClassDeclaration_SnapshotStorage(\n use: TypeOnly<old.SnapshotStorage>);\nuse_old_ClassDeclaration_SnapshotStorage(\n get_current_ClassDeclaration_SnapshotStorage());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"RemovedClassDeclaration_StaticStorageDocumentService\": {\"forwardCompat\": false}\n*/\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"RemovedClassDeclaration_StaticStorageDocumentService\": {\"backCompat\": false}\n*/\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_StaticStorageDocumentServiceFactory\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_StaticStorageDocumentServiceFactory():\n TypeOnly<old.StaticStorageDocumentServiceFactory>;\ndeclare function use_current_ClassDeclaration_StaticStorageDocumentServiceFactory(\n use: TypeOnly<current.StaticStorageDocumentServiceFactory>);\nuse_current_ClassDeclaration_StaticStorageDocumentServiceFactory(\n get_old_ClassDeclaration_StaticStorageDocumentServiceFactory());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_StaticStorageDocumentServiceFactory\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_StaticStorageDocumentServiceFactory():\n TypeOnly<current.StaticStorageDocumentServiceFactory>;\ndeclare function use_old_ClassDeclaration_StaticStorageDocumentServiceFactory(\n use: TypeOnly<old.StaticStorageDocumentServiceFactory>);\nuse_old_ClassDeclaration_StaticStorageDocumentServiceFactory(\n get_current_ClassDeclaration_StaticStorageDocumentServiceFactory());\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/replay-driver",
|
|
3
|
-
"version": "2.0.0-internal.
|
|
3
|
+
"version": "2.0.0-internal.5.0.0",
|
|
4
4
|
"description": "Document replay version of Socket.IO implementation",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@fluidframework/common-definitions": "^0.20.1",
|
|
19
19
|
"@fluidframework/common-utils": "^1.1.1",
|
|
20
|
-
"@fluidframework/driver-definitions": ">=2.0.0-internal.
|
|
21
|
-
"@fluidframework/driver-utils": ">=2.0.0-internal.
|
|
20
|
+
"@fluidframework/driver-definitions": ">=2.0.0-internal.5.0.0 <2.0.0-internal.5.1.0",
|
|
21
|
+
"@fluidframework/driver-utils": ">=2.0.0-internal.5.0.0 <2.0.0-internal.5.1.0",
|
|
22
22
|
"@fluidframework/protocol-definitions": "^1.1.0",
|
|
23
|
-
"@fluidframework/telemetry-utils": ">=2.0.0-internal.
|
|
23
|
+
"@fluidframework/telemetry-utils": ">=2.0.0-internal.5.0.0 <2.0.0-internal.5.1.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@fluid-tools/build-cli": "^0.17.0",
|
|
@@ -42,7 +42,15 @@
|
|
|
42
42
|
"typescript": "~4.5.5"
|
|
43
43
|
},
|
|
44
44
|
"typeValidation": {
|
|
45
|
-
"broken": {
|
|
45
|
+
"broken": {
|
|
46
|
+
"ClassDeclaration_ReplayDocumentService": {
|
|
47
|
+
"forwardCompat": false
|
|
48
|
+
},
|
|
49
|
+
"RemovedClassDeclaration_StaticStorageDocumentService": {
|
|
50
|
+
"forwardCompat": false,
|
|
51
|
+
"backCompat": false
|
|
52
|
+
}
|
|
53
|
+
}
|
|
46
54
|
},
|
|
47
55
|
"scripts": {
|
|
48
56
|
"build": "concurrently npm:build:compile npm:lint && npm run build:docs",
|
package/src/index.ts
CHANGED
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
IVersion,
|
|
21
21
|
ISummaryTree,
|
|
22
22
|
} from "@fluidframework/protocol-definitions";
|
|
23
|
-
import {
|
|
23
|
+
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
|
|
24
24
|
import { EmptyDeltaStorageService } from "./emptyDeltaStorageService";
|
|
25
25
|
import { ReadDocumentStorageServiceBase } from "./replayController";
|
|
26
26
|
|
|
@@ -148,15 +148,13 @@ export class OpStorage extends ReadDocumentStorageServiceBase {
|
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
export class StaticStorageDocumentService implements IDocumentService {
|
|
151
|
-
constructor(
|
|
151
|
+
constructor(
|
|
152
|
+
public readonly resolvedUrl: IResolvedUrl,
|
|
153
|
+
private readonly storage: IDocumentStorageService,
|
|
154
|
+
) {}
|
|
152
155
|
|
|
153
156
|
public dispose() {}
|
|
154
157
|
|
|
155
|
-
// TODO: Issue-2109 Implement detach container api or put appropriate comment.
|
|
156
|
-
public get resolvedUrl(): IResolvedUrl {
|
|
157
|
-
throw new Error("Not implemented");
|
|
158
|
-
}
|
|
159
|
-
|
|
160
158
|
public async connectToStorage(): Promise<IDocumentStorageService> {
|
|
161
159
|
return this.storage;
|
|
162
160
|
}
|
|
@@ -176,17 +174,17 @@ export class StaticStorageDocumentServiceFactory implements IDocumentServiceFact
|
|
|
176
174
|
|
|
177
175
|
public async createDocumentService(
|
|
178
176
|
fileURL: IResolvedUrl,
|
|
179
|
-
logger?:
|
|
177
|
+
logger?: ITelemetryLoggerExt,
|
|
180
178
|
clientIsSummarizer?: boolean,
|
|
181
179
|
): Promise<IDocumentService> {
|
|
182
|
-
return new StaticStorageDocumentService(this.storage);
|
|
180
|
+
return new StaticStorageDocumentService(fileURL, this.storage);
|
|
183
181
|
}
|
|
184
182
|
|
|
185
183
|
// TODO: Issue-2109 Implement detach container api or put appropriate comment.
|
|
186
184
|
public async createContainer(
|
|
187
185
|
createNewSummary: ISummaryTree,
|
|
188
186
|
resolvedUrl: IResolvedUrl,
|
|
189
|
-
logger:
|
|
187
|
+
logger: ITelemetryLoggerExt,
|
|
190
188
|
clientIsSummarizer?: boolean,
|
|
191
189
|
): Promise<IDocumentService> {
|
|
192
190
|
throw new Error("Not implemented");
|