@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
@@ -5,9 +5,13 @@
5
5
  import { IDocumentStorageService, ISummaryContext } from "@fluidframework/driver-definitions";
6
6
  import * as api from "@fluidframework/protocol-definitions";
7
7
  import { IFileSnapshot, ReadDocumentStorageServiceBase } from "@fluidframework/replay-driver";
8
+ /**
9
+ * @internal
10
+ */
8
11
  export declare const FileStorageDocumentName = "FileStorageDocId";
9
12
  /**
10
13
  * Document storage service for the file driver.
14
+ * @internal
11
15
  */
12
16
  export declare class FluidFetchReader extends ReadDocumentStorageServiceBase implements IDocumentStorageService {
13
17
  private readonly path;
@@ -27,11 +31,20 @@ export declare class FluidFetchReader extends ReadDocumentStorageServiceBase imp
27
31
  getVersions(versionId: string | null, count: number): Promise<api.IVersion[]>;
28
32
  readBlob(sha: string): Promise<ArrayBufferLike>;
29
33
  }
34
+ /**
35
+ * @internal
36
+ */
30
37
  export interface ISnapshotWriterStorage extends IDocumentStorageService {
31
38
  onSnapshotHandler(snapshot: IFileSnapshot): void;
32
39
  reset(): void;
33
40
  }
34
- export declare type ReaderConstructor = new (...args: any[]) => IDocumentStorageService;
41
+ /**
42
+ * @internal
43
+ */
44
+ export type ReaderConstructor = new (...args: any[]) => IDocumentStorageService;
45
+ /**
46
+ * @internal
47
+ */
35
48
  export declare const FileSnapshotWriterClassFactory: <TBase extends ReaderConstructor>(Base: TBase) => {
36
49
  new (...args: any[]): {
37
50
  blobsWriter: Map<string, ArrayBufferLike>;
@@ -41,7 +54,7 @@ export declare const FileSnapshotWriterClassFactory: <TBase extends ReaderConstr
41
54
  onSnapshotHandler(snapshot: IFileSnapshot): void;
42
55
  readBlob(sha: string): Promise<ArrayBufferLike>;
43
56
  getVersions(versionId: string | null, count: number): Promise<api.IVersion[]>;
44
- getSnapshotTree(version?: api.IVersion | undefined): Promise<api.ISnapshotTree | null>;
57
+ getSnapshotTree(version?: api.IVersion): Promise<api.ISnapshotTree | null>;
45
58
  uploadSummaryWithContext(summary: api.ISummaryTree, context: ISummaryContext): Promise<string>;
46
59
  buildTree(snapshotTree: api.ISnapshotTree): Promise<api.ITree>;
47
60
  repositoryUrl: string;
@@ -52,6 +65,9 @@ export declare const FileSnapshotWriterClassFactory: <TBase extends ReaderConstr
52
65
  dispose?: ((error?: Error | undefined) => void) | undefined;
53
66
  };
54
67
  } & TBase;
68
+ /**
69
+ * @internal
70
+ */
55
71
  export declare const FluidFetchReaderFileSnapshotWriter: {
56
72
  new (...args: any[]): {
57
73
  blobsWriter: Map<string, ArrayBufferLike>;
@@ -61,7 +77,7 @@ export declare const FluidFetchReaderFileSnapshotWriter: {
61
77
  onSnapshotHandler(snapshot: IFileSnapshot): void;
62
78
  readBlob(sha: string): Promise<ArrayBufferLike>;
63
79
  getVersions(versionId: string | null, count: number): Promise<api.IVersion[]>;
64
- getSnapshotTree(version?: api.IVersion | undefined): Promise<api.ISnapshotTree | null>;
80
+ getSnapshotTree(version?: api.IVersion): Promise<api.ISnapshotTree | null>;
65
81
  uploadSummaryWithContext(summary: api.ISummaryTree, context: ISummaryContext): Promise<string>;
66
82
  buildTree(snapshotTree: api.ISnapshotTree): Promise<api.ITree>;
67
83
  repositoryUrl: string;
@@ -1 +1 @@
1
- {"version":3,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GAAG,QAAQ,IAAI,aAAa,GAAG,IAAI,CAAC;0CAQ7E,IAAI,YAAY,WAChB,eAAe,GACtB,QAAQ,MAAM,CAAC;gCAcmB,IAAI,aAAa,GAAG,QAAQ,IAAI,KAAK,CAAC;;;;;;;;2BA+CqB,CAAC"}
@@ -5,7 +5,11 @@
5
5
  */
6
6
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
7
  if (k2 === undefined) k2 = k;
8
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
8
+ var desc = Object.getOwnPropertyDescriptor(m, k);
9
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
+ desc = { enumerable: true, get: function() { return m[k]; } };
11
+ }
12
+ Object.defineProperty(o, k2, desc);
9
13
  }) : (function(o, m, k, k2) {
10
14
  if (k2 === undefined) k2 = k;
11
15
  o[k2] = m[k];
@@ -28,17 +32,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
28
32
  Object.defineProperty(exports, "__esModule", { value: true });
29
33
  exports.FluidFetchReaderFileSnapshotWriter = exports.FileSnapshotWriterClassFactory = exports.FluidFetchReader = exports.FileStorageDocumentName = void 0;
30
34
  const fs_1 = __importDefault(require("fs"));
31
- const common_utils_1 = require("@fluidframework/common-utils");
35
+ const client_utils_1 = require("@fluid-internal/client-utils");
36
+ const core_utils_1 = require("@fluidframework/core-utils");
32
37
  const driver_utils_1 = require("@fluidframework/driver-utils");
33
38
  const api = __importStar(require("@fluidframework/protocol-definitions"));
34
39
  const replay_driver_1 = require("@fluidframework/replay-driver");
35
40
  // This ID is used by replay tool as Document Id.
36
41
  // We leverage it to figure out when container is asking for root document tree.
42
+ /**
43
+ * @internal
44
+ */
37
45
  exports.FileStorageDocumentName = "FileStorageDocId"; // Some unique document name
38
46
  // Tree ID use to communicate between getVersions() & getSnapshotTree() that IVersion is ours.
39
47
  const FileStorageVersionTreeId = "FileStorageTreeId";
40
48
  /**
41
49
  * Document storage service for the file driver.
50
+ * @internal
42
51
  */
43
52
  class FluidFetchReader extends replay_driver_1.ReadDocumentStorageServiceBase {
44
53
  constructor(path, versionName) {
@@ -51,9 +60,10 @@ class FluidFetchReader extends replay_driver_1.ReadDocumentStorageServiceBase {
51
60
  * Read the file and returns the snapshot tree.
52
61
  * @param version - The version contains the path of the file which contains the snapshot tree.
53
62
  */
63
+ // eslint-disable-next-line @rushstack/no-new-null
54
64
  async getSnapshotTree(version) {
55
- (0, common_utils_1.assert)(version !== null, 0x092 /* "version input for reading snapshot tree is null!" */);
56
- (0, common_utils_1.assert)(!version || version.treeId === FileStorageVersionTreeId, 0x093 /* "invalid version input for reading snapshot tree!" */);
65
+ (0, core_utils_1.assert)(version !== null, 0x092 /* "version input for reading snapshot tree is null!" */);
66
+ (0, core_utils_1.assert)(!version || version.treeId === FileStorageVersionTreeId, 0x093 /* "invalid version input for reading snapshot tree!" */);
57
67
  let filename;
58
68
  let rootTree = false;
59
69
  if (!version || version.id === "latest") {
@@ -85,20 +95,23 @@ class FluidFetchReader extends replay_driver_1.ReadDocumentStorageServiceBase {
85
95
  * @param versionId - version ID.
86
96
  * @param count - Number of versions to be returned.
87
97
  */
98
+ // eslint-disable-next-line @rushstack/no-new-null
88
99
  async getVersions(versionId, count) {
89
100
  if (versionId === exports.FileStorageDocumentName || versionId === null) {
90
- if (this.docTree || this.versionName !== undefined) {
101
+ if (this.docTree !== null || this.versionName !== undefined) {
91
102
  return [{ id: "latest", treeId: FileStorageVersionTreeId }];
92
103
  }
93
104
  // Started with ops - return empty set.
94
105
  return [];
95
106
  }
96
107
  else if (this.versionName !== undefined) {
97
- (0, common_utils_1.assert)(!!this.docTree, 0x094 /* "Missing snapshot tree!" */);
98
- return [{
108
+ (0, core_utils_1.assert)(!!this.docTree, 0x094 /* "Missing snapshot tree!" */);
109
+ return [
110
+ {
99
111
  id: versionId,
100
112
  treeId: FileStorageVersionTreeId,
101
- }];
113
+ },
114
+ ];
102
115
  }
103
116
  throw new Error(`Unknown version: ${versionId}`);
104
117
  }
@@ -114,6 +127,9 @@ class FluidFetchReader extends replay_driver_1.ReadDocumentStorageServiceBase {
114
127
  }
115
128
  }
116
129
  exports.FluidFetchReader = FluidFetchReader;
130
+ /**
131
+ * @internal
132
+ */
117
133
  const FileSnapshotWriterClassFactory = (Base) => class extends Base {
118
134
  constructor() {
119
135
  super(...arguments);
@@ -135,6 +151,7 @@ const FileSnapshotWriterClassFactory = (Base) => class extends Base {
135
151
  }
136
152
  return super.readBlob(sha);
137
153
  }
154
+ // eslint-disable-next-line @rushstack/no-new-null
138
155
  async getVersions(versionId, count) {
139
156
  // If we already saved document, that means we are getting here because of snapshot generation.
140
157
  // Not returning tree ensures that ContainerRuntime.snapshot() would regenerate subtrees for
@@ -149,6 +166,7 @@ const FileSnapshotWriterClassFactory = (Base) => class extends Base {
149
166
  }
150
167
  return super.getVersions(versionId, count);
151
168
  }
169
+ // eslint-disable-next-line @rushstack/no-new-null
152
170
  async getSnapshotTree(version) {
153
171
  if (this.latestWriterTree && (!version || version.id === "latest")) {
154
172
  return this.latestWriterTree;
@@ -178,7 +196,7 @@ const FileSnapshotWriterClassFactory = (Base) => class extends Base {
178
196
  }
179
197
  for (const blobName of Object.keys(snapshotTree.blobs)) {
180
198
  const buffer = await this.readBlob(snapshotTree.blobs[blobName]);
181
- const contents = (0, common_utils_1.bufferToString)(buffer, "utf8");
199
+ const contents = (0, client_utils_1.bufferToString)(buffer, "utf8");
182
200
  const blob = {
183
201
  contents,
184
202
  encoding: "utf-8",
@@ -200,8 +218,11 @@ function removeNullTreeIds(tree) {
200
218
  removeNullTreeIds(node.value);
201
219
  }
202
220
  }
203
- (0, common_utils_1.assert)(tree.id === undefined || tree.id === null, 0x096 /* "Trying to remove valid tree IDs in removeNullTreeIds()!" */);
221
+ (0, core_utils_1.assert)(tree.id === undefined || tree.id === null, 0x096 /* "Trying to remove valid tree IDs in removeNullTreeIds()!" */);
204
222
  delete tree.id;
205
223
  }
224
+ /**
225
+ * @internal
226
+ */
206
227
  exports.FluidFetchReaderFileSnapshotWriter = (0, exports.FileSnapshotWriterClassFactory)(FluidFetchReader);
207
228
  //# sourceMappingURL=fileDocumentStorageService.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fileDocumentStorageService.js","sourceRoot":"","sources":["../src/fileDocumentStorageService.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,4CAAoB;AACpB,+DAAsE;AAEtE,+DAAoG;AACpG,0EAA4D;AAC5D,iEAA8F;AAE9F,iDAAiD;AACjD,gFAAgF;AACnE,QAAA,uBAAuB,GAAG,kBAAkB,CAAC,CAAC,4BAA4B;AAEvF,8FAA8F;AAC9F,MAAM,wBAAwB,GAAG,mBAAmB,CAAC;AAErD;;GAEG;AACH,MAAa,gBAAiB,SAAQ,8CAA8B;IAGhE,YAA6B,IAAY,EAAmB,WAAoB;QAC5E,KAAK,EAAE,CAAC;QADiB,SAAI,GAAJ,IAAI,CAAQ;QAAmB,gBAAW,GAAX,WAAW,CAAS;QAFtE,YAAO,GAA6B,IAAI,CAAC;IAInD,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,eAAe,CAAC,OAAsB;QAC/C,IAAA,qBAAM,EAAC,OAAO,KAAK,IAAI,EAAE,KAAK,CAAC,wDAAwD,CAAC,CAAC;QACzF,IAAA,qBAAM,EAAC,CAAC,OAAO,IAAI,OAAO,CAAC,MAAM,KAAK,wBAAwB,EAC1D,KAAK,CAAC,wDAAwD,CAAC,CAAC;QAEpE,IAAI,QAAgB,CAAC;QACrB,IAAI,QAAQ,GAAG,KAAK,CAAC;QACrB,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,EAAE,KAAK,QAAQ,EAAE;YACrC,IAAI,IAAI,CAAC,OAAO,EAAE;gBACd,OAAO,IAAI,CAAC,OAAO,CAAC;aACvB;YACD,IAAI,IAAI,CAAC,WAAW,KAAK,SAAS,EAAE;gBAChC,OAAO,IAAI,CAAC;aACf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AAC,SAAS,CAAC,IAAI,EAAE;YAClC,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACjC;KACJ;IACD,IAAA,qBAAM,EAAC,IAAI,CAAC,EAAE,KAAK,SAAS,IAAI,IAAI,CAAC,EAAE,KAAK,IAAI,EAC5C,KAAK,CAAC,+DAA+D,CAAC,CAAC;IAC3E,OAAO,IAAI,CAAC,EAAE,CAAC;AACnB,CAAC;AACY,QAAA,kCAAkC,GAAG,IAAA,sCAA8B,EAAC,gBAAgB,CAAC,CAAC","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, bufferToString } from \"@fluidframework/common-utils\";\nimport { IDocumentStorageService, ISummaryContext } from \"@fluidframework/driver-definitions\";\nimport { buildSnapshotTree, convertSummaryTreeToSnapshotITree } from \"@fluidframework/driver-utils\";\nimport * as api from \"@fluidframework/protocol-definitions\";\nimport { IFileSnapshot, ReadDocumentStorageServiceBase } from \"@fluidframework/replay-driver\";\n\n// This ID is used by replay tool as Document Id.\n// We leverage it to figure out when container is asking for root document tree.\nexport const FileStorageDocumentName = \"FileStorageDocId\"; // Some unique document name\n\n// Tree ID use to communicate between getVersions() & getSnapshotTree() that IVersion is ours.\nconst FileStorageVersionTreeId = \"FileStorageTreeId\";\n\n/**\n * Document storage service for the file driver.\n */\nexport class FluidFetchReader extends ReadDocumentStorageServiceBase implements IDocumentStorageService {\n protected docTree: api.ISnapshotTree | null = null;\n\n constructor(private readonly path: string, private readonly versionName?: string) {\n super();\n }\n\n /**\n * Read the file and returns the snapshot tree.\n * @param version - The version contains the path of the file which contains the snapshot tree.\n */\n public async getSnapshotTree(version?: api.IVersion): Promise<api.ISnapshotTree | null> {\n assert(version !== null, 0x092 /* \"version input for reading snapshot tree is null!\" */);\n assert(!version || version.treeId === FileStorageVersionTreeId,\n 0x093 /* \"invalid version input for reading snapshot tree!\" */);\n\n let filename: string;\n let rootTree = false;\n if (!version || version.id === \"latest\") {\n if (this.docTree) {\n return this.docTree;\n }\n if (this.versionName === undefined) {\n return null;\n }\n rootTree = true;\n filename = `${this.path}/${this.versionName}/tree.json`;\n } else {\n filename = `${this.path}/${this.versionName}/${version.id}.json`;\n }\n\n if (!fs.existsSync(filename)) {\n throw new Error(`Can't find file ${filename}`);\n }\n const data = fs.readFileSync(filename);\n const tree = JSON.parse(data.toString(\"utf-8\"));\n if (rootTree) {\n this.docTree = tree;\n }\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return tree;\n }\n\n /**\n * Gets the path of the snapshot tree to be read.\n * @param versionId - version ID.\n * @param count - Number of versions to be returned.\n */\n public async getVersions(versionId: string | null, count: number): Promise<api.IVersion[]> {\n if (versionId === FileStorageDocumentName || versionId === null) {\n if (this.docTree || this.versionName !== undefined) {\n return [{ id: \"latest\", treeId: FileStorageVersionTreeId }];\n }\n // Started with ops - return empty set.\n return [];\n } else if (this.versionName !== undefined) {\n assert(!!this.docTree, 0x094 /* \"Missing snapshot tree!\" */);\n return [{\n id: versionId,\n treeId: FileStorageVersionTreeId,\n }];\n }\n throw new Error(`Unknown version: ${versionId}`);\n }\n\n public async readBlob(sha: string): Promise<ArrayBufferLike> {\n if (this.versionName !== undefined) {\n const fileName = `${this.path}/${this.versionName}/${sha}`;\n if (fs.existsSync(fileName)) {\n const data = fs.readFileSync(fileName);\n return data;\n }\n }\n throw new Error(`Can't find blob ${sha}`);\n }\n}\n\nexport interface ISnapshotWriterStorage extends IDocumentStorageService {\n onSnapshotHandler(snapshot: IFileSnapshot): void;\n reset(): void;\n}\n\nexport type ReaderConstructor = new (...args: any[]) => IDocumentStorageService;\nexport const FileSnapshotWriterClassFactory = <TBase extends ReaderConstructor>(Base: TBase) =>\n class extends Base implements ISnapshotWriterStorage {\n // Note: if variable name has same name as in base class, it overrides it!\n public blobsWriter = new Map<string, ArrayBufferLike>();\n public latestWriterTree?: api.ISnapshotTree;\n public docId?: string;\n\n public reset() {\n this.blobsWriter = new Map<string, ArrayBufferLike>();\n this.latestWriterTree = undefined;\n this.docId = undefined;\n }\n\n public onSnapshotHandler(snapshot: IFileSnapshot): void {\n throw new Error(\"onSnapshotHandler is not setup! Please provide your handler!\");\n }\n\n public async readBlob(sha: string): Promise<ArrayBufferLike> {\n const blob = this.blobsWriter.get(sha);\n if (blob !== undefined) {\n return blob;\n }\n return super.readBlob(sha);\n }\n\n public async getVersions(versionId: string | null, count: number): Promise<api.IVersion[]> {\n // If we already saved document, that means we are getting here because of snapshot generation.\n // Not returning tree ensures that ContainerRuntime.snapshot() would regenerate subtrees for\n // each unchanged data store.\n // If we want to change that, we would need to capture docId on first call and return this.latestWriterTree\n // when latest is requested.\n if (this.latestWriterTree && (this.docId === versionId || versionId === null)) {\n return [{ id: \"latest\", treeId: FileStorageVersionTreeId }];\n }\n\n if (this.docId === undefined && versionId !== null) {\n this.docId = versionId;\n }\n\n return super.getVersions(versionId, count);\n }\n\n public async getSnapshotTree(version?: api.IVersion): Promise<api.ISnapshotTree | null> {\n if (this.latestWriterTree && (!version || version.id === \"latest\")) {\n return this.latestWriterTree;\n }\n return super.getSnapshotTree(version);\n }\n\n public async uploadSummaryWithContext(summary: api.ISummaryTree, context: ISummaryContext): Promise<string> {\n const tree = convertSummaryTreeToSnapshotITree(summary);\n\n // Remove tree IDs for easier comparison of snapshots\n delete tree.id;\n removeNullTreeIds(tree);\n\n this.latestWriterTree = buildSnapshotTree(tree.entries, this.blobsWriter);\n\n const fileSnapshot: IFileSnapshot = { tree, commits: {} };\n this.onSnapshotHandler(fileSnapshot);\n return \"testHandleId\";\n }\n\n public async buildTree(snapshotTree: api.ISnapshotTree): Promise<api.ITree> {\n const tree: api.ITree = { entries: [] };\n\n for (const subTreeId of Object.keys(snapshotTree.trees)) {\n const subTree = await this.buildTree(snapshotTree.trees[subTreeId]);\n tree.entries.push({\n mode: api.FileMode.Directory,\n path: subTreeId,\n type: api.TreeEntry.Tree,\n value: subTree,\n });\n }\n\n for (const blobName of Object.keys(snapshotTree.blobs)) {\n const buffer = await this.readBlob(snapshotTree.blobs[blobName]);\n const contents = bufferToString(buffer, \"utf8\");\n const blob: api.IBlob = {\n contents,\n encoding: \"utf-8\",\n };\n tree.entries.push({\n mode: api.FileMode.File,\n path: blobName,\n type: api.TreeEntry.Blob,\n value: blob,\n });\n }\n\n return tree;\n }\n };\n\nfunction removeNullTreeIds(tree: api.ITree) {\n for (const node of tree.entries) {\n if (node.type === api.TreeEntry.Tree) {\n removeNullTreeIds(node.value);\n }\n }\n assert(tree.id === undefined || tree.id === null,\n 0x096 /* \"Trying to remove valid tree IDs in removeNullTreeIds()!\" */);\n delete tree.id;\n}\nexport const FluidFetchReaderFileSnapshotWriter = FileSnapshotWriterClassFactory(FluidFetchReader);\n"]}
1
+ {"version":3,"file":"fileDocumentStorageService.js","sourceRoot":"","sources":["../src/fileDocumentStorageService.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,4CAAoB;AACpB,+DAA8D;AAC9D,2DAAoD;AAEpD,+DAAoG;AACpG,0EAA4D;AAC5D,iEAA8F;AAE9F,iDAAiD;AACjD,gFAAgF;AAChF;;GAEG;AACU,QAAA,uBAAuB,GAAG,kBAAkB,CAAC,CAAC,4BAA4B;AAEvF,8FAA8F;AAC9F,MAAM,wBAAwB,GAAG,mBAAmB,CAAC;AAErD;;;GAGG;AACH,MAAa,gBACZ,SAAQ,8CAA8B;IAKtC,YACkB,IAAY,EACZ,WAAoB;QAErC,KAAK,EAAE,CAAC;QAHS,SAAI,GAAJ,IAAI,CAAQ;QACZ,gBAAW,GAAX,WAAW,CAAS;QAJ5B,YAAO,GAA6B,IAAI,CAAC;IAOnD,CAAC;IAED;;;OAGG;IACH,kDAAkD;IAC3C,KAAK,CAAC,eAAe,CAAC,OAAsB;QAClD,IAAA,mBAAM,EAAC,OAAO,KAAK,IAAI,EAAE,KAAK,CAAC,wDAAwD,CAAC,CAAC;QAC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gBACR,QAAQ,EAAE,OAAO;aACjB,CAAC;YACF,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;gBACjB,IAAI,EAAE,GAAG,CAAC,QAAQ,CAAC,IAAI;gBACvB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,GAAG,CAAC,SAAS,CAAC,IAAI;gBACxB,KAAK,EAAE,IAAI;aACX,CAAC,CAAC;SACH;QAED,OAAO,IAAI,CAAC;IACb,CAAC;CACD,CAAC;AAlGU,QAAA,8BAA8B,kCAkGxC;AAEH,SAAS,iBAAiB,CAAC,IAAe;IACzC,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,OAAO,EAAE;QAChC,IAAI,IAAI,CAAC,IAAI,KAAK,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE;YACrC,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SAC9B;KACD;IACD,IAAA,mBAAM,EACL,IAAI,CAAC,EAAE,KAAK,SAAS,IAAI,IAAI,CAAC,EAAE,KAAK,IAAI,EACzC,KAAK,CAAC,+DAA+D,CACrE,CAAC;IACF,OAAO,IAAI,CAAC,EAAE,CAAC;AAChB,CAAC;AACD;;GAEG;AACU,QAAA,kCAAkC,GAAG,IAAA,sCAA8B,EAAC,gBAAgB,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport fs from \"fs\";\nimport { bufferToString } from \"@fluid-internal/client-utils\";\nimport { assert } from \"@fluidframework/core-utils\";\nimport { IDocumentStorageService, ISummaryContext } from \"@fluidframework/driver-definitions\";\nimport { buildSnapshotTree, convertSummaryTreeToSnapshotITree } from \"@fluidframework/driver-utils\";\nimport * as api from \"@fluidframework/protocol-definitions\";\nimport { IFileSnapshot, ReadDocumentStorageServiceBase } from \"@fluidframework/replay-driver\";\n\n// This ID is used by replay tool as Document Id.\n// We leverage it to figure out when container is asking for root document tree.\n/**\n * @internal\n */\nexport const FileStorageDocumentName = \"FileStorageDocId\"; // Some unique document name\n\n// Tree ID use to communicate between getVersions() & getSnapshotTree() that IVersion is ours.\nconst FileStorageVersionTreeId = \"FileStorageTreeId\";\n\n/**\n * Document storage service for the file driver.\n * @internal\n */\nexport class FluidFetchReader\n\textends ReadDocumentStorageServiceBase\n\timplements IDocumentStorageService\n{\n\tprotected docTree: api.ISnapshotTree | null = null;\n\n\tconstructor(\n\t\tprivate readonly path: string,\n\t\tprivate readonly versionName?: string,\n\t) {\n\t\tsuper();\n\t}\n\n\t/**\n\t * Read the file and returns the snapshot tree.\n\t * @param version - The version contains the path of the file which contains the snapshot tree.\n\t */\n\t// eslint-disable-next-line @rushstack/no-new-null\n\tpublic async getSnapshotTree(version?: api.IVersion): Promise<api.ISnapshotTree | null> {\n\t\tassert(version !== null, 0x092 /* \"version input for reading snapshot tree is null!\" */);\n\t\tassert(\n\t\t\t!version || version.treeId === FileStorageVersionTreeId,\n\t\t\t0x093 /* \"invalid version input for reading snapshot tree!\" */,\n\t\t);\n\n\t\tlet filename: string;\n\t\tlet rootTree = false;\n\t\tif (!version || version.id === \"latest\") {\n\t\t\tif (this.docTree) {\n\t\t\t\treturn this.docTree;\n\t\t\t}\n\t\t\tif (this.versionName === undefined) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\trootTree = true;\n\t\t\tfilename = `${this.path}/${this.versionName}/tree.json`;\n\t\t} else {\n\t\t\tfilename = `${this.path}/${this.versionName}/${version.id}.json`;\n\t\t}\n\n\t\tif (!fs.existsSync(filename)) {\n\t\t\tthrow new Error(`Can't find file ${filename}`);\n\t\t}\n\t\tconst data = fs.readFileSync(filename);\n\t\tconst tree = JSON.parse(data.toString(\"utf-8\"));\n\t\tif (rootTree) {\n\t\t\tthis.docTree = tree;\n\t\t}\n\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-return\n\t\treturn tree;\n\t}\n\n\t/**\n\t * Gets the path of the snapshot tree to be read.\n\t * @param versionId - version ID.\n\t * @param count - Number of versions to be returned.\n\t */\n\t// eslint-disable-next-line @rushstack/no-new-null\n\tpublic async getVersions(versionId: string | null, count: number): Promise<api.IVersion[]> {\n\t\tif (versionId === FileStorageDocumentName || versionId === null) {\n\t\t\tif (this.docTree !== null || this.versionName !== undefined) {\n\t\t\t\treturn [{ id: \"latest\", treeId: FileStorageVersionTreeId }];\n\t\t\t}\n\t\t\t// Started with ops - return empty set.\n\t\t\treturn [];\n\t\t} else if (this.versionName !== undefined) {\n\t\t\tassert(!!this.docTree, 0x094 /* \"Missing snapshot tree!\" */);\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tid: versionId,\n\t\t\t\t\ttreeId: FileStorageVersionTreeId,\n\t\t\t\t},\n\t\t\t];\n\t\t}\n\t\tthrow new Error(`Unknown version: ${versionId}`);\n\t}\n\n\tpublic async readBlob(sha: string): Promise<ArrayBufferLike> {\n\t\tif (this.versionName !== undefined) {\n\t\t\tconst fileName = `${this.path}/${this.versionName}/${sha}`;\n\t\t\tif (fs.existsSync(fileName)) {\n\t\t\t\tconst data = fs.readFileSync(fileName);\n\t\t\t\treturn data;\n\t\t\t}\n\t\t}\n\t\tthrow new Error(`Can't find blob ${sha}`);\n\t}\n}\n\n/**\n * @internal\n */\nexport interface ISnapshotWriterStorage extends IDocumentStorageService {\n\tonSnapshotHandler(snapshot: IFileSnapshot): void;\n\treset(): void;\n}\n\n/**\n * @internal\n */\nexport type ReaderConstructor = new (...args: any[]) => IDocumentStorageService;\n/**\n * @internal\n */\nexport const FileSnapshotWriterClassFactory = <TBase extends ReaderConstructor>(Base: TBase) =>\n\tclass extends Base implements ISnapshotWriterStorage {\n\t\t// Note: if variable name has same name as in base class, it overrides it!\n\t\tpublic blobsWriter = new Map<string, ArrayBufferLike>();\n\t\tpublic latestWriterTree?: api.ISnapshotTree;\n\t\tpublic docId?: string;\n\n\t\tpublic reset() {\n\t\t\tthis.blobsWriter = new Map<string, ArrayBufferLike>();\n\t\t\tthis.latestWriterTree = undefined;\n\t\t\tthis.docId = undefined;\n\t\t}\n\n\t\tpublic onSnapshotHandler(snapshot: IFileSnapshot): void {\n\t\t\tthrow new Error(\"onSnapshotHandler is not setup! Please provide your handler!\");\n\t\t}\n\n\t\tpublic async readBlob(sha: string): Promise<ArrayBufferLike> {\n\t\t\tconst blob = this.blobsWriter.get(sha);\n\t\t\tif (blob !== undefined) {\n\t\t\t\treturn blob;\n\t\t\t}\n\t\t\treturn super.readBlob(sha);\n\t\t}\n\n\t\t// eslint-disable-next-line @rushstack/no-new-null\n\t\tpublic async getVersions(versionId: string | null, count: number): Promise<api.IVersion[]> {\n\t\t\t// If we already saved document, that means we are getting here because of snapshot generation.\n\t\t\t// Not returning tree ensures that ContainerRuntime.snapshot() would regenerate subtrees for\n\t\t\t// each unchanged data store.\n\t\t\t// If we want to change that, we would need to capture docId on first call and return this.latestWriterTree\n\t\t\t// when latest is requested.\n\t\t\tif (this.latestWriterTree && (this.docId === versionId || versionId === null)) {\n\t\t\t\treturn [{ id: \"latest\", treeId: FileStorageVersionTreeId }];\n\t\t\t}\n\n\t\t\tif (this.docId === undefined && versionId !== null) {\n\t\t\t\tthis.docId = versionId;\n\t\t\t}\n\n\t\t\treturn super.getVersions(versionId, count);\n\t\t}\n\n\t\t// eslint-disable-next-line @rushstack/no-new-null\n\t\tpublic async getSnapshotTree(version?: api.IVersion): Promise<api.ISnapshotTree | null> {\n\t\t\tif (this.latestWriterTree && (!version || version.id === \"latest\")) {\n\t\t\t\treturn this.latestWriterTree;\n\t\t\t}\n\t\t\treturn super.getSnapshotTree(version);\n\t\t}\n\n\t\tpublic async uploadSummaryWithContext(\n\t\t\tsummary: api.ISummaryTree,\n\t\t\tcontext: ISummaryContext,\n\t\t): Promise<string> {\n\t\t\tconst tree = convertSummaryTreeToSnapshotITree(summary);\n\n\t\t\t// Remove tree IDs for easier comparison of snapshots\n\t\t\tdelete tree.id;\n\t\t\tremoveNullTreeIds(tree);\n\n\t\t\tthis.latestWriterTree = buildSnapshotTree(tree.entries, this.blobsWriter);\n\n\t\t\tconst fileSnapshot: IFileSnapshot = { tree, commits: {} };\n\t\t\tthis.onSnapshotHandler(fileSnapshot);\n\t\t\treturn \"testHandleId\";\n\t\t}\n\n\t\tpublic async buildTree(snapshotTree: api.ISnapshotTree): Promise<api.ITree> {\n\t\t\tconst tree: api.ITree = { entries: [] };\n\n\t\t\tfor (const subTreeId of Object.keys(snapshotTree.trees)) {\n\t\t\t\tconst subTree = await this.buildTree(snapshotTree.trees[subTreeId]);\n\t\t\t\ttree.entries.push({\n\t\t\t\t\tmode: api.FileMode.Directory,\n\t\t\t\t\tpath: subTreeId,\n\t\t\t\t\ttype: api.TreeEntry.Tree,\n\t\t\t\t\tvalue: subTree,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tfor (const blobName of Object.keys(snapshotTree.blobs)) {\n\t\t\t\tconst buffer = await this.readBlob(snapshotTree.blobs[blobName]);\n\t\t\t\tconst contents = bufferToString(buffer, \"utf8\");\n\t\t\t\tconst blob: api.IBlob = {\n\t\t\t\t\tcontents,\n\t\t\t\t\tencoding: \"utf-8\",\n\t\t\t\t};\n\t\t\t\ttree.entries.push({\n\t\t\t\t\tmode: api.FileMode.File,\n\t\t\t\t\tpath: blobName,\n\t\t\t\t\ttype: api.TreeEntry.Blob,\n\t\t\t\t\tvalue: blob,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn tree;\n\t\t}\n\t};\n\nfunction removeNullTreeIds(tree: api.ITree) {\n\tfor (const node of tree.entries) {\n\t\tif (node.type === api.TreeEntry.Tree) {\n\t\t\tremoveNullTreeIds(node.value);\n\t\t}\n\t}\n\tassert(\n\t\ttree.id === undefined || tree.id === null,\n\t\t0x096 /* \"Trying to remove valid tree IDs in removeNullTreeIds()!\" */,\n\t);\n\tdelete tree.id;\n}\n/**\n * @internal\n */\nexport const FluidFetchReaderFileSnapshotWriter = FileSnapshotWriterClassFactory(FluidFetchReader);\n"]}
package/dist/index.d.ts CHANGED
@@ -2,9 +2,8 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export * from "./fileDeltaStorageService";
6
- export * from "./fileDocumentService";
7
- export * from "./fileDocumentServiceFactory";
8
- export * from "./fileDocumentDeltaConnection";
9
- export * from "./fileDocumentStorageService";
5
+ export { FileDeltaStorageService } from "./fileDeltaStorageService";
6
+ export { FileDocumentServiceFactory } from "./fileDocumentServiceFactory";
7
+ export { Replayer, ReplayFileDeltaConnection } from "./fileDocumentDeltaConnection";
8
+ export { FileSnapshotWriterClassFactory, FileStorageDocumentName, FluidFetchReader, FluidFetchReaderFileSnapshotWriter, ISnapshotWriterStorage, ReaderConstructor, } from "./fileDocumentStorageService";
10
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8BAA8B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AACpF,OAAO,EACN,8BAA8B,EAC9B,uBAAuB,EACvB,gBAAgB,EAChB,kCAAkC,EAClC,sBAAsB,EACtB,iBAAiB,GACjB,MAAM,8BAA8B,CAAC"}
package/dist/index.js CHANGED
@@ -3,20 +3,18 @@
3
3
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
4
  * Licensed under the MIT License.
5
5
  */
6
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
- if (k2 === undefined) k2 = k;
8
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
6
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./fileDeltaStorageService"), exports);
18
- __exportStar(require("./fileDocumentService"), exports);
19
- __exportStar(require("./fileDocumentServiceFactory"), exports);
20
- __exportStar(require("./fileDocumentDeltaConnection"), exports);
21
- __exportStar(require("./fileDocumentStorageService"), exports);
7
+ exports.FluidFetchReaderFileSnapshotWriter = exports.FluidFetchReader = exports.FileStorageDocumentName = exports.FileSnapshotWriterClassFactory = exports.ReplayFileDeltaConnection = exports.Replayer = exports.FileDocumentServiceFactory = exports.FileDeltaStorageService = void 0;
8
+ var fileDeltaStorageService_1 = require("./fileDeltaStorageService");
9
+ Object.defineProperty(exports, "FileDeltaStorageService", { enumerable: true, get: function () { return fileDeltaStorageService_1.FileDeltaStorageService; } });
10
+ var fileDocumentServiceFactory_1 = require("./fileDocumentServiceFactory");
11
+ Object.defineProperty(exports, "FileDocumentServiceFactory", { enumerable: true, get: function () { return fileDocumentServiceFactory_1.FileDocumentServiceFactory; } });
12
+ var fileDocumentDeltaConnection_1 = require("./fileDocumentDeltaConnection");
13
+ Object.defineProperty(exports, "Replayer", { enumerable: true, get: function () { return fileDocumentDeltaConnection_1.Replayer; } });
14
+ Object.defineProperty(exports, "ReplayFileDeltaConnection", { enumerable: true, get: function () { return fileDocumentDeltaConnection_1.ReplayFileDeltaConnection; } });
15
+ var fileDocumentStorageService_1 = require("./fileDocumentStorageService");
16
+ Object.defineProperty(exports, "FileSnapshotWriterClassFactory", { enumerable: true, get: function () { return fileDocumentStorageService_1.FileSnapshotWriterClassFactory; } });
17
+ Object.defineProperty(exports, "FileStorageDocumentName", { enumerable: true, get: function () { return fileDocumentStorageService_1.FileStorageDocumentName; } });
18
+ Object.defineProperty(exports, "FluidFetchReader", { enumerable: true, get: function () { return fileDocumentStorageService_1.FluidFetchReader; } });
19
+ Object.defineProperty(exports, "FluidFetchReaderFileSnapshotWriter", { enumerable: true, get: function () { return fileDocumentStorageService_1.FluidFetchReaderFileSnapshotWriter; } });
22
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,4DAA0C;AAC1C,wDAAsC;AACtC,+DAA6C;AAC7C,gEAA8C;AAC9C,+DAA6C","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport * from \"./fileDeltaStorageService\";\nexport * from \"./fileDocumentService\";\nexport * from \"./fileDocumentServiceFactory\";\nexport * from \"./fileDocumentDeltaConnection\";\nexport * from \"./fileDocumentStorageService\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,qEAAoE;AAA3D,kIAAA,uBAAuB,OAAA;AAChC,2EAA0E;AAAjE,wIAAA,0BAA0B,OAAA;AACnC,6EAAoF;AAA3E,uHAAA,QAAQ,OAAA;AAAE,wIAAA,yBAAyB,OAAA;AAC5C,2EAOsC;AANrC,4IAAA,8BAA8B,OAAA;AAC9B,qIAAA,uBAAuB,OAAA;AACvB,8HAAA,gBAAgB,OAAA;AAChB,gJAAA,kCAAkC,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { FileDeltaStorageService } from \"./fileDeltaStorageService\";\nexport { FileDocumentServiceFactory } from \"./fileDocumentServiceFactory\";\nexport { Replayer, ReplayFileDeltaConnection } from \"./fileDocumentDeltaConnection\";\nexport {\n\tFileSnapshotWriterClassFactory,\n\tFileStorageDocumentName,\n\tFluidFetchReader,\n\tFluidFetchReaderFileSnapshotWriter,\n\tISnapshotWriterStorage,\n\tReaderConstructor,\n} from \"./fileDocumentStorageService\";\n"]}
@@ -0,0 +1,11 @@
1
+ // This file is read by tools that parse documentation comments conforming to the TSDoc standard.
2
+ // It should be published with your NPM package. It should not be tracked by Git.
3
+ {
4
+ "tsdocVersion": "0.12",
5
+ "toolPackages": [
6
+ {
7
+ "packageName": "@microsoft/api-extractor",
8
+ "packageVersion": "7.38.3"
9
+ }
10
+ ]
11
+ }
@@ -0,0 +1,51 @@
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
+ /* Excluded from this release type: FileDeltaStorageService */
28
+
29
+ /* Excluded from this release type: FileDocumentServiceFactory */
30
+
31
+ /* Excluded from this release type: FileSnapshotWriterClassFactory */
32
+
33
+ /* Excluded from this release type: FileStorageDocumentName */
34
+
35
+ /* Excluded from this release type: FluidFetchReader */
36
+
37
+ /* Excluded from this release type: FluidFetchReaderFileSnapshotWriter */
38
+
39
+ /* Excluded from this release type: IFileSnapshot */
40
+
41
+ /* Excluded from this release type: ISnapshotWriterStorage */
42
+
43
+ /* Excluded from this release type: ReadDocumentStorageServiceBase */
44
+
45
+ /* Excluded from this release type: ReaderConstructor */
46
+
47
+ /* Excluded from this release type: Replayer */
48
+
49
+ /* Excluded from this release type: ReplayFileDeltaConnection */
50
+
51
+ export { }
@@ -0,0 +1,69 @@
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
+ /* Excluded from this release type: FileDeltaStorageService */
28
+
29
+ /* Excluded from this release type: FileDocumentServiceFactory */
30
+
31
+ /* Excluded from this release type: FileSnapshotWriterClassFactory */
32
+
33
+ /* Excluded from this release type: FileStorageDocumentName */
34
+
35
+ /* Excluded from this release type: FluidFetchReader */
36
+
37
+ /* Excluded from this release type: FluidFetchReaderFileSnapshotWriter */
38
+
39
+ /* Excluded from this release type: IDocumentDeltaConnection */
40
+
41
+ /* Excluded from this release type: IDocumentDeltaConnectionEvents */
42
+
43
+ /* Excluded from this release type: IDocumentDeltaStorageService */
44
+
45
+ /* Excluded from this release type: IDocumentService */
46
+
47
+ /* Excluded from this release type: IDocumentServiceFactory */
48
+
49
+ /* Excluded from this release type: IDocumentStorageService */
50
+
51
+ /* Excluded from this release type: IFileSnapshot */
52
+
53
+ /* Excluded from this release type: IResolvedUrl */
54
+
55
+ /* Excluded from this release type: ISnapshotWriterStorage */
56
+
57
+ /* Excluded from this release type: IStream */
58
+
59
+ /* Excluded from this release type: ISummaryContext */
60
+
61
+ /* Excluded from this release type: ReadDocumentStorageServiceBase */
62
+
63
+ /* Excluded from this release type: ReaderConstructor */
64
+
65
+ /* Excluded from this release type: Replayer */
66
+
67
+ /* Excluded from this release type: ReplayFileDeltaConnection */
68
+
69
+ export { }
@@ -0,0 +1,69 @@
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
+ /* Excluded from this release type: FileDeltaStorageService */
28
+
29
+ /* Excluded from this release type: FileDocumentServiceFactory */
30
+
31
+ /* Excluded from this release type: FileSnapshotWriterClassFactory */
32
+
33
+ /* Excluded from this release type: FileStorageDocumentName */
34
+
35
+ /* Excluded from this release type: FluidFetchReader */
36
+
37
+ /* Excluded from this release type: FluidFetchReaderFileSnapshotWriter */
38
+
39
+ /* Excluded from this release type: IDocumentDeltaConnection */
40
+
41
+ /* Excluded from this release type: IDocumentDeltaConnectionEvents */
42
+
43
+ /* Excluded from this release type: IDocumentDeltaStorageService */
44
+
45
+ /* Excluded from this release type: IDocumentService */
46
+
47
+ /* Excluded from this release type: IDocumentServiceFactory */
48
+
49
+ /* Excluded from this release type: IDocumentStorageService */
50
+
51
+ /* Excluded from this release type: IFileSnapshot */
52
+
53
+ /* Excluded from this release type: IResolvedUrl */
54
+
55
+ /* Excluded from this release type: ISnapshotWriterStorage */
56
+
57
+ /* Excluded from this release type: IStream */
58
+
59
+ /* Excluded from this release type: ISummaryContext */
60
+
61
+ /* Excluded from this release type: ReadDocumentStorageServiceBase */
62
+
63
+ /* Excluded from this release type: ReaderConstructor */
64
+
65
+ /* Excluded from this release type: Replayer */
66
+
67
+ /* Excluded from this release type: ReplayFileDeltaConnection */
68
+
69
+ export { }