@fluidframework/replay-driver 2.0.0-internal.3.0.5 → 2.0.0-internal.3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/.eslintrc.js +5 -7
  2. package/api-extractor.json +2 -2
  3. package/dist/emptyDeltaStorageService.d.ts.map +1 -1
  4. package/dist/emptyDeltaStorageService.js.map +1 -1
  5. package/dist/packageVersion.d.ts +1 -1
  6. package/dist/packageVersion.js +1 -1
  7. package/dist/packageVersion.js.map +1 -1
  8. package/dist/replayController.d.ts.map +1 -1
  9. package/dist/replayController.js.map +1 -1
  10. package/dist/replayDocumentDeltaConnection.d.ts.map +1 -1
  11. package/dist/replayDocumentDeltaConnection.js +12 -9
  12. package/dist/replayDocumentDeltaConnection.js.map +1 -1
  13. package/dist/replayDocumentService.d.ts.map +1 -1
  14. package/dist/replayDocumentService.js.map +1 -1
  15. package/dist/replayDocumentServiceFactory.d.ts.map +1 -1
  16. package/dist/replayDocumentServiceFactory.js.map +1 -1
  17. package/dist/storageImplementations.d.ts.map +1 -1
  18. package/dist/storageImplementations.js.map +1 -1
  19. package/lib/emptyDeltaStorageService.d.ts.map +1 -1
  20. package/lib/emptyDeltaStorageService.js.map +1 -1
  21. package/lib/packageVersion.d.ts +1 -1
  22. package/lib/packageVersion.js +1 -1
  23. package/lib/packageVersion.js.map +1 -1
  24. package/lib/replayController.d.ts.map +1 -1
  25. package/lib/replayController.js.map +1 -1
  26. package/lib/replayDocumentDeltaConnection.d.ts.map +1 -1
  27. package/lib/replayDocumentDeltaConnection.js +12 -9
  28. package/lib/replayDocumentDeltaConnection.js.map +1 -1
  29. package/lib/replayDocumentService.d.ts.map +1 -1
  30. package/lib/replayDocumentService.js.map +1 -1
  31. package/lib/replayDocumentServiceFactory.d.ts.map +1 -1
  32. package/lib/replayDocumentServiceFactory.js.map +1 -1
  33. package/lib/storageImplementations.d.ts.map +1 -1
  34. package/lib/storageImplementations.js.map +1 -1
  35. package/package.json +71 -70
  36. package/prettier.config.cjs +1 -1
  37. package/src/emptyDeltaStorageService.ts +14 -13
  38. package/src/packageVersion.ts +1 -1
  39. package/src/replayController.ts +59 -55
  40. package/src/replayDocumentDeltaConnection.ts +323 -310
  41. package/src/replayDocumentService.ts +46 -44
  42. package/src/replayDocumentServiceFactory.ts +58 -44
  43. package/src/storageImplementations.ts +154 -150
  44. package/tsconfig.esnext.json +6 -6
  45. package/tsconfig.json +8 -13
@@ -16,55 +16,57 @@ import { ReplayDocumentDeltaConnection } from "./replayDocumentDeltaConnection";
16
16
  */
17
17
  // eslint-disable-next-line import/namespace
18
18
  export class ReplayDocumentService implements api.IDocumentService {
19
- public static async create(
20
- documentService: api.IDocumentService,
21
- controller: ReplayController): Promise<api.IDocumentService> {
22
- const useController = await controller.initStorage(documentService);
23
- if (!useController) {
24
- return documentService;
25
- }
19
+ public static async create(
20
+ documentService: api.IDocumentService,
21
+ controller: ReplayController,
22
+ ): Promise<api.IDocumentService> {
23
+ const useController = await controller.initStorage(documentService);
24
+ if (!useController) {
25
+ return documentService;
26
+ }
26
27
 
27
- const deltaConnection = ReplayDocumentDeltaConnection.create(
28
- await documentService.connectToDeltaStorage(),
29
- controller);
30
- return new ReplayDocumentService(controller, deltaConnection);
31
- }
28
+ const deltaConnection = ReplayDocumentDeltaConnection.create(
29
+ await documentService.connectToDeltaStorage(),
30
+ controller,
31
+ );
32
+ return new ReplayDocumentService(controller, deltaConnection);
33
+ }
32
34
 
33
- constructor(
34
- private readonly controller: api.IDocumentStorageService,
35
- private readonly deltaStorage: api.IDocumentDeltaConnection) {
36
- }
35
+ constructor(
36
+ private readonly controller: api.IDocumentStorageService,
37
+ private readonly deltaStorage: api.IDocumentDeltaConnection,
38
+ ) {}
37
39
 
38
- public dispose() {}
40
+ public dispose() {}
39
41
 
40
- // TODO: Issue-2109 Implement detach container api or put appropriate comment.
41
- public get resolvedUrl(): api.IResolvedUrl {
42
- throw new Error("Not implemented");
43
- }
42
+ // TODO: Issue-2109 Implement detach container api or put appropriate comment.
43
+ public get resolvedUrl(): api.IResolvedUrl {
44
+ throw new Error("Not implemented");
45
+ }
44
46
 
45
- /**
46
- * Connects to a storage endpoint for snapshot service and blobs.
47
- * @returns returns the dummy document storage service for replay driver.
48
- */
49
- public async connectToStorage(): Promise<api.IDocumentStorageService> {
50
- return this.controller;
51
- }
47
+ /**
48
+ * Connects to a storage endpoint for snapshot service and blobs.
49
+ * @returns returns the dummy document storage service for replay driver.
50
+ */
51
+ public async connectToStorage(): Promise<api.IDocumentStorageService> {
52
+ return this.controller;
53
+ }
52
54
 
53
- /**
54
- * Connects to a delta storage endpoint for getting ops between a range.
55
- * @returns returns the dummy document delta storage service for replay driver.
56
- */
57
- public async connectToDeltaStorage(): Promise<api.IDocumentDeltaStorageService> {
58
- return new EmptyDeltaStorageService();
59
- }
55
+ /**
56
+ * Connects to a delta storage endpoint for getting ops between a range.
57
+ * @returns returns the dummy document delta storage service for replay driver.
58
+ */
59
+ public async connectToDeltaStorage(): Promise<api.IDocumentDeltaStorageService> {
60
+ return new EmptyDeltaStorageService();
61
+ }
60
62
 
61
- /**
62
- * Connects to a delta storage endpoint of provided documentService to get ops and then replaying
63
- * them so as to mimic a delta stream endpoint.
64
- * @param client - Client that connects to socket.
65
- * @returns returns the delta stream service which replay ops from --from to --to arguments.
66
- */
67
- public async connectToDeltaStream(client: IClient): Promise<api.IDocumentDeltaConnection> {
68
- return this.deltaStorage;
69
- }
63
+ /**
64
+ * Connects to a delta storage endpoint of provided documentService to get ops and then replaying
65
+ * them so as to mimic a delta stream endpoint.
66
+ * @param client - Client that connects to socket.
67
+ * @returns returns the delta stream service which replay ops from --from to --to arguments.
68
+ */
69
+ public async connectToDeltaStream(client: IClient): Promise<api.IDocumentDeltaConnection> {
70
+ return this.deltaStorage;
71
+ }
70
72
  }
@@ -3,7 +3,11 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { IDocumentService, IDocumentServiceFactory, IResolvedUrl } from "@fluidframework/driver-definitions";
6
+ import {
7
+ IDocumentService,
8
+ IDocumentServiceFactory,
9
+ IResolvedUrl,
10
+ } from "@fluidframework/driver-definitions";
7
11
  import { ISummaryTree } from "@fluidframework/protocol-definitions";
8
12
  import { ITelemetryBaseLogger } from "@fluidframework/common-definitions";
9
13
  import { ChildLogger } from "@fluidframework/telemetry-utils";
@@ -12,52 +16,62 @@ import { ReplayControllerStatic } from "./replayDocumentDeltaConnection";
12
16
  import { ReplayDocumentService } from "./replayDocumentService";
13
17
 
14
18
  export class ReplayDocumentServiceFactory implements IDocumentServiceFactory {
15
- public static create(
16
- from: number,
17
- to: number,
18
- documentServiceFactory: IDocumentServiceFactory) {
19
- return new ReplayDocumentServiceFactory(
20
- documentServiceFactory,
21
- new ReplayControllerStatic(from, to),
22
- );
23
- }
19
+ public static create(
20
+ from: number,
21
+ to: number,
22
+ documentServiceFactory: IDocumentServiceFactory,
23
+ ) {
24
+ return new ReplayDocumentServiceFactory(
25
+ documentServiceFactory,
26
+ new ReplayControllerStatic(from, to),
27
+ );
28
+ }
24
29
 
25
- public readonly protocolName;
30
+ public readonly protocolName;
26
31
 
27
- public constructor(
28
- private readonly documentServiceFactory: IDocumentServiceFactory,
29
- private readonly controller: ReplayController) {
30
- this.protocolName = documentServiceFactory.protocolName;
31
- }
32
+ public constructor(
33
+ private readonly documentServiceFactory: IDocumentServiceFactory,
34
+ private readonly controller: ReplayController,
35
+ ) {
36
+ this.protocolName = documentServiceFactory.protocolName;
37
+ }
32
38
 
33
- /**
34
- * Creates a replay document service which uses the document service of provided
35
- * documentServiceFactory for connecting to delta stream endpoint.
36
- * @param resolvedUrl - URL to be used for connecting to endpoints.
37
- * @returns returns the requested document service
38
- */
39
- public async createDocumentService(
40
- resolvedUrl: IResolvedUrl,
41
- logger?: ITelemetryBaseLogger,
42
- clientIsSummarizer?: boolean,
43
- ): Promise<IDocumentService> {
44
- // Always include isReplay: true on events for the Replay Driver.
45
- // It's used in testing/debugging scenarios, so we want to be able to filter these events out sometimes.
46
- const replayLogger = ChildLogger.create(
47
- logger, undefined /* namespace */, { all: { isReplay: true } } /* properties */);
39
+ /**
40
+ * Creates a replay document service which uses the document service of provided
41
+ * documentServiceFactory for connecting to delta stream endpoint.
42
+ * @param resolvedUrl - URL to be used for connecting to endpoints.
43
+ * @returns returns the requested document service
44
+ */
45
+ public async createDocumentService(
46
+ resolvedUrl: IResolvedUrl,
47
+ logger?: ITelemetryBaseLogger,
48
+ clientIsSummarizer?: boolean,
49
+ ): Promise<IDocumentService> {
50
+ // Always include isReplay: true on events for the Replay Driver.
51
+ // It's used in testing/debugging scenarios, so we want to be able to filter these events out sometimes.
52
+ const replayLogger = ChildLogger.create(
53
+ logger,
54
+ undefined /* namespace */,
55
+ { all: { isReplay: true } } /* properties */,
56
+ );
48
57
 
49
- return ReplayDocumentService.create(
50
- await this.documentServiceFactory.createDocumentService(resolvedUrl, replayLogger, clientIsSummarizer),
51
- this.controller);
52
- }
58
+ return ReplayDocumentService.create(
59
+ await this.documentServiceFactory.createDocumentService(
60
+ resolvedUrl,
61
+ replayLogger,
62
+ clientIsSummarizer,
63
+ ),
64
+ this.controller,
65
+ );
66
+ }
53
67
 
54
- // TODO: Issue-2109 Implement detach container api or put appropriate comment.
55
- public async createContainer(
56
- createNewSummary: ISummaryTree,
57
- resolvedUrl: IResolvedUrl,
58
- logger?: ITelemetryBaseLogger,
59
- clientIsSummarizer?: boolean,
60
- ): Promise<IDocumentService> {
61
- throw new Error("Not implemented");
62
- }
68
+ // TODO: Issue-2109 Implement detach container api or put appropriate comment.
69
+ public async createContainer(
70
+ createNewSummary: ISummaryTree,
71
+ resolvedUrl: IResolvedUrl,
72
+ logger?: ITelemetryBaseLogger,
73
+ clientIsSummarizer?: boolean,
74
+ ): Promise<IDocumentService> {
75
+ throw new Error("Not implemented");
76
+ }
63
77
  }
@@ -5,20 +5,20 @@
5
5
 
6
6
  import { assert } from "@fluidframework/common-utils";
7
7
  import {
8
- IDocumentDeltaConnection,
9
- IDocumentDeltaStorageService,
10
- IDocumentService,
11
- IDocumentServiceFactory,
12
- IDocumentStorageService,
13
- IResolvedUrl,
8
+ IDocumentDeltaConnection,
9
+ IDocumentDeltaStorageService,
10
+ IDocumentService,
11
+ IDocumentServiceFactory,
12
+ IDocumentStorageService,
13
+ IResolvedUrl,
14
14
  } from "@fluidframework/driver-definitions";
15
15
  import { buildSnapshotTree } from "@fluidframework/driver-utils";
16
16
  import {
17
- IClient,
18
- ISnapshotTree,
19
- ITree,
20
- IVersion,
21
- ISummaryTree,
17
+ IClient,
18
+ ISnapshotTree,
19
+ ITree,
20
+ IVersion,
21
+ ISummaryTree,
22
22
  } from "@fluidframework/protocol-definitions";
23
23
  import { ITelemetryLogger } from "@fluidframework/common-definitions";
24
24
  import { EmptyDeltaStorageService } from "./emptyDeltaStorageService";
@@ -28,164 +28,168 @@ import { ReadDocumentStorageServiceBase } from "./replayController";
28
28
  * Structure of snapshot on disk, when we store snapshot as single file
29
29
  */
30
30
  export interface IFileSnapshot {
31
- tree: ITree;
32
- commits: { [key: string]: ITree; };
31
+ tree: ITree;
32
+ commits: { [key: string]: ITree };
33
33
  }
34
34
 
35
- export class FileSnapshotReader extends ReadDocumentStorageServiceBase implements IDocumentStorageService {
36
- // IVersion.treeId used to communicate between getVersions() & getSnapshotTree() calls to indicate IVersion is ours.
37
- protected static readonly FileStorageVersionTreeId = "FileStorageTreeId";
38
-
39
- protected docId?: string;
40
- protected docTree: ISnapshotTree;
41
- protected blobs: Map<string, ArrayBufferLike>;
42
- protected readonly commits: { [key: string]: ITree; } = {};
43
- protected readonly trees: { [key: string]: ISnapshotTree; } = {};
44
-
45
- public constructor(json: IFileSnapshot) {
46
- super();
47
- this.commits = json.commits;
48
-
49
- this.blobs = new Map<string, ArrayBufferLike>();
50
- this.docTree = buildSnapshotTree(json.tree.entries, this.blobs);
51
- }
52
-
53
- public async getVersions(
54
- versionId: string | null,
55
- count: number,
56
- ): Promise<IVersion[]> {
57
- if (this.docId === undefined || this.docId === versionId || versionId === null) {
58
- if (versionId !== null) {
59
- this.docId = versionId;
60
- }
61
- return [{ id: "latest", treeId: "" }];
62
- }
63
-
64
- if (this.commits[versionId] !== undefined) {
65
- return [{ id: versionId, treeId: FileSnapshotReader.FileStorageVersionTreeId }];
66
- }
67
- throw new Error(`Unknown version ID: ${versionId}`);
68
- }
69
-
70
- public async getSnapshotTree(versionRequested?: IVersion): Promise<ISnapshotTree | null> {
71
- if (!versionRequested || versionRequested.id === "latest") {
72
- return this.docTree;
73
- }
74
- if (versionRequested.treeId !== FileSnapshotReader.FileStorageVersionTreeId) {
75
- throw new Error(`Unknown version id: ${versionRequested}`);
76
- }
77
-
78
- let snapshotTree = this.trees[versionRequested.id];
79
- if (snapshotTree === undefined) {
80
- const tree = this.commits[versionRequested.id];
81
- if (tree === undefined) {
82
- throw new Error(`Can't find version ${versionRequested.id}`);
83
- }
84
-
85
- this.trees[versionRequested.id] = snapshotTree = buildSnapshotTree(tree.entries, this.blobs);
86
- }
87
- return snapshotTree;
88
- }
89
-
90
- public async readBlob(blobId: string): Promise<ArrayBufferLike> {
91
- const blob = this.blobs.get(blobId);
92
- if (blob !== undefined) {
93
- return blob;
94
- }
95
- throw new Error(`Unknown blob ID: ${blobId}`);
96
- }
35
+ export class FileSnapshotReader
36
+ extends ReadDocumentStorageServiceBase
37
+ implements IDocumentStorageService
38
+ {
39
+ // IVersion.treeId used to communicate between getVersions() & getSnapshotTree() calls to indicate IVersion is ours.
40
+ protected static readonly FileStorageVersionTreeId = "FileStorageTreeId";
41
+
42
+ protected docId?: string;
43
+ protected docTree: ISnapshotTree;
44
+ protected blobs: Map<string, ArrayBufferLike>;
45
+ protected readonly commits: { [key: string]: ITree } = {};
46
+ protected readonly trees: { [key: string]: ISnapshotTree } = {};
47
+
48
+ public constructor(json: IFileSnapshot) {
49
+ super();
50
+ this.commits = json.commits;
51
+
52
+ this.blobs = new Map<string, ArrayBufferLike>();
53
+ this.docTree = buildSnapshotTree(json.tree.entries, this.blobs);
54
+ }
55
+
56
+ public async getVersions(versionId: string | null, count: number): Promise<IVersion[]> {
57
+ if (this.docId === undefined || this.docId === versionId || versionId === null) {
58
+ if (versionId !== null) {
59
+ this.docId = versionId;
60
+ }
61
+ return [{ id: "latest", treeId: "" }];
62
+ }
63
+
64
+ if (this.commits[versionId] !== undefined) {
65
+ return [{ id: versionId, treeId: FileSnapshotReader.FileStorageVersionTreeId }];
66
+ }
67
+ throw new Error(`Unknown version ID: ${versionId}`);
68
+ }
69
+
70
+ public async getSnapshotTree(versionRequested?: IVersion): Promise<ISnapshotTree | null> {
71
+ if (!versionRequested || versionRequested.id === "latest") {
72
+ return this.docTree;
73
+ }
74
+ if (versionRequested.treeId !== FileSnapshotReader.FileStorageVersionTreeId) {
75
+ throw new Error(`Unknown version id: ${versionRequested}`);
76
+ }
77
+
78
+ let snapshotTree = this.trees[versionRequested.id];
79
+ if (snapshotTree === undefined) {
80
+ const tree = this.commits[versionRequested.id];
81
+ if (tree === undefined) {
82
+ throw new Error(`Can't find version ${versionRequested.id}`);
83
+ }
84
+
85
+ this.trees[versionRequested.id] = snapshotTree = buildSnapshotTree(
86
+ tree.entries,
87
+ this.blobs,
88
+ );
89
+ }
90
+ return snapshotTree;
91
+ }
92
+
93
+ public async readBlob(blobId: string): Promise<ArrayBufferLike> {
94
+ const blob = this.blobs.get(blobId);
95
+ if (blob !== undefined) {
96
+ return blob;
97
+ }
98
+ throw new Error(`Unknown blob ID: ${blobId}`);
99
+ }
97
100
  }
98
101
 
99
102
  export class SnapshotStorage extends ReadDocumentStorageServiceBase {
100
- protected docId?: string;
101
-
102
- constructor(
103
- protected readonly storage: IDocumentStorageService,
104
- protected readonly docTree: ISnapshotTree | null) {
105
- super();
106
- assert(!!this.docTree, 0x0b0 /* "Missing document snapshot tree!" */);
107
- }
108
-
109
- public async getVersions(versionId: string | null, count: number): Promise<IVersion[]> {
110
- if (this.docId === undefined || this.docId === versionId || versionId === null) {
111
- if (versionId !== null) {
112
- this.docId = versionId;
113
- }
114
- return [{ id: "latest", treeId: "" }];
115
- }
116
- return this.storage.getVersions(versionId, count);
117
- }
118
-
119
- public async getSnapshotTree(versionRequested?: IVersion): Promise<ISnapshotTree | null> {
120
- if (versionRequested && versionRequested.id !== "latest") {
121
- return this.storage.getSnapshotTree(versionRequested);
122
- }
123
-
124
- return this.docTree;
125
- }
126
-
127
- public async readBlob(blobId: string): Promise<ArrayBufferLike> {
128
- return this.storage.readBlob(blobId);
129
- }
103
+ protected docId?: string;
104
+
105
+ constructor(
106
+ protected readonly storage: IDocumentStorageService,
107
+ protected readonly docTree: ISnapshotTree | null,
108
+ ) {
109
+ super();
110
+ assert(!!this.docTree, 0x0b0 /* "Missing document snapshot tree!" */);
111
+ }
112
+
113
+ public async getVersions(versionId: string | null, count: number): Promise<IVersion[]> {
114
+ if (this.docId === undefined || this.docId === versionId || versionId === null) {
115
+ if (versionId !== null) {
116
+ this.docId = versionId;
117
+ }
118
+ return [{ id: "latest", treeId: "" }];
119
+ }
120
+ return this.storage.getVersions(versionId, count);
121
+ }
122
+
123
+ public async getSnapshotTree(versionRequested?: IVersion): Promise<ISnapshotTree | null> {
124
+ if (versionRequested && versionRequested.id !== "latest") {
125
+ return this.storage.getSnapshotTree(versionRequested);
126
+ }
127
+
128
+ return this.docTree;
129
+ }
130
+
131
+ public async readBlob(blobId: string): Promise<ArrayBufferLike> {
132
+ return this.storage.readBlob(blobId);
133
+ }
130
134
  }
131
135
 
132
136
  export class OpStorage extends ReadDocumentStorageServiceBase {
133
- public async getVersions(versionId: string | null, count: number): Promise<IVersion[]> {
134
- return [];
135
- }
137
+ public async getVersions(versionId: string | null, count: number): Promise<IVersion[]> {
138
+ return [];
139
+ }
136
140
 
137
- public async getSnapshotTree(version?: IVersion): Promise<ISnapshotTree | null> {
138
- throw new Error("no snapshot tree should be asked when playing ops");
139
- }
141
+ public async getSnapshotTree(version?: IVersion): Promise<ISnapshotTree | null> {
142
+ throw new Error("no snapshot tree should be asked when playing ops");
143
+ }
140
144
 
141
- public async readBlob(blobId: string): Promise<ArrayBufferLike> {
142
- throw new Error(`Unknown blob ID: ${blobId}`);
143
- }
145
+ public async readBlob(blobId: string): Promise<ArrayBufferLike> {
146
+ throw new Error(`Unknown blob ID: ${blobId}`);
147
+ }
144
148
  }
145
149
 
146
150
  export class StaticStorageDocumentService implements IDocumentService {
147
- constructor(private readonly storage: IDocumentStorageService) { }
151
+ constructor(private readonly storage: IDocumentStorageService) {}
148
152
 
149
- public dispose() {}
153
+ public dispose() {}
150
154
 
151
- // TODO: Issue-2109 Implement detach container api or put appropriate comment.
152
- public get resolvedUrl(): IResolvedUrl {
153
- throw new Error("Not implemented");
154
- }
155
+ // TODO: Issue-2109 Implement detach container api or put appropriate comment.
156
+ public get resolvedUrl(): IResolvedUrl {
157
+ throw new Error("Not implemented");
158
+ }
155
159
 
156
- public async connectToStorage(): Promise<IDocumentStorageService> {
157
- return this.storage;
158
- }
160
+ public async connectToStorage(): Promise<IDocumentStorageService> {
161
+ return this.storage;
162
+ }
159
163
 
160
- public async connectToDeltaStorage(): Promise<IDocumentDeltaStorageService> {
161
- return new EmptyDeltaStorageService();
162
- }
164
+ public async connectToDeltaStorage(): Promise<IDocumentDeltaStorageService> {
165
+ return new EmptyDeltaStorageService();
166
+ }
163
167
 
164
- public async connectToDeltaStream(client: IClient): Promise<IDocumentDeltaConnection> {
165
- // We have no delta stream, so make it not return forever...
166
- return new Promise(() => { });
167
- }
168
+ public async connectToDeltaStream(client: IClient): Promise<IDocumentDeltaConnection> {
169
+ // We have no delta stream, so make it not return forever...
170
+ return new Promise(() => {});
171
+ }
168
172
  }
169
173
 
170
174
  export class StaticStorageDocumentServiceFactory implements IDocumentServiceFactory {
171
- public readonly protocolName = "fluid-static-storage:";
172
- public constructor(protected readonly storage: IDocumentStorageService) { }
173
-
174
- public async createDocumentService(
175
- fileURL: IResolvedUrl,
176
- logger?: ITelemetryLogger,
177
- clientIsSummarizer?: boolean,
178
- ): Promise<IDocumentService> {
179
- return new StaticStorageDocumentService(this.storage);
180
- }
181
-
182
- // TODO: Issue-2109 Implement detach container api or put appropriate comment.
183
- public async createContainer(
184
- createNewSummary: ISummaryTree,
185
- resolvedUrl: IResolvedUrl,
186
- logger: ITelemetryLogger,
187
- clientIsSummarizer?: boolean,
188
- ): Promise<IDocumentService> {
189
- throw new Error("Not implemented");
190
- }
175
+ public readonly protocolName = "fluid-static-storage:";
176
+ public constructor(protected readonly storage: IDocumentStorageService) {}
177
+
178
+ public async createDocumentService(
179
+ fileURL: IResolvedUrl,
180
+ logger?: ITelemetryLogger,
181
+ clientIsSummarizer?: boolean,
182
+ ): Promise<IDocumentService> {
183
+ return new StaticStorageDocumentService(this.storage);
184
+ }
185
+
186
+ // TODO: Issue-2109 Implement detach container api or put appropriate comment.
187
+ public async createContainer(
188
+ createNewSummary: ISummaryTree,
189
+ resolvedUrl: IResolvedUrl,
190
+ logger: ITelemetryLogger,
191
+ clientIsSummarizer?: boolean,
192
+ ): Promise<IDocumentService> {
193
+ throw new Error("Not implemented");
194
+ }
191
195
  }
@@ -1,7 +1,7 @@
1
1
  {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "outDir": "./lib",
5
- "module": "esnext"
6
- },
7
- }
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "outDir": "./lib",
5
+ "module": "esnext",
6
+ },
7
+ }
package/tsconfig.json CHANGED
@@ -1,14 +1,9 @@
1
1
  {
2
- "extends": "@fluidframework/build-common/ts-common-config.json",
3
- "exclude": [
4
- "dist",
5
- "node_modules"
6
- ],
7
- "compilerOptions": {
8
- "rootDir": "./src",
9
- "outDir": "./dist"
10
- },
11
- "include": [
12
- "src/**/*"
13
- ]
14
- }
2
+ "extends": "@fluidframework/build-common/ts-common-config.json",
3
+ "exclude": ["dist", "node_modules"],
4
+ "compilerOptions": {
5
+ "rootDir": "./src",
6
+ "outDir": "./dist",
7
+ },
8
+ "include": ["src/**/*"],
9
+ }