@fluidframework/file-driver 1.4.0-115997 → 2.0.0-dev-rc.1.0.0.224419

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/.eslintrc.js +6 -7
  2. package/CHANGELOG.md +117 -0
  3. package/README.md +39 -1
  4. package/api-extractor-lint.json +4 -0
  5. package/api-extractor.json +2 -2
  6. package/api-report/file-driver.api.md +171 -0
  7. package/dist/file-driver-alpha.d.ts +51 -0
  8. package/dist/file-driver-beta.d.ts +69 -0
  9. package/dist/file-driver-public.d.ts +69 -0
  10. package/dist/file-driver-untrimmed.d.ts +209 -0
  11. package/dist/fileDeltaStorageService.d.ts +1 -0
  12. package/dist/fileDeltaStorageService.d.ts.map +1 -1
  13. package/dist/fileDeltaStorageService.js +3 -2
  14. package/dist/fileDeltaStorageService.js.map +1 -1
  15. package/dist/fileDocumentDeltaConnection.d.ts +6 -2
  16. package/dist/fileDocumentDeltaConnection.d.ts.map +1 -1
  17. package/dist/fileDocumentDeltaConnection.js +19 -18
  18. package/dist/fileDocumentDeltaConnection.js.map +1 -1
  19. package/dist/fileDocumentService.d.ts +2 -2
  20. package/dist/fileDocumentService.d.ts.map +1 -1
  21. package/dist/fileDocumentService.js +3 -5
  22. package/dist/fileDocumentService.js.map +1 -1
  23. package/dist/fileDocumentServiceFactory.d.ts +3 -3
  24. package/dist/fileDocumentServiceFactory.d.ts.map +1 -1
  25. package/dist/fileDocumentServiceFactory.js +3 -3
  26. package/dist/fileDocumentServiceFactory.js.map +1 -1
  27. package/dist/fileDocumentStorageService.d.ts +19 -3
  28. package/dist/fileDocumentStorageService.d.ts.map +1 -1
  29. package/dist/fileDocumentStorageService.js +31 -10
  30. package/dist/fileDocumentStorageService.js.map +1 -1
  31. package/dist/index.d.ts +4 -5
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +13 -15
  34. package/dist/index.js.map +1 -1
  35. package/dist/tsdoc-metadata.json +11 -0
  36. package/lib/file-driver-alpha.d.ts +51 -0
  37. package/lib/file-driver-beta.d.ts +69 -0
  38. package/lib/file-driver-public.d.ts +69 -0
  39. package/lib/file-driver-untrimmed.d.ts +209 -0
  40. package/package.json +61 -42
  41. package/prettier.config.cjs +8 -0
  42. package/src/fileDeltaStorageService.ts +55 -51
  43. package/src/fileDocumentDeltaConnection.ts +192 -179
  44. package/src/fileDocumentService.ts +24 -28
  45. package/src/fileDocumentServiceFactory.ts +39 -34
  46. package/src/fileDocumentStorageService.ts +215 -179
  47. package/src/index.ts +11 -5
  48. package/tsconfig.json +12 -14
  49. package/dist/packageVersion.d.ts +0 -9
  50. package/dist/packageVersion.d.ts.map +0 -1
  51. package/dist/packageVersion.js +0 -12
  52. package/dist/packageVersion.js.map +0 -1
  53. package/src/packageVersion.ts +0 -9
@@ -0,0 +1,209 @@
1
+ import * as api from '@fluidframework/protocol-definitions';
2
+ import { ConnectionMode } from '@fluidframework/protocol-definitions';
3
+ import { IClientConfiguration } from '@fluidframework/protocol-definitions';
4
+ import { IConnected } from '@fluidframework/protocol-definitions';
5
+ import { IDisposable } from '@fluidframework/core-interfaces';
6
+ import { IDocumentDeltaConnection } from '@fluidframework/driver-definitions';
7
+ import { IDocumentDeltaConnectionEvents } from '@fluidframework/driver-definitions';
8
+ import { IDocumentDeltaStorageService } from '@fluidframework/driver-definitions';
9
+ import { IDocumentMessage } from '@fluidframework/protocol-definitions';
10
+ import { IDocumentService } from '@fluidframework/driver-definitions';
11
+ import { IDocumentServiceFactory } from '@fluidframework/driver-definitions';
12
+ import { IDocumentStorageService } from '@fluidframework/driver-definitions';
13
+ import { IDocumentStorageServicePolicies } from '@fluidframework/driver-definitions';
14
+ import { IFileSnapshot } from '@fluidframework/replay-driver';
15
+ import { IResolvedUrl } from '@fluidframework/driver-definitions';
16
+ import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
17
+ import { ISignalClient } from '@fluidframework/protocol-definitions';
18
+ import { ISignalMessage } from '@fluidframework/protocol-definitions';
19
+ import { IStream } from '@fluidframework/driver-definitions';
20
+ import { ISummaryContext } from '@fluidframework/driver-definitions';
21
+ import { ISummaryTree } from '@fluidframework/protocol-definitions';
22
+ import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
23
+ import { ITokenClaims } from '@fluidframework/protocol-definitions';
24
+ import { ReadDocumentStorageServiceBase } from '@fluidframework/replay-driver';
25
+ import { TypedEventEmitter } from '@fluid-internal/client-utils';
26
+
27
+ /**
28
+ * Provides access to the underlying delta storage on the local file storage for file driver.
29
+ * @internal
30
+ */
31
+ export declare class FileDeltaStorageService implements IDocumentDeltaStorageService {
32
+ private readonly path;
33
+ private readonly messages;
34
+ private lastOps;
35
+ constructor(path: string);
36
+ fetchMessages(from: number, to: number | undefined, abortSignal?: AbortSignal, cachedOnly?: boolean): IStream<api.ISequencedDocumentMessage[]>;
37
+ get ops(): readonly Readonly<api.ISequencedDocumentMessage>[];
38
+ /**
39
+ * Retrieve ops within the exclusive sequence number range.
40
+ *
41
+ * @param from - First op to be fetched.
42
+ * @param to - Last op to be fetched. This is exclusive.
43
+ */
44
+ getFromWebSocket(from: number, to: number): api.ISequencedDocumentMessage[];
45
+ }
46
+
47
+ /**
48
+ * Factory for creating the file document service. Use this if you want to
49
+ * use the local file storage as underlying storage.
50
+ * @internal
51
+ */
52
+ export declare class FileDocumentServiceFactory implements IDocumentServiceFactory {
53
+ private readonly storage;
54
+ private readonly deltaStorage;
55
+ private readonly deltaConnection;
56
+ constructor(storage: IDocumentStorageService, deltaStorage: FileDeltaStorageService, deltaConnection: IDocumentDeltaConnection);
57
+ /**
58
+ * Creates the file document service if the path exists.
59
+ *
60
+ * @param fileURL - Path of directory containing ops/snapshots.
61
+ * @returns file document service.
62
+ */
63
+ createDocumentService(resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
64
+ createContainer(createNewSummary: ISummaryTree, resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
65
+ }
66
+
67
+ /**
68
+ * @internal
69
+ */
70
+ export declare const FileSnapshotWriterClassFactory: <TBase extends ReaderConstructor>(Base: TBase) => {
71
+ new (...args: any[]): {
72
+ blobsWriter: Map<string, ArrayBufferLike>;
73
+ latestWriterTree?: api.ISnapshotTree | undefined;
74
+ docId?: string | undefined;
75
+ reset(): void;
76
+ onSnapshotHandler(snapshot: IFileSnapshot): void;
77
+ readBlob(sha: string): Promise<ArrayBufferLike>;
78
+ getVersions(versionId: string | null, count: number): Promise<api.IVersion[]>;
79
+ getSnapshotTree(version?: api.IVersion): Promise<api.ISnapshotTree | null>;
80
+ uploadSummaryWithContext(summary: api.ISummaryTree, context: ISummaryContext): Promise<string>;
81
+ buildTree(snapshotTree: api.ISnapshotTree): Promise<api.ITree>;
82
+ repositoryUrl: string;
83
+ readonly policies?: IDocumentStorageServicePolicies | undefined;
84
+ createBlob(file: ArrayBufferLike): Promise<api.ICreateBlobResponse>;
85
+ downloadSummary(handle: api.ISummaryHandle): Promise<api.ISummaryTree>;
86
+ readonly disposed?: boolean | undefined;
87
+ dispose?: ((error?: Error | undefined) => void) | undefined;
88
+ };
89
+ } & TBase;
90
+
91
+ /**
92
+ * @internal
93
+ */
94
+ export declare const FileStorageDocumentName = "FileStorageDocId";
95
+
96
+ /**
97
+ * Document storage service for the file driver.
98
+ * @internal
99
+ */
100
+ export declare class FluidFetchReader extends ReadDocumentStorageServiceBase implements IDocumentStorageService {
101
+ private readonly path;
102
+ private readonly versionName?;
103
+ protected docTree: api.ISnapshotTree | null;
104
+ constructor(path: string, versionName?: string | undefined);
105
+ /**
106
+ * Read the file and returns the snapshot tree.
107
+ * @param version - The version contains the path of the file which contains the snapshot tree.
108
+ */
109
+ getSnapshotTree(version?: api.IVersion): Promise<api.ISnapshotTree | null>;
110
+ /**
111
+ * Gets the path of the snapshot tree to be read.
112
+ * @param versionId - version ID.
113
+ * @param count - Number of versions to be returned.
114
+ */
115
+ getVersions(versionId: string | null, count: number): Promise<api.IVersion[]>;
116
+ readBlob(sha: string): Promise<ArrayBufferLike>;
117
+ }
118
+
119
+ /**
120
+ * @internal
121
+ */
122
+ export declare const FluidFetchReaderFileSnapshotWriter: {
123
+ new (...args: any[]): {
124
+ blobsWriter: Map<string, ArrayBufferLike>;
125
+ latestWriterTree?: api.ISnapshotTree | undefined;
126
+ docId?: string | undefined;
127
+ reset(): void;
128
+ onSnapshotHandler(snapshot: IFileSnapshot): void;
129
+ readBlob(sha: string): Promise<ArrayBufferLike>;
130
+ getVersions(versionId: string | null, count: number): Promise<api.IVersion[]>;
131
+ getSnapshotTree(version?: api.IVersion): Promise<api.ISnapshotTree | null>;
132
+ uploadSummaryWithContext(summary: api.ISummaryTree, context: ISummaryContext): Promise<string>;
133
+ buildTree(snapshotTree: api.ISnapshotTree): Promise<api.ITree>;
134
+ repositoryUrl: string;
135
+ readonly policies?: IDocumentStorageServicePolicies | undefined;
136
+ createBlob(file: ArrayBufferLike): Promise<api.ICreateBlobResponse>;
137
+ downloadSummary(handle: api.ISummaryHandle): Promise<api.ISummaryTree>;
138
+ readonly disposed?: boolean | undefined;
139
+ dispose?: ((error?: Error | undefined) => void) | undefined;
140
+ };
141
+ } & typeof FluidFetchReader;
142
+
143
+ /**
144
+ * @internal
145
+ */
146
+ export declare interface ISnapshotWriterStorage extends IDocumentStorageService {
147
+ onSnapshotHandler(snapshot: IFileSnapshot): void;
148
+ reset(): void;
149
+ }
150
+
151
+ /**
152
+ * @internal
153
+ */
154
+ export declare type ReaderConstructor = new (...args: any[]) => IDocumentStorageService;
155
+
156
+ /**
157
+ * Replay service used to play ops using the delta connection.
158
+ * @internal
159
+ */
160
+ export declare class Replayer {
161
+ private readonly deltaConnection;
162
+ private readonly documentStorageService;
163
+ private currentReplayOp;
164
+ constructor(deltaConnection: ReplayFileDeltaConnection, documentStorageService: FileDeltaStorageService);
165
+ get currentReplayedOp(): number;
166
+ set currentReplayedOp(op: number);
167
+ get ops(): readonly Readonly<ISequencedDocumentMessage>[];
168
+ /**
169
+ * Replay the ops upto a certain number.
170
+ * @param replayTo - The last op number to be replayed.
171
+ */
172
+ replay(replayTo: number): number;
173
+ private isDoneFetch;
174
+ private emit;
175
+ }
176
+
177
+ /**
178
+ * @internal
179
+ */
180
+ export declare class ReplayFileDeltaConnection extends TypedEventEmitter<IDocumentDeltaConnectionEvents> implements IDocumentDeltaConnection, IDisposable {
181
+ details: IConnected;
182
+ /**
183
+ * Mimic the delta connection to replay ops on it.
184
+ *
185
+ * @param documentDeltaStorageService - The delta storage service to get ops from.
186
+ * @returns Document delta connection.
187
+ */
188
+ static create(documentDeltaStorageService: FileDeltaStorageService): Promise<ReplayFileDeltaConnection>;
189
+ readonly maxMessageSize: number;
190
+ private readonly replayer;
191
+ constructor(details: IConnected, documentDeltaStorageService: FileDeltaStorageService);
192
+ getReplayer(): Replayer;
193
+ get clientId(): string;
194
+ get mode(): ConnectionMode;
195
+ get claims(): ITokenClaims;
196
+ get existing(): boolean;
197
+ get version(): string;
198
+ get initialMessages(): ISequencedDocumentMessage[];
199
+ get initialSignals(): ISignalMessage[];
200
+ get initialClients(): ISignalClient[];
201
+ get serviceConfiguration(): IClientConfiguration;
202
+ submit(documentMessages: IDocumentMessage[]): void;
203
+ submitSignal(message: any): Promise<void>;
204
+ private _disposed;
205
+ get disposed(): boolean;
206
+ dispose(): void;
207
+ }
208
+
209
+ export { }
@@ -6,6 +6,7 @@ import { IDocumentDeltaStorageService, IStream } from "@fluidframework/driver-de
6
6
  import * as api from "@fluidframework/protocol-definitions";
7
7
  /**
8
8
  * Provides access to the underlying delta storage on the local file storage for file driver.
9
+ * @internal
9
10
  */
10
11
  export declare class FileDeltaStorageService implements IDocumentDeltaStorageService {
11
12
  private readonly path;
@@ -1 +1 @@
1
- {"version":3,"file":"fileDeltaStorageService.d.ts","sourceRoot":"","sources":["../src/fileDeltaStorageService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA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O,GAClB,OAAO,CAAC,GAAG,CAAC,yBAAyB,EAAE,CAAC;IAI3C,IAAW,GAAG,IAAI,SAAS,QAAQ,CAAC,GAAG,CAAC,yBAAyB,CAAC,EAAE,CAEnE;IAED;;;;;OAKG;IACI,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,GAAG,CAAC,yBAAyB,EAAE;CAmBlF"}
@@ -9,10 +9,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.FileDeltaStorageService = void 0;
11
11
  const fs_1 = __importDefault(require("fs"));
12
- const common_utils_1 = require("@fluidframework/common-utils");
12
+ const core_utils_1 = require("@fluidframework/core-utils");
13
13
  const driver_utils_1 = require("@fluidframework/driver-utils");
14
14
  /**
15
15
  * Provides access to the underlying delta storage on the local file storage for file driver.
16
+ * @internal
16
17
  */
17
18
  class FileDeltaStorageService {
18
19
  constructor(path) {
@@ -57,7 +58,7 @@ class FileDeltaStorageService {
57
58
  return this.lastOps;
58
59
  }
59
60
  this.lastOps = this.messages.slice(readFrom, readTo);
60
- (0, common_utils_1.assert)(this.lastOps[0].sequenceNumber === readFrom + 1, 0x091 /* "Retrieved ops' first sequence number has unexpected value!" */);
61
+ (0, core_utils_1.assert)(this.lastOps[0].sequenceNumber === readFrom + 1, 0x091 /* "Retrieved ops' first sequence number has unexpected value!" */);
61
62
  return this.lastOps;
62
63
  }
63
64
  }
@@ -1 +1 @@
1
- {"version":3,"file":"fileDeltaStorageService.js","sourceRoot":"","sources":["../src/fileDeltaStorageService.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAEH,4CAAoB;AACpB,+DAAsD;AAEtD,+DAAkE;AAGlE;;GAEG;AACH,MAAa,uBAAuB;IAIhC,YAA6B,IAAY;QAAZ,SAAI,GAAJ,IAAI,CAAQ;QAFjC,YAAO,GAAoC,EAAE,CAAC;QAGlD,IAAI,CAAC,QAAQ,GAAG,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b;QAED,mDAAmD;QACnD,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,cAAc,KAAK,QAAQ,GAAG,CAAC,EAAE;YAC5E,OAAO,IAAI,CAAC,OAAO,CAAC;SACvB;QACD,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QACrD,IAAA,qBAAM,EAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,cAAc,KAAK,QAAQ,GAAG,CAAC,EAClD,KAAK,CAAC,kEAAkE,CAAC,CAAC;QAC9E,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;CACJ;AAzDD,0DAyDC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport fs from \"fs\";\nimport { assert } from \"@fluidframework/common-utils\";\nimport { IDocumentDeltaStorageService, IStream } from \"@fluidframework/driver-definitions\";\nimport { emptyMessageStream } from \"@fluidframework/driver-utils\";\nimport * as api from \"@fluidframework/protocol-definitions\";\n\n/**\n * Provides access to the underlying delta storage on the local file storage for file driver.\n */\nexport class FileDeltaStorageService implements IDocumentDeltaStorageService {\n private readonly messages: api.ISequencedDocumentMessage[];\n private lastOps: api.ISequencedDocumentMessage[] = [];\n\n constructor(private readonly path: string) {\n this.messages = [];\n let counter = 0;\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const filename = `${this.path}//messages${counter === 0 ? \"\" : counter}.json`;\n if (!fs.existsSync(filename)) {\n if (counter === 0) {\n throw new Error(`file ${filename} not found`);\n }\n break;\n }\n const data = fs.readFileSync(filename);\n this.messages = this.messages.concat(JSON.parse(data.toString(\"utf-8\")));\n counter++;\n }\n }\n\n public fetchMessages(from: number,\n to: number | undefined,\n abortSignal?: AbortSignal,\n cachedOnly?: boolean,\n ): IStream<api.ISequencedDocumentMessage[]> {\n return emptyMessageStream;\n }\n\n public get ops(): readonly Readonly<api.ISequencedDocumentMessage>[] {\n return this.messages;\n }\n\n /**\n * Retrieve ops within the exclusive sequence number range.\n *\n * @param from - First op to be fetched.\n * @param to - Last op to be fetched. This is exclusive.\n */\n public getFromWebSocket(from: number, to: number): api.ISequencedDocumentMessage[] {\n const readFrom = Math.max(from, 0); // Inclusive\n const readTo = Math.min(to, this.messages.length); // Exclusive\n\n if (readFrom >= this.messages.length || readTo <= 0 || readFrom >= readTo) {\n return [];\n }\n\n // Optimizations for multiple readers (replay tool)\n if (this.lastOps.length > 0 && this.lastOps[0].sequenceNumber === readFrom + 1) {\n return this.lastOps;\n }\n this.lastOps = this.messages.slice(readFrom, readTo);\n assert(this.lastOps[0].sequenceNumber === readFrom + 1,\n 0x091 /* \"Retrieved ops' first sequence number has unexpected value!\" */);\n return this.lastOps;\n }\n}\n"]}
1
+ {"version":3,"file":"fileDeltaStorageService.js","sourceRoot":"","sources":["../src/fileDeltaStorageService.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAEH,4CAAoB;AACpB,2DAAoD;AAEpD,+DAAkE;AAGlE;;;GAGG;AACH,MAAa,uBAAuB;IAInC,YAA6B,IAAY;QAAZ,SAAI,GAAJ,IAAI,CAAQ;QAFjC,YAAO,GAAoC,EAAE,CAAC;QAGrD,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB,IAAI,OAAO,GAAG,CAAC,CAAC;QAChB,iDAAiD;QACjD,OAAO,IAAI,EAAE;YACZ,MAAM,QAAQ,GAAG,GAAG,IAAI,CAAC,IAAI,aAAa,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,OAAO,CAAC;YAC9E,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;gBAC7B,IAAI,OAAO,KAAK,CAAC,EAAE;oBAClB,MAAM,IAAI,KAAK,CAAC,QAAQ,QA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AC,cAAc,KAAK,QAAQ,GAAG,CAAC,EAC/C,KAAK,CAAC,kEAAkE,CACxE,CAAC;QACF,OAAO,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC;CACD;AA5DD,0DA4DC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport fs from \"fs\";\nimport { assert } from \"@fluidframework/core-utils\";\nimport { IDocumentDeltaStorageService, IStream } from \"@fluidframework/driver-definitions\";\nimport { emptyMessageStream } from \"@fluidframework/driver-utils\";\nimport * as api from \"@fluidframework/protocol-definitions\";\n\n/**\n * Provides access to the underlying delta storage on the local file storage for file driver.\n * @internal\n */\nexport class FileDeltaStorageService implements IDocumentDeltaStorageService {\n\tprivate readonly messages: api.ISequencedDocumentMessage[];\n\tprivate lastOps: api.ISequencedDocumentMessage[] = [];\n\n\tconstructor(private readonly path: string) {\n\t\tthis.messages = [];\n\t\tlet counter = 0;\n\t\t// eslint-disable-next-line no-constant-condition\n\t\twhile (true) {\n\t\t\tconst filename = `${this.path}//messages${counter === 0 ? \"\" : counter}.json`;\n\t\t\tif (!fs.existsSync(filename)) {\n\t\t\t\tif (counter === 0) {\n\t\t\t\t\tthrow new Error(`file ${filename} not found`);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tconst data = fs.readFileSync(filename);\n\t\t\tthis.messages = this.messages.concat(JSON.parse(data.toString(\"utf-8\")));\n\t\t\tcounter++;\n\t\t}\n\t}\n\n\tpublic fetchMessages(\n\t\tfrom: number,\n\t\tto: number | undefined,\n\t\tabortSignal?: AbortSignal,\n\t\tcachedOnly?: boolean,\n\t): IStream<api.ISequencedDocumentMessage[]> {\n\t\treturn emptyMessageStream;\n\t}\n\n\tpublic get ops(): readonly Readonly<api.ISequencedDocumentMessage>[] {\n\t\treturn this.messages;\n\t}\n\n\t/**\n\t * Retrieve ops within the exclusive sequence number range.\n\t *\n\t * @param from - First op to be fetched.\n\t * @param to - Last op to be fetched. This is exclusive.\n\t */\n\tpublic getFromWebSocket(from: number, to: number): api.ISequencedDocumentMessage[] {\n\t\tconst readFrom = Math.max(from, 0); // Inclusive\n\t\tconst readTo = Math.min(to, this.messages.length); // Exclusive\n\n\t\tif (readFrom >= this.messages.length || readTo <= 0 || readFrom >= readTo) {\n\t\t\treturn [];\n\t\t}\n\n\t\t// Optimizations for multiple readers (replay tool)\n\t\tif (this.lastOps.length > 0 && this.lastOps[0].sequenceNumber === readFrom + 1) {\n\t\t\treturn this.lastOps;\n\t\t}\n\t\tthis.lastOps = this.messages.slice(readFrom, readTo);\n\t\tassert(\n\t\t\tthis.lastOps[0].sequenceNumber === readFrom + 1,\n\t\t\t0x091 /* \"Retrieved ops' first sequence number has unexpected value!\" */,\n\t\t);\n\t\treturn this.lastOps;\n\t}\n}\n"]}
@@ -2,13 +2,14 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { IDisposable } from "@fluidframework/common-definitions";
5
+ import { IDisposable } from "@fluidframework/core-interfaces";
6
6
  import { IDocumentDeltaConnection, IDocumentDeltaConnectionEvents } from "@fluidframework/driver-definitions";
7
7
  import { ConnectionMode, IClientConfiguration, IConnected, IDocumentMessage, ISequencedDocumentMessage, ISignalClient, ISignalMessage, ITokenClaims } from "@fluidframework/protocol-definitions";
8
- import { TypedEventEmitter } from "@fluidframework/common-utils";
8
+ import { TypedEventEmitter } from "@fluid-internal/client-utils";
9
9
  import { FileDeltaStorageService } from "./fileDeltaStorageService";
10
10
  /**
11
11
  * Replay service used to play ops using the delta connection.
12
+ * @internal
12
13
  */
13
14
  export declare class Replayer {
14
15
  private readonly deltaConnection;
@@ -26,6 +27,9 @@ export declare class Replayer {
26
27
  private isDoneFetch;
27
28
  private emit;
28
29
  }
30
+ /**
31
+ * @internal
32
+ */
29
33
  export declare class ReplayFileDeltaConnection extends TypedEventEmitter<IDocumentDeltaConnectionEvents> implements IDocumentDeltaConnection, IDisposable {
30
34
  details: IConnected;
31
35
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"fileDocumentDeltaConnection.d.ts","sourceRoot":"","sources":["../src/fileDocumentDeltaConnection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,8BAA8B,EAAE,MAAM,oCAAoC,CAAC;AAC9G,OAAO,EACH,cAAc,EACd,oBAAoB,EACpB,UAAU,EACV,gBAAgB,EAChB,yBAAyB,EACzB,aAAa,EACb,cAAc,EACd,YAAY,EAEf,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAuBpE;;GAEG;AACH,qBAAa,QAAQ;IAIb,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,sBAAsB;IAJ3C,OAAO,CAAC,eAAe,CAAK;gBAGP,eAAe,EAAE,yBAAyB,EAC1C,sBAAsB,EAAE,uBAAuB;IAGpE,IAAW,iBAAiB,IAIK,MAAM,CAFtC;IAED,IAAW,iBAAiB,CAAC,EAAE,EAAE,MAAM,EAEtC;IAED,IAAW,GAAG,IAAI,SAAS,QAAQ,CAAC,yBAAyB,CAAC,EAAE,CAE/D;IAED;;;OAGG;IACI,MAAM,CAAC,QAAQ,EAAE,MAAM;IAqB9B,OAAO,CAAC,WAAW;IAOnB,OAAO,CAAC,IAAI;CAOf;AAED,qBAAa,yBACT,SAAQ,iBAAiB,CAAC,8BAA8B,CACxD,YAAW,wBAAwB,EAAE,WAAW;IAwCtB,OAAO,EAAE,UAAU;IAvC7C;;;;;OAKG;WACiB,MAAM,CACtB,2BAA2B,EAAE,uBAAuB,GAAG,OAAO,CAAC,yBAAyB,CAAC;IA6B7F,SAAgB,cAAc,SAAwB;IACtD,OAA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6,7 +6,7 @@
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.ReplayFileDeltaConnection = exports.Replayer = void 0;
8
8
  const protocol_definitions_1 = require("@fluidframework/protocol-definitions");
9
- const common_utils_1 = require("@fluidframework/common-utils");
9
+ const client_utils_1 = require("@fluid-internal/client-utils");
10
10
  const MaxBatchDeltas = 2000;
11
11
  // Since the replay service never actually sends messages the size below is arbitrary
12
12
  const ReplayMaxMessageSize = 16 * 1024;
@@ -25,6 +25,7 @@ const Claims = {
25
25
  };
26
26
  /**
27
27
  * Replay service used to play ops using the delta connection.
28
+ * @internal
28
29
  */
29
30
  class Replayer {
30
31
  constructor(deltaConnection, documentStorageService) {
@@ -79,14 +80,10 @@ class Replayer {
79
80
  }
80
81
  }
81
82
  exports.Replayer = Replayer;
82
- class ReplayFileDeltaConnection extends common_utils_1.TypedEventEmitter {
83
- constructor(details, documentDeltaStorageService) {
84
- super();
85
- this.details = details;
86
- this.maxMessageSize = ReplayMaxMessageSize;
87
- this._disposed = false;
88
- this.replayer = new Replayer(this, documentDeltaStorageService);
89
- }
83
+ /**
84
+ * @internal
85
+ */
86
+ class ReplayFileDeltaConnection extends client_utils_1.TypedEventEmitter {
90
87
  /**
91
88
  * Mimic the delta connection to replay ops on it.
92
89
  *
@@ -107,12 +104,6 @@ class ReplayFileDeltaConnection extends common_utils_1.TypedEventEmitter {
107
104
  serviceConfiguration: {
108
105
  blockSize: 64436,
109
106
  maxMessageSize: ReplayMaxMessageSize,
110
- summary: {
111
- idleTime: 5000,
112
- maxOps: 1000,
113
- maxTime: 5000 * 12,
114
- maxAckWaitTime: 600000,
115
- },
116
107
  },
117
108
  supportedVersions: [fileProtocolVersion],
118
109
  user: null,
@@ -121,6 +112,13 @@ class ReplayFileDeltaConnection extends common_utils_1.TypedEventEmitter {
121
112
  const deltaConnection = new ReplayFileDeltaConnection(connection, documentDeltaStorageService);
122
113
  return deltaConnection;
123
114
  }
115
+ constructor(details, documentDeltaStorageService) {
116
+ super();
117
+ this.details = details;
118
+ this.maxMessageSize = ReplayMaxMessageSize;
119
+ this._disposed = false;
120
+ this.replayer = new Replayer(this, documentDeltaStorageService);
121
+ }
124
122
  getReplayer() {
125
123
  return this.replayer;
126
124
  }
@@ -156,10 +154,13 @@ class ReplayFileDeltaConnection extends common_utils_1.TypedEventEmitter {
156
154
  // and thus can never move to sending ops.
157
155
  throw new Error("ReplayFileDeltaConnection.submit() can't be called");
158
156
  }
159
- async submitSignal(message) {
157
+ async submitSignal(message) { }
158
+ get disposed() {
159
+ return this._disposed;
160
+ }
161
+ dispose() {
162
+ this._disposed = true;
160
163
  }
161
- get disposed() { return this._disposed; }
162
- dispose() { this._disposed = true; }
163
164
  }
164
165
  exports.ReplayFileDeltaConnection = ReplayFileDeltaConnection;
165
166
  //# sourceMappingURL=fileDocumentDeltaConnection.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fileDocumentDeltaConnection.js","sourceRoot":"","sources":["../src/fileDocumentDeltaConnection.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,+EAU8C;AAC9C,+DAAiE;AAGjE,MAAM,cAAc,GAAG,IAAI,CAAC;AAE5B,qFAAqF;AACrF,MAAM,oBAAoB,GAAG,EAAE,GAAG,IAAI,CAAC;AAEvC,MAAM,mBAAmB,GAAG,QAAQ,CAAC;AAErC,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAEvC,MAAM,MAAM,GAAiB;IACzB,UAAU,EAAE,gBAAgB;IAC5B,MAAM,EAAE,CAAC,gCAAS,CAAC,OAAO,CAAC;IAC3B,QAAQ,EAAE,EAAE;IACZ,IAAI,EAAE;QACF,EAAE,EAAE,EAAE;KACT;IACD,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC;IAC5C,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,G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/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IDisposable } from \"@fluidframework/common-definitions\";\nimport { IDocumentDeltaConnection, IDocumentDeltaConnectionEvents } from \"@fluidframework/driver-definitions\";\nimport {\n ConnectionMode,\n IClientConfiguration,\n IConnected,\n IDocumentMessage,\n ISequencedDocumentMessage,\n ISignalClient,\n ISignalMessage,\n ITokenClaims,\n ScopeType,\n} from \"@fluidframework/protocol-definitions\";\nimport { TypedEventEmitter } from \"@fluidframework/common-utils\";\nimport { FileDeltaStorageService } from \"./fileDeltaStorageService\";\n\nconst MaxBatchDeltas = 2000;\n\n// Since the replay service never actually sends messages the size below is arbitrary\nconst ReplayMaxMessageSize = 16 * 1024;\n\nconst fileProtocolVersion = \"^0.1.0\";\n\nconst replayDocumentId = \"replayDocId\";\n\nconst Claims: ITokenClaims = {\n documentId: replayDocumentId,\n scopes: [ScopeType.DocRead],\n tenantId: \"\",\n user: {\n id: \"\",\n },\n iat: Math.round(new Date().getTime() / 1000),\n exp: Math.round(new Date().getTime() / 1000) + 60 * 60, // 1 hour expiration\n ver: \"1.0\",\n};\n\n/**\n * Replay service used to play ops using the delta connection.\n */\nexport class Replayer {\n private currentReplayOp = 0;\n\n constructor(\n private readonly deltaConnection: ReplayFileDeltaConnection,\n private readonly documentStorageService: FileDeltaStorageService) {\n }\n\n public get currentReplayedOp() {\n return this.currentReplayOp;\n }\n\n public set currentReplayedOp(op: number) {\n this.currentReplayOp = op;\n }\n\n public get ops(): readonly Readonly<ISequencedDocumentMessage>[] {\n return this.documentStorageService.ops;\n }\n\n /**\n * Replay the ops upto a certain number.\n * @param replayTo - The last op number to be replayed.\n */\n public replay(replayTo: number) {\n let totalReplayedOps = 0;\n let done: boolean;\n do {\n const fetchToBatch = this.currentReplayOp + MaxBatchDeltas;\n const fetchTo = Math.min(fetchToBatch, replayTo);\n\n const fetchedOps = this.documentStorageService.getFromWebSocket(this.currentReplayOp, fetchTo);\n\n if (fetchedOps.length <= 0) {\n break;\n } else {\n this.emit(fetchedOps);\n totalReplayedOps += fetchedOps.length;\n this.currentReplayOp += fetchedOps.length;\n done = this.isDoneFetch(replayTo);\n }\n } while (!done);\n return totalReplayedOps;\n }\n\n private isDoneFetch(replayTo: number) {\n if (replayTo >= 0) {\n return this.currentReplayOp >= replayTo;\n }\n return false;\n }\n\n private emit(ops: ISequencedDocumentMessage[]) {\n // Note: do not clone messages here!\n // If Replay Tool fails due to one container patching message in-place,\n // then same thing can happen in shipping product due to\n // socket reuse in ODSP between main and summarizer containers.\n this.deltaConnection.emit(\"op\", replayDocumentId, ops);\n }\n}\n\nexport class ReplayFileDeltaConnection\n extends TypedEventEmitter<IDocumentDeltaConnectionEvents>\n implements IDocumentDeltaConnection, IDisposable {\n /**\n * Mimic the delta connection to replay ops on it.\n *\n * @param documentDeltaStorageService - The delta storage service to get ops from.\n * @returns Document delta connection.\n */\n public static async create(\n documentDeltaStorageService: FileDeltaStorageService): Promise<ReplayFileDeltaConnection> {\n const mode: ConnectionMode = \"read\";\n const connection = {\n claims: Claims,\n clientId: \"PseudoClientId\",\n existing: true,\n initialMessages: [],\n initialSignals: [],\n initialClients: [],\n maxMessageSize: ReplayMaxMessageSize,\n mode,\n serviceConfiguration: {\n blockSize: 64436,\n maxMessageSize: ReplayMaxMessageSize,\n summary: {\n idleTime: 5000,\n maxOps: 1000,\n maxTime: 5000 * 12,\n maxAckWaitTime: 600000,\n },\n },\n supportedVersions: [fileProtocolVersion],\n user: null,\n version: fileProtocolVersion,\n };\n const deltaConnection = new ReplayFileDeltaConnection(connection, documentDeltaStorageService);\n return deltaConnection;\n }\n\n public readonly maxMessageSize = ReplayMaxMessageSize;\n private readonly replayer: Replayer;\n\n public constructor(public details: IConnected, documentDeltaStorageService: FileDeltaStorageService) {\n super();\n this.replayer = new Replayer(\n this,\n documentDeltaStorageService);\n }\n\n public getReplayer() {\n return this.replayer;\n }\n\n public get clientId(): string {\n return this.details.clientId;\n }\n\n public get mode(): ConnectionMode {\n return this.details.mode;\n }\n\n public get claims(): ITokenClaims {\n return this.details.claims;\n }\n\n public get existing(): boolean {\n return this.details.existing;\n }\n\n public get version(): string {\n return this.details.version;\n }\n\n public get initialMessages(): ISequencedDocumentMessage[] {\n return this.details.initialMessages;\n }\n\n public get initialSignals(): ISignalMessage[] {\n return this.details.initialSignals;\n }\n\n public get initialClients(): ISignalClient[] {\n return this.details.initialClients;\n }\n\n public get serviceConfiguration(): IClientConfiguration {\n return this.details.serviceConfiguration;\n }\n\n public submit(documentMessages: IDocumentMessage[]): void {\n // ReplayFileDeltaConnection.submit() can't be called - client never sees its own join on,\n // and thus can never move to sending ops.\n throw new Error(\"ReplayFileDeltaConnection.submit() can't be called\");\n }\n\n public async submitSignal(message: any) {\n }\n\n private _disposed = false;\n public get disposed() { return this._disposed; }\n public dispose() { this._disposed = true; }\n}\n"]}
1
+ {"version":3,"file":"fileDocumentDeltaConnection.js","sourceRoot":"","sources":["../src/fileDocumentDeltaConnection.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAOH,+EAU8C;AAC9C,+DAAiE;AAGjE,MAAM,cAAc,GAAG,IAAI,CAAC;AAE5B,qFAAqF;AACrF,MAAM,oBAAoB,GAAG,EAAE,GAAG,IAAI,CAAC;AAEvC,MAAM,mBAAmB,GAAG,QAAQ,CAAC;AAErC,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAEvC,MAAM,MAAM,GAAiB;IAC5B,UAAU,EAAE,gBAAgB;IAC5B,MAAM,EAAE,CAAC,gCAAS,CAAC,OAAO,CAAC;IAC3B,QAAQ,EAAE,EAAE;IACZ,IAAI,EAAE;QACL,EAAE,EAAE,EAAE;KACN;IACD,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC;IAC5C,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,IA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AC;IACjE,CAAC;IAEM,WAAW;QACjB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACtB,CAAC;IAED,IAAW,QAAQ;QAClB,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;IAC9B,CAAC;IAED,IAAW,IAAI;QACd,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;IAC1B,CAAC;IAED,IAAW,MAAM;QAChB,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;IAC5B,CAAC;IAED,IAAW,QAAQ;QAClB,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;IAC9B,CAAC;IAED,IAAW,OAAO;QACjB,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;IAC7B,CAAC;IAED,IAAW,eAAe;QACzB,OAAO,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC;IACrC,CAAC;IAED,IAAW,cAAc;QACxB,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC;IACpC,CAAC;IAED,IAAW,cAAc;QACxB,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC;IACpC,CAAC;IAED,IAAW,oBAAoB;QAC9B,OAAO,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC;IAC1C,CAAC;IAEM,MAAM,CAAC,gBAAoC;QACjD,0FAA0F;QAC1F,0CAA0C;QAC1C,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;IACvE,CAAC;IAEM,KAAK,CAAC,YAAY,CAAC,OAAY,IAAG,CAAC;IAG1C,IAAW,QAAQ;QAClB,OAAO,IAAI,CAAC,SAAS,CAAC;IACvB,CAAC;IACM,OAAO;QACb,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;IACvB,CAAC;CACD;AAxGD,8DAwGC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IDisposable } from \"@fluidframework/core-interfaces\";\nimport {\n\tIDocumentDeltaConnection,\n\tIDocumentDeltaConnectionEvents,\n} from \"@fluidframework/driver-definitions\";\nimport {\n\tConnectionMode,\n\tIClientConfiguration,\n\tIConnected,\n\tIDocumentMessage,\n\tISequencedDocumentMessage,\n\tISignalClient,\n\tISignalMessage,\n\tITokenClaims,\n\tScopeType,\n} from \"@fluidframework/protocol-definitions\";\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport { FileDeltaStorageService } from \"./fileDeltaStorageService\";\n\nconst MaxBatchDeltas = 2000;\n\n// Since the replay service never actually sends messages the size below is arbitrary\nconst ReplayMaxMessageSize = 16 * 1024;\n\nconst fileProtocolVersion = \"^0.1.0\";\n\nconst replayDocumentId = \"replayDocId\";\n\nconst Claims: ITokenClaims = {\n\tdocumentId: replayDocumentId,\n\tscopes: [ScopeType.DocRead],\n\ttenantId: \"\",\n\tuser: {\n\t\tid: \"\",\n\t},\n\tiat: Math.round(new Date().getTime() / 1000),\n\texp: Math.round(new Date().getTime() / 1000) + 60 * 60, // 1 hour expiration\n\tver: \"1.0\",\n};\n\n/**\n * Replay service used to play ops using the delta connection.\n * @internal\n */\nexport class Replayer {\n\tprivate currentReplayOp = 0;\n\n\tconstructor(\n\t\tprivate readonly deltaConnection: ReplayFileDeltaConnection,\n\t\tprivate readonly documentStorageService: FileDeltaStorageService,\n\t) {}\n\n\tpublic get currentReplayedOp() {\n\t\treturn this.currentReplayOp;\n\t}\n\n\tpublic set currentReplayedOp(op: number) {\n\t\tthis.currentReplayOp = op;\n\t}\n\n\tpublic get ops(): readonly Readonly<ISequencedDocumentMessage>[] {\n\t\treturn this.documentStorageService.ops;\n\t}\n\n\t/**\n\t * Replay the ops upto a certain number.\n\t * @param replayTo - The last op number to be replayed.\n\t */\n\tpublic replay(replayTo: number) {\n\t\tlet totalReplayedOps = 0;\n\t\tlet done: boolean;\n\t\tdo {\n\t\t\tconst fetchToBatch = this.currentReplayOp + MaxBatchDeltas;\n\t\t\tconst fetchTo = Math.min(fetchToBatch, replayTo);\n\n\t\t\tconst fetchedOps = this.documentStorageService.getFromWebSocket(\n\t\t\t\tthis.currentReplayOp,\n\t\t\t\tfetchTo,\n\t\t\t);\n\n\t\t\tif (fetchedOps.length <= 0) {\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\tthis.emit(fetchedOps);\n\t\t\t\ttotalReplayedOps += fetchedOps.length;\n\t\t\t\tthis.currentReplayOp += fetchedOps.length;\n\t\t\t\tdone = this.isDoneFetch(replayTo);\n\t\t\t}\n\t\t} while (!done);\n\t\treturn totalReplayedOps;\n\t}\n\n\tprivate isDoneFetch(replayTo: number) {\n\t\tif (replayTo >= 0) {\n\t\t\treturn this.currentReplayOp >= replayTo;\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate emit(ops: ISequencedDocumentMessage[]) {\n\t\t// Note: do not clone messages here!\n\t\t// If Replay Tool fails due to one container patching message in-place,\n\t\t// then same thing can happen in shipping product due to\n\t\t// socket reuse in ODSP between main and summarizer containers.\n\t\tthis.deltaConnection.emit(\"op\", replayDocumentId, ops);\n\t}\n}\n\n/**\n * @internal\n */\nexport class ReplayFileDeltaConnection\n\textends TypedEventEmitter<IDocumentDeltaConnectionEvents>\n\timplements IDocumentDeltaConnection, IDisposable\n{\n\t/**\n\t * Mimic the delta connection to replay ops on it.\n\t *\n\t * @param documentDeltaStorageService - The delta storage service to get ops from.\n\t * @returns Document delta connection.\n\t */\n\tpublic static async create(\n\t\tdocumentDeltaStorageService: FileDeltaStorageService,\n\t): Promise<ReplayFileDeltaConnection> {\n\t\tconst mode: ConnectionMode = \"read\";\n\t\tconst connection = {\n\t\t\tclaims: Claims,\n\t\t\tclientId: \"PseudoClientId\",\n\t\t\texisting: true,\n\t\t\tinitialMessages: [],\n\t\t\tinitialSignals: [],\n\t\t\tinitialClients: [],\n\t\t\tmaxMessageSize: ReplayMaxMessageSize,\n\t\t\tmode,\n\t\t\tserviceConfiguration: {\n\t\t\t\tblockSize: 64436,\n\t\t\t\tmaxMessageSize: ReplayMaxMessageSize,\n\t\t\t},\n\t\t\tsupportedVersions: [fileProtocolVersion],\n\t\t\tuser: null,\n\t\t\tversion: fileProtocolVersion,\n\t\t};\n\t\tconst deltaConnection = new ReplayFileDeltaConnection(\n\t\t\tconnection,\n\t\t\tdocumentDeltaStorageService,\n\t\t);\n\t\treturn deltaConnection;\n\t}\n\n\tpublic readonly maxMessageSize = ReplayMaxMessageSize;\n\tprivate readonly replayer: Replayer;\n\n\tpublic constructor(\n\t\tpublic details: IConnected,\n\t\tdocumentDeltaStorageService: FileDeltaStorageService,\n\t) {\n\t\tsuper();\n\t\tthis.replayer = new Replayer(this, documentDeltaStorageService);\n\t}\n\n\tpublic getReplayer() {\n\t\treturn this.replayer;\n\t}\n\n\tpublic get clientId(): string {\n\t\treturn this.details.clientId;\n\t}\n\n\tpublic get mode(): ConnectionMode {\n\t\treturn this.details.mode;\n\t}\n\n\tpublic get claims(): ITokenClaims {\n\t\treturn this.details.claims;\n\t}\n\n\tpublic get existing(): boolean {\n\t\treturn this.details.existing;\n\t}\n\n\tpublic get version(): string {\n\t\treturn this.details.version;\n\t}\n\n\tpublic get initialMessages(): ISequencedDocumentMessage[] {\n\t\treturn this.details.initialMessages;\n\t}\n\n\tpublic get initialSignals(): ISignalMessage[] {\n\t\treturn this.details.initialSignals;\n\t}\n\n\tpublic get initialClients(): ISignalClient[] {\n\t\treturn this.details.initialClients;\n\t}\n\n\tpublic get serviceConfiguration(): IClientConfiguration {\n\t\treturn this.details.serviceConfiguration;\n\t}\n\n\tpublic submit(documentMessages: IDocumentMessage[]): void {\n\t\t// ReplayFileDeltaConnection.submit() can't be called - client never sees its own join on,\n\t\t// and thus can never move to sending ops.\n\t\tthrow new Error(\"ReplayFileDeltaConnection.submit() can't be called\");\n\t}\n\n\tpublic async submitSignal(message: any) {}\n\n\tprivate _disposed = false;\n\tpublic get disposed() {\n\t\treturn this._disposed;\n\t}\n\tpublic dispose() {\n\t\tthis._disposed = true;\n\t}\n}\n"]}
@@ -10,12 +10,12 @@ import { FileDeltaStorageService } from "./fileDeltaStorageService";
10
10
  * underlying storage for file document service.
11
11
  */
12
12
  export declare class FileDocumentService implements api.IDocumentService {
13
+ readonly resolvedUrl: api.IResolvedUrl;
13
14
  private readonly storage;
14
15
  private readonly deltaStorage;
15
16
  private readonly deltaConnection;
16
- constructor(storage: api.IDocumentStorageService, deltaStorage: FileDeltaStorageService, deltaConnection: api.IDocumentDeltaConnection);
17
+ constructor(resolvedUrl: api.IResolvedUrl, storage: api.IDocumentStorageService, deltaStorage: FileDeltaStorageService, deltaConnection: api.IDocumentDeltaConnection);
17
18
  dispose(): void;
18
- get resolvedUrl(): api.IResolvedUrl;
19
19
  connectToStorage(): Promise<api.IDocumentStorageService>;
20
20
  connectToDeltaStorage(): Promise<api.IDocumentDeltaStorageService>;
21
21
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"fileDocumentService.d.ts","sourceRoot":"","sources":["../src/fileDocumentService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,GAAG,MAAM,oCAAoC,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE;;;GAGG;AACH,qBAAa,mBAAoB,YAAW,GAAG,CAAC,gBAAgB;IAExD,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,eAAe;gBAFf,OAAO,EAAE,GAAG,CAAC,uBAAuB,EACpC,YAAY,EAAE,uBAAuB,EACrC,eAAe,EAAE,GAAG,CAAC,wBAAwB;IAG3D,OAAO;IAGd,IAAW,WAAW,IAAI,GAAG,CAAC,YAAY,CAEzC;IAEY,gBAAgB,IAAI,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC;IAIxD,qBAAqB,IAAI,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC;IAI/E;;;;;;OAMG;IACU,oBAAoB,CAC7B,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC;CAG9D"}
1
+ {"version":3,"file":"fileDocumentService.d.ts","sourceRoot":"","sources":["../src/fileDocumentService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,GAAG,MAAM,oCAAoC,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE;;;GAGG;AAEH,qBAAa,mBAAoB,YAAW,GAAG,CAAC,gBAAgB;aAE9C,WAAW,EAAE,GAAG,CAAC,YAAY;IAC7C,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,eAAe;gBAHhB,WAAW,EAAE,GAAG,CAAC,YAAY,EAC5B,OAAO,EAAE,GAAG,CAAC,uBAAuB,EACpC,YAAY,EAAE,uBAAuB,EACrC,eAAe,EAAE,GAAG,CAAC,wBAAwB;IAGxD,OAAO;IAED,gBAAgB,IAAI,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC;IAIxD,qBAAqB,IAAI,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC;IAI/E;;;;;;OAMG;IACU,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC;CAGzF"}
@@ -9,17 +9,15 @@ exports.FileDocumentService = void 0;
9
9
  * The DocumentService manages the different endpoints for connecting to
10
10
  * underlying storage for file document service.
11
11
  */
12
+ // eslint-disable-next-line import/namespace
12
13
  class FileDocumentService {
13
- constructor(storage, deltaStorage, deltaConnection) {
14
+ constructor(resolvedUrl, storage, deltaStorage, deltaConnection) {
15
+ this.resolvedUrl = resolvedUrl;
14
16
  this.storage = storage;
15
17
  this.deltaStorage = deltaStorage;
16
18
  this.deltaConnection = deltaConnection;
17
19
  }
18
20
  dispose() { }
19
- // TODO: Issue-2109 Implement detach container api or put appropriate comment.
20
- get resolvedUrl() {
21
- throw new Error("Not implemented");
22
- }
23
21
  async connectToStorage() {
24
22
  return this.storage;
25
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"fileDocumentService.js","sourceRoot":"","sources":["../src/fileDocumentService.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAMH;;;GAGG;AACH,MAAa,mBAAmB;IAC5B,YACqB,OAAoC,EACpC,YAAqC,EACrC,eAA6C;QAF7C,YAAO,GAAP,OAAO,CAA6B;QACpC,iBAAY,GAAZ,YAAY,CAAyB;QACrC,oBAAe,GAAf,eAAe,CAA8B;IAClE,CAAC;IAEM,OAAO,KAAI,CAAC;IAEnB,8EAA8E;IAC9E,IAAW,WAAW;QAClB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACvC,CAAC;IAEM,KAAK,CAAC,gBAAgB;QACzB,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAEM,KAAK,CAAC,qBAAqB;QAC9B,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,oBAAoB,CAC7B,MAAe;QACf,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;CACJ;AAjCD,kDAiCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as api from \"@fluidframework/driver-definitions\";\nimport { IClient } from \"@fluidframework/protocol-definitions\";\nimport { FileDeltaStorageService } from \"./fileDeltaStorageService\";\n\n/**\n * The DocumentService manages the different endpoints for connecting to\n * underlying storage for file document service.\n */\nexport class FileDocumentService implements api.IDocumentService {\n constructor(\n private readonly storage: api.IDocumentStorageService,\n private readonly deltaStorage: FileDeltaStorageService,\n private readonly deltaConnection: api.IDocumentDeltaConnection) {\n }\n\n public dispose() {}\n\n // TODO: Issue-2109 Implement detach container api or put appropriate comment.\n public get resolvedUrl(): api.IResolvedUrl {\n throw new Error(\"Not implemented\");\n }\n\n public async connectToStorage(): Promise<api.IDocumentStorageService> {\n return this.storage;\n }\n\n public async connectToDeltaStorage(): Promise<api.IDocumentDeltaStorageService> {\n return this.deltaStorage;\n }\n\n /**\n * Connects to a delta storage endpoint of provided documentService to get ops and then replaying\n * them so as to mimic a delta stream endpoint.\n *\n * @param client - Client that connects to socket.\n * @returns returns the delta stream service.\n */\n public async connectToDeltaStream(\n client: IClient): Promise<api.IDocumentDeltaConnection> {\n return this.deltaConnection;\n }\n}\n"]}
1
+ {"version":3,"file":"fileDocumentService.js","sourceRoot":"","sources":["../src/fileDocumentService.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAMH;;;GAGG;AACH,4CAA4C;AAC5C,MAAa,mBAAmB;IAC/B,YACiB,WAA6B,EAC5B,OAAoC,EACpC,YAAqC,EACrC,eAA6C;QAH9C,gBAAW,GAAX,WAAW,CAAkB;QAC5B,YAAO,GAAP,OAAO,CAA6B;QACpC,iBAAY,GAAZ,YAAY,CAAyB;QACrC,oBAAe,GAAf,eAAe,CAA8B;IAC5D,CAAC;IAEG,OAAO,KAAI,CAAC;IAEZ,KAAK,CAAC,gBAAgB;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC;IAEM,KAAK,CAAC,qBAAqB;QACjC,OAAO,IAAI,CAAC,YAAY,CAAC;IAC1B,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,oBAAoB,CAAC,MAAe;QAChD,OAAO,IAAI,CAAC,eAAe,CAAC;IAC7B,CAAC;CACD;AA5BD,kDA4BC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as api from \"@fluidframework/driver-definitions\";\nimport { IClient } from \"@fluidframework/protocol-definitions\";\nimport { FileDeltaStorageService } from \"./fileDeltaStorageService\";\n\n/**\n * The DocumentService manages the different endpoints for connecting to\n * underlying storage for file document service.\n */\n// eslint-disable-next-line import/namespace\nexport class FileDocumentService implements api.IDocumentService {\n\tconstructor(\n\t\tpublic readonly resolvedUrl: api.IResolvedUrl,\n\t\tprivate readonly storage: api.IDocumentStorageService,\n\t\tprivate readonly deltaStorage: FileDeltaStorageService,\n\t\tprivate readonly deltaConnection: api.IDocumentDeltaConnection,\n\t) {}\n\n\tpublic dispose() {}\n\n\tpublic async connectToStorage(): Promise<api.IDocumentStorageService> {\n\t\treturn this.storage;\n\t}\n\n\tpublic async connectToDeltaStorage(): Promise<api.IDocumentDeltaStorageService> {\n\t\treturn this.deltaStorage;\n\t}\n\n\t/**\n\t * Connects to a delta storage endpoint of provided documentService to get ops and then replaying\n\t * them so as to mimic a delta stream endpoint.\n\t *\n\t * @param client - Client that connects to socket.\n\t * @returns returns the delta stream service.\n\t */\n\tpublic async connectToDeltaStream(client: IClient): Promise<api.IDocumentDeltaConnection> {\n\t\treturn this.deltaConnection;\n\t}\n}\n"]}
@@ -3,18 +3,18 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { IDocumentDeltaConnection, IDocumentService, IDocumentServiceFactory, IDocumentStorageService, IResolvedUrl } from "@fluidframework/driver-definitions";
6
- import { ITelemetryBaseLogger } from "@fluidframework/common-definitions";
6
+ import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
7
7
  import { ISummaryTree } from "@fluidframework/protocol-definitions";
8
8
  import { FileDeltaStorageService } from "./fileDeltaStorageService";
9
9
  /**
10
10
  * Factory for creating the file document service. Use this if you want to
11
11
  * use the local file storage as underlying storage.
12
+ * @internal
12
13
  */
13
14
  export declare class FileDocumentServiceFactory implements IDocumentServiceFactory {
14
15
  private readonly storage;
15
16
  private readonly deltaStorage;
16
17
  private readonly deltaConnection;
17
- readonly protocolName = "fluid-file:";
18
18
  constructor(storage: IDocumentStorageService, deltaStorage: FileDeltaStorageService, deltaConnection: IDocumentDeltaConnection);
19
19
  /**
20
20
  * Creates the file document service if the path exists.
@@ -22,7 +22,7 @@ export declare class FileDocumentServiceFactory implements IDocumentServiceFacto
22
22
  * @param fileURL - Path of directory containing ops/snapshots.
23
23
  * @returns file document service.
24
24
  */
25
- createDocumentService(fileURL: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
25
+ createDocumentService(resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
26
26
  createContainer(createNewSummary: ISummaryTree, resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
27
27
  }
28
28
  //# sourceMappingURL=fileDocumentServiceFactory.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fileDocumentServiceFactory.d.ts","sourceRoot":"","sources":["../src/fileDocumentServiceFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACH,wBAAwB,EACxB,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,EACvB,YAAY,EACf,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAGpE;;;GAGG;AACH,qBAAa,0BAA2B,YAAW,uBAAuB;IAGlE,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,eAAe;IAJpC,SAAgB,YAAY,iBAAiB;gBAExB,OAAO,EAAE,uBAAuB,EAChC,YAAY,EAAE,uBAAuB,EACrC,eAAe,EAAE,wBAAwB;IAG9D;;;;;OAKG;IACU,qBAAqB,CAC9B,OAAO,EAAE,YAAY,EACrB,MAAM,CAAC,EAAE,oBAAoB,EAC7B,kBAAkB,CAAC,EAAE,OAAO,GAC7B,OAAO,CAAC,gBAAgB,CAAC;IAKf,eAAe,CACxB,gBAAgB,EAAE,YAAY,EAC9B,WAAW,EAAE,YAAY,EACzB,MAAM,CAAC,EAAE,oBAAoB,EAC7B,kBAAkB,CAAC,EAAE,OAAO,GAC7B,OAAO,CAAC,gBAAgB,CAAC;CAG/B"}
1
+ {"version":3,"file":"fileDocumentServiceFactory.d.ts","sourceRoot":"","sources":["../src/fileDocumentServiceFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,wBAAwB,EACxB,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,EACvB,YAAY,EACZ,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAGpE;;;;GAIG;AACH,qBAAa,0BAA2B,YAAW,uBAAuB;IAExE,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,eAAe;gBAFf,OAAO,EAAE,uBAAuB,EAChC,YAAY,EAAE,uBAAuB,EACrC,eAAe,EAAE,wBAAwB;IAG3D;;;;;OAKG;IACU,qBAAqB,CACjC,WAAW,EAAE,YAAY,EACzB,MAAM,CAAC,EAAE,oBAAoB,EAC7B,kBAAkB,CAAC,EAAE,OAAO,GAC1B,OAAO,CAAC,gBAAgB,CAAC;IAUf,eAAe,CAC3B,gBAAgB,EAAE,YAAY,EAC9B,WAAW,EAAE,YAAY,EACzB,MAAM,CAAC,EAAE,oBAAoB,EAC7B,kBAAkB,CAAC,EAAE,OAAO,GAC1B,OAAO,CAAC,gBAAgB,CAAC;CAG5B"}
@@ -9,13 +9,13 @@ const fileDocumentService_1 = require("./fileDocumentService");
9
9
  /**
10
10
  * Factory for creating the file document service. Use this if you want to
11
11
  * use the local file storage as underlying storage.
12
+ * @internal
12
13
  */
13
14
  class FileDocumentServiceFactory {
14
15
  constructor(storage, deltaStorage, deltaConnection) {
15
16
  this.storage = storage;
16
17
  this.deltaStorage = deltaStorage;
17
18
  this.deltaConnection = deltaConnection;
18
- this.protocolName = "fluid-file:";
19
19
  }
20
20
  /**
21
21
  * Creates the file document service if the path exists.
@@ -23,8 +23,8 @@ class FileDocumentServiceFactory {
23
23
  * @param fileURL - Path of directory containing ops/snapshots.
24
24
  * @returns file document service.
25
25
  */
26
- async createDocumentService(fileURL, logger, clientIsSummarizer) {
27
- return new fileDocumentService_1.FileDocumentService(this.storage, this.deltaStorage, this.deltaConnection);
26
+ async createDocumentService(resolvedUrl, logger, clientIsSummarizer) {
27
+ return new fileDocumentService_1.FileDocumentService(resolvedUrl, this.storage, this.deltaStorage, this.deltaConnection);
28
28
  }
29
29
  // TODO: Issue-2109 Implement detach container api or put appropriate comment.
30
30
  async createContainer(createNewSummary, resolvedUrl, logger, clientIsSummarizer) {
@@ -1 +1 @@
1
- {"version":3,"file":"fileDocumentServiceFactory.js","sourceRoot":"","sources":["../src/fileDocumentServiceFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAYH,+DAA4D;AAE5D;;;GAGG;AACH,MAAa,0BAA0B;IAEnC,YACqB,OAAgC,EAChC,YAAqC,EACrC,eAAyC;QAFzC,YAAO,GAAP,OAAO,CAAyB;QAChC,iBAAY,GAAZ,YAAY,CAAyB;QACrC,oBAAe,GAAf,eAAe,CAA0B;QAJ9C,iBAAY,GAAG,aAAa,CAAC;IAK7C,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,qBAAqB,CAC9B,OAAqB,EACrB,MAA6B,EAC7B,kBAA4B;QAE5B,OAAO,IAAI,yCAAmB,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;IAC1F,CAAC;IAED,8EAA8E;IACvE,KAAK,CAAC,eAAe,CACxB,gBAA8B,EAC9B,WAAyB,EACzB,MAA6B,EAC7B,kBAA4B;QAE5B,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACvC,CAAC;CACJ;AA/BD,gEA+BC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n IDocumentDeltaConnection,\n IDocumentService,\n IDocumentServiceFactory,\n IDocumentStorageService,\n IResolvedUrl,\n} from \"@fluidframework/driver-definitions\";\nimport { ITelemetryBaseLogger } from \"@fluidframework/common-definitions\";\nimport { ISummaryTree } from \"@fluidframework/protocol-definitions\";\nimport { FileDeltaStorageService } from \"./fileDeltaStorageService\";\nimport { FileDocumentService } from \"./fileDocumentService\";\n\n/**\n * Factory for creating the file document service. Use this if you want to\n * use the local file storage as underlying storage.\n */\nexport class FileDocumentServiceFactory implements IDocumentServiceFactory {\n public readonly protocolName = \"fluid-file:\";\n constructor(\n private readonly storage: IDocumentStorageService,\n private readonly deltaStorage: FileDeltaStorageService,\n private readonly deltaConnection: IDocumentDeltaConnection) {\n }\n\n /**\n * Creates the file document service if the path exists.\n *\n * @param fileURL - Path of directory containing ops/snapshots.\n * @returns file document service.\n */\n public async createDocumentService(\n fileURL: IResolvedUrl,\n logger?: ITelemetryBaseLogger,\n clientIsSummarizer?: boolean,\n ): Promise<IDocumentService> {\n return new FileDocumentService(this.storage, this.deltaStorage, this.deltaConnection);\n }\n\n // TODO: Issue-2109 Implement detach container api or put appropriate comment.\n public async createContainer(\n createNewSummary: ISummaryTree,\n resolvedUrl: IResolvedUrl,\n logger?: ITelemetryBaseLogger,\n clientIsSummarizer?: boolean,\n ): Promise<IDocumentService> {\n throw new Error(\"Not implemented\");\n }\n}\n"]}
1
+ {"version":3,"file":"fileDocumentServiceFactory.js","sourceRoot":"","sources":["../src/fileDocumentServiceFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAYH,+DAA4D;AAE5D;;;;GAIG;AACH,MAAa,0BAA0B;IACtC,YACkB,OAAgC,EAChC,YAAqC,EACrC,eAAyC;QAFzC,YAAO,GAAP,OAAO,CAAyB;QAChC,iBAAY,GAAZ,YAAY,CAAyB;QACrC,oBAAe,GAAf,eAAe,CAA0B;IACxD,CAAC;IAEJ;;;;;OAKG;IACI,KAAK,CAAC,qBAAqB,CACjC,WAAyB,EACzB,MAA6B,EAC7B,kBAA4B;QAE5B,OAAO,IAAI,yCAAmB,CAC7B,WAAW,EACX,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,eAAe,CACpB,CAAC;IACH,CAAC;IAED,8EAA8E;IACvE,KAAK,CAAC,eAAe,CAC3B,gBAA8B,EAC9B,WAAyB,EACzB,MAA6B,EAC7B,kBAA4B;QAE5B,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACpC,CAAC;CACD;AAnCD,gEAmCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIDocumentDeltaConnection,\n\tIDocumentService,\n\tIDocumentServiceFactory,\n\tIDocumentStorageService,\n\tIResolvedUrl,\n} from \"@fluidframework/driver-definitions\";\nimport { ITelemetryBaseLogger } from \"@fluidframework/core-interfaces\";\nimport { ISummaryTree } from \"@fluidframework/protocol-definitions\";\nimport { FileDeltaStorageService } from \"./fileDeltaStorageService\";\nimport { FileDocumentService } from \"./fileDocumentService\";\n\n/**\n * Factory for creating the file document service. Use this if you want to\n * use the local file storage as underlying storage.\n * @internal\n */\nexport class FileDocumentServiceFactory implements IDocumentServiceFactory {\n\tconstructor(\n\t\tprivate readonly storage: IDocumentStorageService,\n\t\tprivate readonly deltaStorage: FileDeltaStorageService,\n\t\tprivate readonly deltaConnection: IDocumentDeltaConnection,\n\t) {}\n\n\t/**\n\t * Creates the file document service if the path exists.\n\t *\n\t * @param fileURL - Path of directory containing ops/snapshots.\n\t * @returns file document service.\n\t */\n\tpublic async createDocumentService(\n\t\tresolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\treturn new FileDocumentService(\n\t\t\tresolvedUrl,\n\t\t\tthis.storage,\n\t\t\tthis.deltaStorage,\n\t\t\tthis.deltaConnection,\n\t\t);\n\t}\n\n\t// TODO: Issue-2109 Implement detach container api or put appropriate comment.\n\tpublic async createContainer(\n\t\tcreateNewSummary: ISummaryTree,\n\t\tresolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\tthrow new Error(\"Not implemented\");\n\t}\n}\n"]}