@fluidframework/replay-driver 2.0.0-rc.1.0.6 → 2.0.0-rc.2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/{.eslintrc.js → .eslintrc.cjs} +4 -1
  2. package/CHANGELOG.md +20 -0
  3. package/{api-extractor-esm.json → api-extractor-cjs.json} +5 -1
  4. package/api-extractor-lint.json +1 -1
  5. package/api-extractor.json +1 -1
  6. package/api-report/replay-driver.api.md +2 -13
  7. package/dist/index.d.ts +4 -4
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +12 -13
  10. package/dist/index.js.map +1 -1
  11. package/dist/package.json +3 -0
  12. package/dist/replay-driver-alpha.d.ts +1 -2
  13. package/dist/replay-driver-beta.d.ts +1 -2
  14. package/dist/replay-driver-public.d.ts +1 -2
  15. package/dist/replay-driver-untrimmed.d.ts +2 -11
  16. package/dist/replayController.d.ts +0 -1
  17. package/dist/replayController.d.ts.map +1 -1
  18. package/dist/replayController.js +0 -3
  19. package/dist/replayController.js.map +1 -1
  20. package/dist/replayDocumentDeltaConnection.d.ts +1 -1
  21. package/dist/replayDocumentDeltaConnection.d.ts.map +1 -1
  22. package/dist/replayDocumentDeltaConnection.js +2 -2
  23. package/dist/replayDocumentDeltaConnection.js.map +1 -1
  24. package/dist/replayDocumentService.d.ts +3 -2
  25. package/dist/replayDocumentService.d.ts.map +1 -1
  26. package/dist/replayDocumentService.js +7 -5
  27. package/dist/replayDocumentService.js.map +1 -1
  28. package/dist/replayDocumentServiceFactory.d.ts +1 -1
  29. package/dist/replayDocumentServiceFactory.d.ts.map +1 -1
  30. package/dist/replayDocumentServiceFactory.js +4 -4
  31. package/dist/replayDocumentServiceFactory.js.map +1 -1
  32. package/dist/storageImplementations.d.ts +4 -11
  33. package/dist/storageImplementations.d.ts.map +1 -1
  34. package/dist/storageImplementations.js +9 -22
  35. package/dist/storageImplementations.js.map +1 -1
  36. package/dist/tsdoc-metadata.json +1 -1
  37. package/lib/{emptyDeltaStorageService.d.mts → emptyDeltaStorageService.d.ts} +1 -1
  38. package/lib/emptyDeltaStorageService.d.ts.map +1 -0
  39. package/lib/{emptyDeltaStorageService.mjs → emptyDeltaStorageService.js} +1 -1
  40. package/lib/emptyDeltaStorageService.js.map +1 -0
  41. package/lib/index.d.ts +9 -0
  42. package/lib/index.d.ts.map +1 -0
  43. package/lib/index.js +9 -0
  44. package/lib/index.js.map +1 -0
  45. package/lib/{replay-driver-alpha.d.mts → replay-driver-alpha.d.ts} +1 -2
  46. package/lib/{replay-driver-beta.d.mts → replay-driver-beta.d.ts} +1 -2
  47. package/lib/{replay-driver-public.d.mts → replay-driver-public.d.ts} +1 -2
  48. package/lib/{replay-driver-untrimmed.d.mts → replay-driver-untrimmed.d.ts} +2 -11
  49. package/lib/{replayController.d.mts → replayController.d.ts} +1 -2
  50. package/lib/replayController.d.ts.map +1 -0
  51. package/lib/{replayController.mjs → replayController.js} +1 -4
  52. package/lib/replayController.js.map +1 -0
  53. package/lib/{replayDocumentDeltaConnection.d.mts → replayDocumentDeltaConnection.d.ts} +2 -2
  54. package/lib/replayDocumentDeltaConnection.d.ts.map +1 -0
  55. package/lib/{replayDocumentDeltaConnection.mjs → replayDocumentDeltaConnection.js} +2 -2
  56. package/lib/replayDocumentDeltaConnection.js.map +1 -0
  57. package/lib/{replayDocumentService.d.mts → replayDocumentService.d.ts} +4 -3
  58. package/lib/replayDocumentService.d.ts.map +1 -0
  59. package/lib/{replayDocumentService.mjs → replayDocumentService.js} +6 -4
  60. package/lib/replayDocumentService.js.map +1 -0
  61. package/lib/{replayDocumentServiceFactory.d.mts → replayDocumentServiceFactory.d.ts} +2 -2
  62. package/lib/replayDocumentServiceFactory.d.ts.map +1 -0
  63. package/lib/{replayDocumentServiceFactory.mjs → replayDocumentServiceFactory.js} +3 -3
  64. package/lib/replayDocumentServiceFactory.js.map +1 -0
  65. package/lib/{storageImplementations.d.mts → storageImplementations.d.ts} +5 -12
  66. package/lib/storageImplementations.d.ts.map +1 -0
  67. package/lib/{storageImplementations.mjs → storageImplementations.js} +6 -18
  68. package/lib/storageImplementations.js.map +1 -0
  69. package/lib/test/types/validateReplayDriverPrevious.generated.d.ts +2 -0
  70. package/lib/test/types/validateReplayDriverPrevious.generated.d.ts.map +1 -0
  71. package/lib/test/types/{validateReplayDriverPrevious.generated.mjs → validateReplayDriverPrevious.generated.js} +16 -8
  72. package/lib/test/types/validateReplayDriverPrevious.generated.js.map +1 -0
  73. package/package.json +50 -48
  74. package/src/index.ts +4 -5
  75. package/src/replayController.ts +0 -4
  76. package/src/replayDocumentDeltaConnection.ts +1 -1
  77. package/src/replayDocumentService.ts +11 -5
  78. package/src/replayDocumentServiceFactory.ts +3 -3
  79. package/src/storageImplementations.ts +11 -21
  80. package/tsconfig.cjs.json +7 -0
  81. package/tsconfig.json +2 -5
  82. package/lib/emptyDeltaStorageService.d.mts.map +0 -1
  83. package/lib/emptyDeltaStorageService.mjs.map +0 -1
  84. package/lib/index.d.mts +0 -9
  85. package/lib/index.d.mts.map +0 -1
  86. package/lib/index.mjs +0 -9
  87. package/lib/index.mjs.map +0 -1
  88. package/lib/replayController.d.mts.map +0 -1
  89. package/lib/replayController.mjs.map +0 -1
  90. package/lib/replayDocumentDeltaConnection.d.mts.map +0 -1
  91. package/lib/replayDocumentDeltaConnection.mjs.map +0 -1
  92. package/lib/replayDocumentService.d.mts.map +0 -1
  93. package/lib/replayDocumentService.mjs.map +0 -1
  94. package/lib/replayDocumentServiceFactory.d.mts.map +0 -1
  95. package/lib/replayDocumentServiceFactory.mjs.map +0 -1
  96. package/lib/storageImplementations.d.mts.map +0 -1
  97. package/lib/storageImplementations.mjs.map +0 -1
  98. package/lib/test/types/validateReplayDriverPrevious.generated.d.mts +0 -2
  99. package/lib/test/types/validateReplayDriverPrevious.generated.d.mts.map +0 -1
  100. package/lib/test/types/validateReplayDriverPrevious.generated.mjs.map +0 -1
@@ -4,7 +4,10 @@
4
4
  */
5
5
 
6
6
  module.exports = {
7
- extends: [require.resolve("@fluidframework/eslint-config-fluid/minimal"), "prettier"],
7
+ extends: [
8
+ require.resolve("@fluidframework/eslint-config-fluid/minimal-deprecated"),
9
+ "prettier",
10
+ ],
8
11
  rules: {
9
12
  "@typescript-eslint/strict-boolean-expressions": "off",
10
13
  },
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @fluidframework/replay-driver
2
2
 
3
+ ## 2.0.0-rc.2.0.0
4
+
5
+ ### Minor Changes
6
+
7
+ - replay-driver: Remove OpStorage export ([#19523](https://github.com/microsoft/FluidFramework/issues/19523)) [614917026e](https://github.com/microsoft/FluidFramework/commits/614917026e799dda7bc36e71ab56fb0a401a1156)
8
+
9
+ The OpStorage class was non-functional, and has been removed.
10
+
11
+ - driver-definitions: repositoryUrl removed from IDocumentStorageService ([#19522](https://github.com/microsoft/FluidFramework/issues/19522)) [90eb3c9d33](https://github.com/microsoft/FluidFramework/commits/90eb3c9d33d80e24caa1393a50f414c5602f6aa3)
12
+
13
+ The `repositoryUrl` member of `IDocumentStorageService` was unused and always equal to the empty string. It has been removed.
14
+
15
+ - container-definitions: Added containerMetadata prop on IContainer interface ([#19142](https://github.com/microsoft/FluidFramework/issues/19142)) [d0d77f3516](https://github.com/microsoft/FluidFramework/commits/d0d77f3516d67f3c9faedb47b20dbd4e309c3bc2)
16
+
17
+ Added `containerMetadata` prop on IContainer interface.
18
+
19
+ - runtime-definitions: Moved ISignalEnvelope interface to core-interfaces ([#19142](https://github.com/microsoft/FluidFramework/issues/19142)) [d0d77f3516](https://github.com/microsoft/FluidFramework/commits/d0d77f3516d67f3c9faedb47b20dbd4e309c3bc2)
20
+
21
+ The `ISignalEnvelope` interface has been moved to the @fluidframework/core-interfaces package.
22
+
3
23
  ## 2.0.0-rc.1.0.0
4
24
 
5
25
  ### Minor Changes
@@ -1,4 +1,8 @@
1
1
  {
2
2
  "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
- "extends": "../../../common/build/build-common/api-extractor-base-esm.json"
3
+ "extends": "../../../common/build/build-common/api-extractor-base.cjs.primary.json",
4
+ // CJS is actually secondary; so, no report.
5
+ "apiReport": {
6
+ "enabled": false
7
+ }
4
8
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
- "extends": "../../../common/build/build-common/api-extractor-lint.json"
3
+ "extends": "../../../common/build/build-common/api-extractor-lint.esm.primary.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
- "extends": "../../../common/build/build-common/api-extractor-base.json"
3
+ "extends": "../../../common/build/build-common/api-extractor-base.esm.primary.json"
4
4
  }
@@ -18,6 +18,7 @@ import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
18
18
  import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
19
19
  import { ITree } from '@fluidframework/protocol-definitions';
20
20
  import { IVersion } from '@fluidframework/protocol-definitions';
21
+ import { TypedEventEmitter } from '@fluid-internal/client-utils';
21
22
 
22
23
  // @internal (undocumented)
23
24
  export class FileSnapshotReader extends ReadDocumentStorageServiceBase implements IDocumentStorageService {
@@ -56,16 +57,6 @@ export interface IFileSnapshot {
56
57
  tree: ITree;
57
58
  }
58
59
 
59
- // @internal (undocumented)
60
- export class OpStorage extends ReadDocumentStorageServiceBase {
61
- // (undocumented)
62
- getSnapshotTree(version?: IVersion): Promise<ISnapshotTree | null>;
63
- // (undocumented)
64
- getVersions(versionId: string | null, count: number): Promise<IVersion[]>;
65
- // (undocumented)
66
- readBlob(blobId: string): Promise<ArrayBufferLike>;
67
- }
68
-
69
60
  // @internal
70
61
  export abstract class ReadDocumentStorageServiceBase implements IDocumentStorageService {
71
62
  // (undocumented)
@@ -79,8 +70,6 @@ export abstract class ReadDocumentStorageServiceBase implements IDocumentStorage
79
70
  // (undocumented)
80
71
  abstract readBlob(blobId: string): Promise<ArrayBufferLike>;
81
72
  // (undocumented)
82
- get repositoryUrl(): string;
83
- // (undocumented)
84
73
  uploadSummaryWithContext(summary: api.ISummaryTree, context: ISummaryContext): Promise<string>;
85
74
  }
86
75
 
@@ -94,7 +83,7 @@ export abstract class ReplayController extends ReadDocumentStorageServiceBase {
94
83
  }
95
84
 
96
85
  // @internal
97
- export class ReplayDocumentService implements api_2.IDocumentService {
86
+ export class ReplayDocumentService extends TypedEventEmitter<api_2.IDocumentServiceEvents> implements api_2.IDocumentService {
98
87
  constructor(controller: api_2.IDocumentStorageService, deltaStorage: api_2.IDocumentDeltaConnection);
99
88
  connectToDeltaStorage(): Promise<api_2.IDocumentDeltaStorageService>;
100
89
  connectToDeltaStream(client: IClient): Promise<api_2.IDocumentDeltaConnection>;
package/dist/index.d.ts CHANGED
@@ -2,8 +2,8 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { ReadDocumentStorageServiceBase, ReplayController } from "./replayController";
6
- export { ReplayDocumentService } from "./replayDocumentService";
7
- export { ReplayDocumentServiceFactory } from "./replayDocumentServiceFactory";
8
- export { FileSnapshotReader, IFileSnapshot, OpStorage, SnapshotStorage, StaticStorageDocumentServiceFactory, } from "./storageImplementations";
5
+ export { ReadDocumentStorageServiceBase, ReplayController } from "./replayController.js";
6
+ export { ReplayDocumentService } from "./replayDocumentService.js";
7
+ export { ReplayDocumentServiceFactory } from "./replayDocumentServiceFactory.js";
8
+ export { FileSnapshotReader, IFileSnapshot, SnapshotStorage, StaticStorageDocumentServiceFactory, } from "./storageImplementations.js";
9
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,OAAO,EAAE,8BAA8B,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtF,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EACN,kBAAkB,EAClB,aAAa,EACb,SAAS,EACT,eAAe,EACf,mCAAmC,GACnC,MAAM,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,8BAA8B,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzF,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,EACN,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,mCAAmC,GACnC,MAAM,6BAA6B,CAAC"}
package/dist/index.js CHANGED
@@ -4,17 +4,16 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.StaticStorageDocumentServiceFactory = exports.SnapshotStorage = exports.OpStorage = exports.FileSnapshotReader = exports.ReplayDocumentServiceFactory = exports.ReplayDocumentService = exports.ReplayController = exports.ReadDocumentStorageServiceBase = void 0;
8
- var replayController_1 = require("./replayController");
9
- Object.defineProperty(exports, "ReadDocumentStorageServiceBase", { enumerable: true, get: function () { return replayController_1.ReadDocumentStorageServiceBase; } });
10
- Object.defineProperty(exports, "ReplayController", { enumerable: true, get: function () { return replayController_1.ReplayController; } });
11
- var replayDocumentService_1 = require("./replayDocumentService");
12
- Object.defineProperty(exports, "ReplayDocumentService", { enumerable: true, get: function () { return replayDocumentService_1.ReplayDocumentService; } });
13
- var replayDocumentServiceFactory_1 = require("./replayDocumentServiceFactory");
14
- Object.defineProperty(exports, "ReplayDocumentServiceFactory", { enumerable: true, get: function () { return replayDocumentServiceFactory_1.ReplayDocumentServiceFactory; } });
15
- var storageImplementations_1 = require("./storageImplementations");
16
- Object.defineProperty(exports, "FileSnapshotReader", { enumerable: true, get: function () { return storageImplementations_1.FileSnapshotReader; } });
17
- Object.defineProperty(exports, "OpStorage", { enumerable: true, get: function () { return storageImplementations_1.OpStorage; } });
18
- Object.defineProperty(exports, "SnapshotStorage", { enumerable: true, get: function () { return storageImplementations_1.SnapshotStorage; } });
19
- Object.defineProperty(exports, "StaticStorageDocumentServiceFactory", { enumerable: true, get: function () { return storageImplementations_1.StaticStorageDocumentServiceFactory; } });
7
+ exports.StaticStorageDocumentServiceFactory = exports.SnapshotStorage = exports.FileSnapshotReader = exports.ReplayDocumentServiceFactory = exports.ReplayDocumentService = exports.ReplayController = exports.ReadDocumentStorageServiceBase = void 0;
8
+ var replayController_js_1 = require("./replayController.js");
9
+ Object.defineProperty(exports, "ReadDocumentStorageServiceBase", { enumerable: true, get: function () { return replayController_js_1.ReadDocumentStorageServiceBase; } });
10
+ Object.defineProperty(exports, "ReplayController", { enumerable: true, get: function () { return replayController_js_1.ReplayController; } });
11
+ var replayDocumentService_js_1 = require("./replayDocumentService.js");
12
+ Object.defineProperty(exports, "ReplayDocumentService", { enumerable: true, get: function () { return replayDocumentService_js_1.ReplayDocumentService; } });
13
+ var replayDocumentServiceFactory_js_1 = require("./replayDocumentServiceFactory.js");
14
+ Object.defineProperty(exports, "ReplayDocumentServiceFactory", { enumerable: true, get: function () { return replayDocumentServiceFactory_js_1.ReplayDocumentServiceFactory; } });
15
+ var storageImplementations_js_1 = require("./storageImplementations.js");
16
+ Object.defineProperty(exports, "FileSnapshotReader", { enumerable: true, get: function () { return storageImplementations_js_1.FileSnapshotReader; } });
17
+ Object.defineProperty(exports, "SnapshotStorage", { enumerable: true, get: function () { return storageImplementations_js_1.SnapshotStorage; } });
18
+ Object.defineProperty(exports, "StaticStorageDocumentServiceFactory", { enumerable: true, get: function () { return storageImplementations_js_1.StaticStorageDocumentServiceFactory; } });
20
19
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,uDAAsF;AAA7E,kIAAA,8BAA8B,OAAA;AAAE,oHAAA,gBAAgB,OAAA;AACzD,iEAAgE;AAAvD,8HAAA,qBAAqB,OAAA;AAC9B,+EAA8E;AAArE,4IAAA,4BAA4B,OAAA;AACrC,mEAMkC;AALjC,4HAAA,kBAAkB,OAAA;AAElB,mHAAA,SAAS,OAAA;AACT,yHAAA,eAAe,OAAA;AACf,6IAAA,mCAAmC,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { ReadDocumentStorageServiceBase, ReplayController } from \"./replayController\";\nexport { ReplayDocumentService } from \"./replayDocumentService\";\nexport { ReplayDocumentServiceFactory } from \"./replayDocumentServiceFactory\";\nexport {\n\tFileSnapshotReader,\n\tIFileSnapshot,\n\tOpStorage,\n\tSnapshotStorage,\n\tStaticStorageDocumentServiceFactory,\n} from \"./storageImplementations\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6DAAyF;AAAhF,qIAAA,8BAA8B,OAAA;AAAE,uHAAA,gBAAgB,OAAA;AACzD,uEAAmE;AAA1D,iIAAA,qBAAqB,OAAA;AAC9B,qFAAiF;AAAxE,+IAAA,4BAA4B,OAAA;AACrC,yEAKqC;AAJpC,+HAAA,kBAAkB,OAAA;AAElB,4HAAA,eAAe,OAAA;AACf,gJAAA,mCAAmC,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { ReadDocumentStorageServiceBase, ReplayController } from \"./replayController.js\";\nexport { ReplayDocumentService } from \"./replayDocumentService.js\";\nexport { ReplayDocumentServiceFactory } from \"./replayDocumentServiceFactory.js\";\nexport {\n\tFileSnapshotReader,\n\tIFileSnapshot,\n\tSnapshotStorage,\n\tStaticStorageDocumentServiceFactory,\n} from \"./storageImplementations.js\";\n"]}
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
@@ -12,13 +12,12 @@ import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
12
12
  import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
13
13
  import { ITree } from '@fluidframework/protocol-definitions';
14
14
  import { IVersion } from '@fluidframework/protocol-definitions';
15
+ import { TypedEventEmitter } from '@fluid-internal/client-utils';
15
16
 
16
17
  /* Excluded from this release type: FileSnapshotReader */
17
18
 
18
19
  /* Excluded from this release type: IFileSnapshot */
19
20
 
20
- /* Excluded from this release type: OpStorage */
21
-
22
21
  /* Excluded from this release type: ReadDocumentStorageServiceBase */
23
22
 
24
23
  /* Excluded from this release type: ReplayController */
@@ -12,6 +12,7 @@ import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
12
12
  import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
13
13
  import { ITree } from '@fluidframework/protocol-definitions';
14
14
  import { IVersion } from '@fluidframework/protocol-definitions';
15
+ import { TypedEventEmitter } from '@fluid-internal/client-utils';
15
16
 
16
17
  /* Excluded from this release type: FileSnapshotReader */
17
18
 
@@ -27,8 +28,6 @@ import { IVersion } from '@fluidframework/protocol-definitions';
27
28
 
28
29
  /* Excluded from this release type: ISummaryContext */
29
30
 
30
- /* Excluded from this release type: OpStorage */
31
-
32
31
  /* Excluded from this release type: ReadDocumentStorageServiceBase */
33
32
 
34
33
  /* Excluded from this release type: ReplayController */
@@ -12,6 +12,7 @@ import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
12
12
  import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
13
13
  import { ITree } from '@fluidframework/protocol-definitions';
14
14
  import { IVersion } from '@fluidframework/protocol-definitions';
15
+ import { TypedEventEmitter } from '@fluid-internal/client-utils';
15
16
 
16
17
  /* Excluded from this release type: FileSnapshotReader */
17
18
 
@@ -27,8 +28,6 @@ import { IVersion } from '@fluidframework/protocol-definitions';
27
28
 
28
29
  /* Excluded from this release type: ISummaryContext */
29
30
 
30
- /* Excluded from this release type: OpStorage */
31
-
32
31
  /* Excluded from this release type: ReadDocumentStorageServiceBase */
33
32
 
34
33
  /* Excluded from this release type: ReplayController */
@@ -12,6 +12,7 @@ import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
12
12
  import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
13
13
  import { ITree } from '@fluidframework/protocol-definitions';
14
14
  import { IVersion } from '@fluidframework/protocol-definitions';
15
+ import { TypedEventEmitter } from '@fluid-internal/client-utils';
15
16
 
16
17
  /**
17
18
  * @internal
@@ -44,15 +45,6 @@ export declare interface IFileSnapshot {
44
45
  };
45
46
  }
46
47
 
47
- /**
48
- * @internal
49
- */
50
- export declare class OpStorage extends ReadDocumentStorageServiceBase {
51
- getVersions(versionId: string | null, count: number): Promise<IVersion[]>;
52
- getSnapshotTree(version?: IVersion): Promise<ISnapshotTree | null>;
53
- readBlob(blobId: string): Promise<ArrayBufferLike>;
54
- }
55
-
56
48
  /**
57
49
  * Partial implementation of IDocumentStorageService
58
50
  * @internal
@@ -64,7 +56,6 @@ export declare abstract class ReadDocumentStorageServiceBase implements IDocumen
64
56
  uploadSummaryWithContext(summary: api.ISummaryTree, context: ISummaryContext): Promise<string>;
65
57
  createBlob(file: ArrayBufferLike): Promise<api.ICreateBlobResponse>;
66
58
  downloadSummary(handle: api.ISummaryHandle): Promise<api.ISummaryTree>;
67
- get repositoryUrl(): string;
68
59
  }
69
60
 
70
61
  /**
@@ -117,7 +108,7 @@ export declare abstract class ReplayController extends ReadDocumentStorageServic
117
108
  * and emitting them with a pre determined delay
118
109
  * @internal
119
110
  */
120
- export declare class ReplayDocumentService implements api_2.IDocumentService {
111
+ export declare class ReplayDocumentService extends TypedEventEmitter<api_2.IDocumentServiceEvents> implements api_2.IDocumentService {
121
112
  private readonly controller;
122
113
  private readonly deltaStorage;
123
114
  static create(documentService: api_2.IDocumentService, controller: ReplayController): Promise<api_2.IDocumentService>;
@@ -15,7 +15,6 @@ export declare abstract class ReadDocumentStorageServiceBase implements IDocumen
15
15
  uploadSummaryWithContext(summary: api.ISummaryTree, context: ISummaryContext): Promise<string>;
16
16
  createBlob(file: ArrayBufferLike): Promise<api.ICreateBlobResponse>;
17
17
  downloadSummary(handle: api.ISummaryHandle): Promise<api.ISummaryTree>;
18
- get repositoryUrl(): string;
19
18
  }
20
19
  /**
21
20
  * Replay controller object
@@ -1 +1 @@
1
- {"version":3,"file":"replayController.d.ts","sourceRoot":"","sources":["../src/replayController.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,gBAAgB,EAChB,uBAAuB,EACvB,eAAe,EACf,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,GAAG,MAAM,sCAAsC,CAAC;AAE5D;;;GAGG;AACH,8BAAsB,8BAA+B,YAAW,uBAAuB;aACtE,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;aAC7E,eAAe,CAAC,OAAO,CAAC,EAAE,GAAG,CAAC,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,GAAG,IAAI,CAAC;aAC1E,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAErD,wBAAwB,CACpC,OAAO,EAAE,GAAG,CAAC,YAAY,EACzB,OAAO,EAAE,eAAe,GACtB,OAAO,CAAC,MAAM,CAAC;IAIL,UAAU,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC;IAInE,eAAe,CAAC,MAAM,EAAE,GAAG,CAAC,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;IAInF,IAA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AO,CAAC,MAAM,CAAC;IAIL,UAAU,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC;IAInE,eAAe,CAAC,MAAM,EAAE,GAAG,CAAC,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;CAGnF;AAED;;;;;GAKG;AACH,8BAAsB,gBAAiB,SAAQ,8BAA8B;IAC5E;;;;;OAKG;aACa,WAAW,CAAC,eAAe,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC;IAEhF;;;OAGG;aACa,qBAAqB,IAAI,OAAO,CAAC,MAAM,CAAC;IAExD;;;;OAIG;aACa,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAE9D;;;;;;;;OAQG;aACa,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO;IAE/E;;;;;OAKG;aACa,MAAM,CACrB,OAAO,EAAE,CAAC,EAAE,EAAE,GAAG,CAAC,yBAAyB,EAAE,KAAK,IAAI,EACtD,UAAU,EAAE,GAAG,CAAC,yBAAyB,EAAE,GACzC,OAAO,CAAC,IAAI,CAAC;CAChB"}
@@ -19,9 +19,6 @@ class ReadDocumentStorageServiceBase {
19
19
  async downloadSummary(handle) {
20
20
  throw new Error("Invalid operation");
21
21
  }
22
- get repositoryUrl() {
23
- throw new Error("Invalid operation");
24
- }
25
22
  }
26
23
  exports.ReadDocumentStorageServiceBase = ReadDocumentStorageServiceBase;
27
24
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"replayController.js","sourceRoot":"","sources":["../src/replayController.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AASH;;;GAGG;AACH,MAAsB,8BAA8B;IAK5C,KAAK,CAAC,wBAAwB,CACpC,OAAyB,EACzB,OAAwB;QAExB,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACtC,CAAC;IAEM,KAAK,CAAC,UAAU,CAAC,IAAqB;QAC5C,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACtC,CAAC;IAEM,KAAK,CAAC,eAAe,CAAC,MAA0B;QACtD,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACtC,CAAC;IAED,IAAW,aAAa;QACvB,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACtC,CAAC;CACD;AAvBD,wEAuBC;AAED;;;;;GAKG;AACH,MAAsB,gBAAiB,SAAQ,8BAA8B;CA2C5E;AA3CD,4CA2CC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIDocumentService,\n\tIDocumentStorageService,\n\tISummaryContext,\n} from \"@fluidframework/driver-definitions\";\nimport * as api from \"@fluidframework/protocol-definitions\";\n\n/**\n * Partial implementation of IDocumentStorageService\n * @internal\n */\nexport abstract class ReadDocumentStorageServiceBase implements IDocumentStorageService {\n\tpublic abstract getVersions(versionId: string | null, count: number): Promise<api.IVersion[]>;\n\tpublic abstract getSnapshotTree(version?: api.IVersion): Promise<api.ISnapshotTree | null>;\n\tpublic abstract readBlob(blobId: string): Promise<ArrayBufferLike>;\n\n\tpublic async uploadSummaryWithContext(\n\t\tsummary: api.ISummaryTree,\n\t\tcontext: ISummaryContext,\n\t): Promise<string> {\n\t\tthrow new Error(\"Invalid operation\");\n\t}\n\n\tpublic async createBlob(file: ArrayBufferLike): Promise<api.ICreateBlobResponse> {\n\t\tthrow new Error(\"Invalid operation\");\n\t}\n\n\tpublic async downloadSummary(handle: api.ISummaryHandle): Promise<api.ISummaryTree> {\n\t\tthrow new Error(\"Invalid operation\");\n\t}\n\n\tpublic get repositoryUrl(): string {\n\t\tthrow new Error(\"Invalid operation\");\n\t}\n}\n\n/**\n * Replay controller object\n * It controls where we start (snapshot, local file, no snapshots)\n * As well as dispatch of ops\n * @internal\n */\nexport abstract class ReplayController extends ReadDocumentStorageServiceBase {\n\t/**\n\t * Initialize reply controller\n\t * @param documentService - the real document service\n\t * @returns Whether or not the controller should be used.\n\t * If `false` is returned, caller should fallback to original storage.\n\t */\n\tpublic abstract initStorage(documentService: IDocumentService): Promise<boolean>;\n\n\t/**\n\t * Returns sequence number to start processing ops\n\t * Should be zero if not using snapshot, and snapshot seq# otherwise\n\t */\n\tpublic abstract getStartingOpSequence(): Promise<number>;\n\n\t/**\n\t * Returns last op number to fetch from current op\n\t * Note: this API is called while replay() is in progress - next batch of ops is downloaded in parallel\n\t * @param currentOp - current op\n\t */\n\tpublic abstract fetchTo(currentOp: number): number | undefined;\n\n\t/**\n\t * Returns true if no more ops should be processed (or downloaded for future processing).\n\t * It's called at end of each batch with latest op timestamp.\n\t * Also it's called when there are no more ops available (lastTimeStamp === undefined).\n\t * If false is returned and there are no more ops, request for more ops is made every 2 seconds.\n\t * Note: this API is called while replay() is in progress - next batch of ops is downloaded in parallel\n\t * @param currentOp - current op\n\t * @param lastTimeStamp - timestamp of last op (if more ops are available). Undefined otherwise.\n\t */\n\tpublic abstract isDoneFetch(currentOp: number, lastTimeStamp?: number): boolean;\n\n\t/**\n\t * Replay batch of ops\n\t * NOTE: new batch of ops is fetched (fetchTo() & isDoneFetch() APIs are called) while this call is in flights\n\t * @param emitter - callback to emit ops\n\t * @param fetchedOps - ops to process\n\t */\n\tpublic abstract replay(\n\t\temitter: (op: api.ISequencedDocumentMessage[]) => void,\n\t\tfetchedOps: api.ISequencedDocumentMessage[],\n\t): Promise<void>;\n}\n"]}
1
+ {"version":3,"file":"replayController.js","sourceRoot":"","sources":["../src/replayController.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AASH;;;GAGG;AACH,MAAsB,8BAA8B;IAK5C,KAAK,CAAC,wBAAwB,CACpC,OAAyB,EACzB,OAAwB;QAExB,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACtC,CAAC;IAEM,KAAK,CAAC,UAAU,CAAC,IAAqB;QAC5C,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACtC,CAAC;IAEM,KAAK,CAAC,eAAe,CAAC,MAA0B;QACtD,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACtC,CAAC;CACD;AAnBD,wEAmBC;AAED;;;;;GAKG;AACH,MAAsB,gBAAiB,SAAQ,8BAA8B;CA2C5E;AA3CD,4CA2CC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIDocumentService,\n\tIDocumentStorageService,\n\tISummaryContext,\n} from \"@fluidframework/driver-definitions\";\nimport * as api from \"@fluidframework/protocol-definitions\";\n\n/**\n * Partial implementation of IDocumentStorageService\n * @internal\n */\nexport abstract class ReadDocumentStorageServiceBase implements IDocumentStorageService {\n\tpublic abstract getVersions(versionId: string | null, count: number): Promise<api.IVersion[]>;\n\tpublic abstract getSnapshotTree(version?: api.IVersion): Promise<api.ISnapshotTree | null>;\n\tpublic abstract readBlob(blobId: string): Promise<ArrayBufferLike>;\n\n\tpublic async uploadSummaryWithContext(\n\t\tsummary: api.ISummaryTree,\n\t\tcontext: ISummaryContext,\n\t): Promise<string> {\n\t\tthrow new Error(\"Invalid operation\");\n\t}\n\n\tpublic async createBlob(file: ArrayBufferLike): Promise<api.ICreateBlobResponse> {\n\t\tthrow new Error(\"Invalid operation\");\n\t}\n\n\tpublic async downloadSummary(handle: api.ISummaryHandle): Promise<api.ISummaryTree> {\n\t\tthrow new Error(\"Invalid operation\");\n\t}\n}\n\n/**\n * Replay controller object\n * It controls where we start (snapshot, local file, no snapshots)\n * As well as dispatch of ops\n * @internal\n */\nexport abstract class ReplayController extends ReadDocumentStorageServiceBase {\n\t/**\n\t * Initialize reply controller\n\t * @param documentService - the real document service\n\t * @returns Whether or not the controller should be used.\n\t * If `false` is returned, caller should fallback to original storage.\n\t */\n\tpublic abstract initStorage(documentService: IDocumentService): Promise<boolean>;\n\n\t/**\n\t * Returns sequence number to start processing ops\n\t * Should be zero if not using snapshot, and snapshot seq# otherwise\n\t */\n\tpublic abstract getStartingOpSequence(): Promise<number>;\n\n\t/**\n\t * Returns last op number to fetch from current op\n\t * Note: this API is called while replay() is in progress - next batch of ops is downloaded in parallel\n\t * @param currentOp - current op\n\t */\n\tpublic abstract fetchTo(currentOp: number): number | undefined;\n\n\t/**\n\t * Returns true if no more ops should be processed (or downloaded for future processing).\n\t * It's called at end of each batch with latest op timestamp.\n\t * Also it's called when there are no more ops available (lastTimeStamp === undefined).\n\t * If false is returned and there are no more ops, request for more ops is made every 2 seconds.\n\t * Note: this API is called while replay() is in progress - next batch of ops is downloaded in parallel\n\t * @param currentOp - current op\n\t * @param lastTimeStamp - timestamp of last op (if more ops are available). Undefined otherwise.\n\t */\n\tpublic abstract isDoneFetch(currentOp: number, lastTimeStamp?: number): boolean;\n\n\t/**\n\t * Replay batch of ops\n\t * NOTE: new batch of ops is fetched (fetchTo() & isDoneFetch() APIs are called) while this call is in flights\n\t * @param emitter - callback to emit ops\n\t * @param fetchedOps - ops to process\n\t */\n\tpublic abstract replay(\n\t\temitter: (op: api.ISequencedDocumentMessage[]) => void,\n\t\tfetchedOps: api.ISequencedDocumentMessage[],\n\t): Promise<void>;\n}\n"]}
@@ -6,7 +6,7 @@ import { IDisposable } from "@fluidframework/core-interfaces";
6
6
  import { IDocumentDeltaConnection, IDocumentDeltaStorageService, IDocumentDeltaConnectionEvents, IDocumentService } from "@fluidframework/driver-definitions";
7
7
  import { ConnectionMode, IClientConfiguration, IConnected, IDocumentMessage, ISequencedDocumentMessage, ISignalClient, ISignalMessage, ITokenClaims, IVersion } from "@fluidframework/protocol-definitions";
8
8
  import { TypedEventEmitter } from "@fluid-internal/client-utils";
9
- import { ReplayController } from "./replayController";
9
+ import { ReplayController } from "./replayController.js";
10
10
  export declare class ReplayControllerStatic extends ReplayController {
11
11
  readonly replayFrom: number;
12
12
  readonly replayTo: number;
@@ -1 +1 @@
1
- {"version":3,"file":"replayDoc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OAEG;YACW,eAAe;CA2C7B"}
@@ -8,9 +8,9 @@ exports.ReplayDocumentDeltaConnection = exports.ReplayControllerStatic = void 0;
8
8
  const protocol_definitions_1 = require("@fluidframework/protocol-definitions");
9
9
  const client_utils_1 = require("@fluid-internal/client-utils");
10
10
  const core_utils_1 = require("@fluidframework/core-utils");
11
- const replayController_1 = require("./replayController");
11
+ const replayController_js_1 = require("./replayController.js");
12
12
  const ReplayDocumentId = "documentId";
13
- class ReplayControllerStatic extends replayController_1.ReplayController {
13
+ class ReplayControllerStatic extends replayController_js_1.ReplayController {
14
14
  // Simulated delay interval for emitting the ops
15
15
  /**
16
16
  * Helper class
@@ -1 +1 @@
1
- {"version":3,"file":"replayDocumentDeltaConnection.js","sourceRoot":"","sources":["../src/replayDocumentDeltaConnection.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AASH,+EAW8C;AAC9C,+DAAiE;AACjE,2DAAmD;AACnD,yDAAsD;AAEtD,MAAM,gBAAgB,GAAG,YAAY,CAAC;AAEtC,MAAa,sBAAuB,SAAQ,mCAAgB;IAM3D,gDAAgD;IAEhD;;;;;;OAMG;IACH,YACiB,UAAkB,EAClB,QAAgB,EAChB,UAAoB;QAEpC,KAAK,EAAE,CAAC;QAJQ,eAAU,GAAV,UAAU,CAAQ;QAClB,aAAQ,GAAR,QAAQ,CAAQ;QAChB,eAAU,GAAV,UAAU,CAAU;QAb7B,kBAAa,GAAG,CAAC,CAAC;QAgBzB,IAAI,UAAU,KAAK,IAAI,EAAE;YACxB,qFAAqF;YACrF,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;SAClB;IACF,CAAC;IAEM,KAAK,CAAC,WAAW,CAAC,eAAiC;QACzD,OAAO,IAAI,CAAC;IACb,CAAC;IAEM,KAAK,CAAC,WAAW,CAAC,SAAwB,EAAE,KAAa;QAC/D,OAAO,EAAE,CAAC;IACX,CAAC;IAEM,KAAK,CAAC,eAAe,CAAC,OAAkB;QAC9C,OAAO,OAAO,CAAC,CAA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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\tIDocumentDeltaStorageService,\n\tIDocumentDeltaConnectionEvents,\n\tIDocumentService,\n} from \"@fluidframework/driver-definitions\";\nimport {\n\tConnectionMode,\n\tIClientConfiguration,\n\tIConnected,\n\tIDocumentMessage,\n\tISequencedDocumentMessage,\n\tISignalClient,\n\tISignalMessage,\n\tITokenClaims,\n\tIVersion,\n\tScopeType,\n} from \"@fluidframework/protocol-definitions\";\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport { delay } from \"@fluidframework/core-utils\";\nimport { ReplayController } from \"./replayController\";\n\nconst ReplayDocumentId = \"documentId\";\n\nexport class ReplayControllerStatic extends ReplayController {\n\tprivate static readonly DelayInterval = 50;\n\tprivate static readonly ReplayResolution = 15;\n\n\tprivate firstTimeStamp: number | undefined;\n\tprivate replayCurrent = 0;\n\t// Simulated delay interval for emitting the ops\n\n\t/**\n\t * Helper class\n\t *\n\t * @param replayFrom - First op to be played on socket.\n\t * @param replayTo - Last op number to be played on socket.\n\t * @param unitIsTime - True is user want to play ops that are within a replay resolution window.\n\t */\n\tpublic constructor(\n\t\tpublic readonly replayFrom: number,\n\t\tpublic readonly replayTo: number,\n\t\tpublic readonly unitIsTime?: boolean,\n\t) {\n\t\tsuper();\n\t\tif (unitIsTime !== true) {\n\t\t\t// There is no code in here to start with snapshot, thus we have to start with op #0.\n\t\t\tthis.replayTo = 0;\n\t\t}\n\t}\n\n\tpublic async initStorage(documentService: IDocumentService) {\n\t\treturn true;\n\t}\n\n\tpublic async getVersions(versionId: string | null, count: number): Promise<IVersion[]> {\n\t\treturn [];\n\t}\n\n\tpublic async getSnapshotTree(version?: IVersion) {\n\t\treturn version ? Promise.reject(new Error(\"Invalid operation\")) : null;\n\t}\n\n\tpublic async readBlob(blobId: string): Promise<ArrayBufferLike> {\n\t\tthrow new Error(\"Invalid operation\");\n\t}\n\n\tpublic async getStartingOpSequence(): Promise<number> {\n\t\treturn 0;\n\t}\n\n\tpublic fetchTo(currentOp: number) {\n\t\tif (!(this.unitIsTime !== true && this.replayTo >= 0)) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn this.replayTo;\n\t}\n\n\tpublic isDoneFetch(currentOp: number, lastTimeStamp?: number) {\n\t\tif (this.replayTo >= 0) {\n\t\t\tif (this.unitIsTime === true) {\n\t\t\t\treturn (\n\t\t\t\t\tlastTimeStamp !== undefined &&\n\t\t\t\t\tthis.firstTimeStamp !== undefined &&\n\t\t\t\t\tlastTimeStamp - this.firstTimeStamp >= this.replayTo\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn currentOp >= this.replayTo;\n\t\t}\n\t\treturn lastTimeStamp === undefined; // No more ops\n\t}\n\n\tpublic skipToIndex(fetchedOps: ISequencedDocumentMessage[]) {\n\t\tif (this.replayFrom <= 0) {\n\t\t\treturn 0;\n\t\t}\n\t\tif (this.unitIsTime === true) {\n\t\t\tfor (let i = 0; i < fetchedOps.length; i += 1) {\n\t\t\t\tconst timeStamp = fetchedOps[i].timestamp;\n\t\t\t\tif (timeStamp !== undefined) {\n\t\t\t\t\tif (this.firstTimeStamp === undefined) {\n\t\t\t\t\t\tthis.firstTimeStamp = timeStamp;\n\t\t\t\t\t}\n\t\t\t\t\tif (timeStamp - this.firstTimeStamp >= this.replayFrom) {\n\t\t\t\t\t\treturn i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (this.replayFrom > this.replayCurrent) {\n\t\t\treturn this.replayFrom - this.replayCurrent;\n\t\t}\n\t\treturn 0;\n\t}\n\n\tpublic async replay(\n\t\temitter: (op: ISequencedDocumentMessage[]) => void,\n\t\tfetchedOps: ISequencedDocumentMessage[],\n\t): Promise<void> {\n\t\tlet current = this.skipToIndex(fetchedOps);\n\n\t\treturn new Promise((resolve) => {\n\t\t\tconst replayNextOps = () => {\n\t\t\t\t// Emit the ops from replay to the end every \"deltainterval\" milliseconds\n\t\t\t\t// to simulate the socket stream\n\t\t\t\tconst currentOp = fetchedOps[current];\n\t\t\t\tconst playbackOps = [currentOp];\n\t\t\t\tlet nextInterval = ReplayControllerStatic.DelayInterval;\n\t\t\t\tcurrent += 1;\n\n\t\t\t\tif (this.unitIsTime === true) {\n\t\t\t\t\tconst currentTimeStamp = currentOp.timestamp;\n\t\t\t\t\tif (currentTimeStamp !== undefined) {\n\t\t\t\t\t\t// Emit more ops that is in the ReplayResolution window\n\n\t\t\t\t\t\twhile (current < fetchedOps.length) {\n\t\t\t\t\t\t\tconst op = fetchedOps[current];\n\t\t\t\t\t\t\tif (op.timestamp === undefined) {\n\t\t\t\t\t\t\t\t// Missing timestamp, just delay the standard amount of time\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst timeDiff = op.timestamp - currentTimeStamp;\n\t\t\t\t\t\t\tif (timeDiff >= ReplayControllerStatic.ReplayResolution) {\n\t\t\t\t\t\t\t\t// Time exceeded the resolution window, break out the loop\n\t\t\t\t\t\t\t\t// and delay for the time difference.\n\t\t\t\t\t\t\t\tnextInterval = timeDiff;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (timeDiff < 0) {\n\t\t\t\t\t\t\t\t// Time have regressed, just delay the standard amount of time\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// The op is within the ReplayResolution emit it now\n\t\t\t\t\t\t\tplaybackOps.push(op);\n\t\t\t\t\t\t\tcurrent += 1;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tthis.firstTimeStamp !== undefined &&\n\t\t\t\t\t\t\tthis.replayTo >= 0 &&\n\t\t\t\t\t\t\tcurrentTimeStamp + nextInterval - this.firstTimeStamp > this.replayTo\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tnextInterval = -1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tscheduleNext(nextInterval);\n\t\t\t\temitter(playbackOps);\n\t\t\t};\n\t\t\tconst scheduleNext = (nextInterval: number) => {\n\t\t\t\tif (nextInterval >= 0 && current < fetchedOps.length) {\n\t\t\t\t\tsetTimeout(replayNextOps, nextInterval);\n\t\t\t\t} else {\n\t\t\t\t\tthis.replayCurrent += current;\n\t\t\t\t\tresolve();\n\t\t\t\t}\n\t\t\t};\n\t\t\tscheduleNext(ReplayControllerStatic.DelayInterval);\n\t\t});\n\t}\n}\n\nexport class ReplayDocumentDeltaConnection\n\textends TypedEventEmitter<IDocumentDeltaConnectionEvents>\n\timplements IDocumentDeltaConnection, IDisposable\n{\n\t/**\n\t * Creates a new delta connection and mimics the delta connection to replay ops on it.\n\t * @param documentService - The document service to be used to get underlying endpoints.\n\t */\n\tpublic static create(\n\t\tdocumentStorageService: IDocumentDeltaStorageService,\n\t\tcontroller: ReplayController,\n\t): IDocumentDeltaConnection {\n\t\tconst connection: IConnected = {\n\t\t\tclaims: ReplayDocumentDeltaConnection.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: ReplayDocumentDeltaConnection.ReplayMaxMessageSize,\n\t\t\tmode: \"read\",\n\t\t\tserviceConfiguration: {\n\t\t\t\tblockSize: 64436,\n\t\t\t\tmaxMessageSize: ReplayDocumentDeltaConnection.ReplayMaxMessageSize,\n\t\t\t},\n\t\t\tsupportedVersions: [ReplayDocumentDeltaConnection.replayProtocolVersion],\n\t\t\tversion: ReplayDocumentDeltaConnection.replayProtocolVersion,\n\t\t};\n\t\tconst deltaConnection = new ReplayDocumentDeltaConnection(connection);\n\t\t// eslint-disable-next-line @typescript-eslint/no-floating-promises\n\t\tdeltaConnection.fetchAndEmitOps(documentStorageService, controller);\n\n\t\treturn deltaConnection;\n\t}\n\n\tprivate static readonly replayProtocolVersion = \"^0.1.0\";\n\t// Since the replay service never actually sends messages the size below is arbitrary\n\tprivate static readonly ReplayMaxMessageSize = 16 * 1024;\n\n\tprivate static readonly claims: ITokenClaims = {\n\t\tdocumentId: ReplayDocumentId,\n\t\tscopes: [ScopeType.DocRead],\n\t\ttenantId: \"\",\n\t\tuser: {\n\t\t\tid: \"\",\n\t\t},\n\t\tiat: Math.round(new Date().getTime() / 1000),\n\t\texp: Math.round(new Date().getTime() / 1000) + 60 * 60, // 1 hour expiration\n\t\tver: \"1.0\",\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 readonly maxMessageSize = ReplayDocumentDeltaConnection.ReplayMaxMessageSize;\n\n\tconstructor(public details: IConnected) {\n\t\tsuper();\n\t}\n\n\tpublic submit(documentMessage: IDocumentMessage[]): void {\n\t\t// ReplayDocumentDeltaConnection.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(\"ReplayDocumentDeltaConnection.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\t/**\n\t * This gets the specified ops from the delta storage endpoint and replays them in the replayer.\n\t */\n\tprivate async fetchAndEmitOps(\n\t\tdocumentStorageService: IDocumentDeltaStorageService,\n\t\tcontroller: ReplayController,\n\t): Promise<void> {\n\t\tlet done;\n\t\tlet replayPromiseChain = Promise.resolve();\n\n\t\tlet currentOp = await controller.getStartingOpSequence();\n\n\t\tdo {\n\t\t\tconst fetchTo = controller.fetchTo(currentOp);\n\n\t\t\tconst abortController = new AbortController();\n\t\t\tconst stream = documentStorageService.fetchMessages(\n\t\t\t\tcurrentOp + 1,\n\t\t\t\tfetchTo,\n\t\t\t\tabortController.signal,\n\t\t\t);\n\t\t\tdo {\n\t\t\t\tconst result = await stream.read();\n\n\t\t\t\tif (result.done) {\n\t\t\t\t\t// No more ops. But, they can show up later, either because document was just created,\n\t\t\t\t\t// or because another client keeps submitting new ops.\n\t\t\t\t\tdone = controller.isDoneFetch(currentOp, undefined);\n\t\t\t\t\tif (!done) {\n\t\t\t\t\t\tawait delay(2000);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\treplayPromiseChain = replayPromiseChain.then(async () =>\n\t\t\t\t\tcontroller.replay((ops) => this.emit(\"op\", ReplayDocumentId, ops), messages),\n\t\t\t\t);\n\n\t\t\t\tconst messages = result.value;\n\t\t\t\tcurrentOp += messages.length;\n\t\t\t\tdone = controller.isDoneFetch(currentOp, messages[messages.length - 1].timestamp);\n\t\t\t} while (!done);\n\n\t\t\tabortController.abort();\n\t\t} while (!done);\n\t\treturn replayPromiseChain;\n\t}\n}\n"]}
1
+ {"version":3,"file":"replayDocumentDeltaConnection.js","sourceRoot":"","sources":["../src/replayDocumentDeltaConnection.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AASH,+EAW8C;AAC9C,+DAAiE;AACjE,2DAAmD;AACnD,+DAAyD;AAEzD,MAAM,gBAAgB,GAAG,YAAY,CAAC;AAEt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AAE;QAChB,OAAO,kBAAkB,CAAC;IAC3B,CAAC;;AA1JF,sEA2JC;AAxHwB,mDAAqB,GAAG,QAAQ,AAAX,CAAY;AACzD,qFAAqF;AAC7D,kDAAoB,GAAG,EAAE,GAAG,IAAI,AAAZ,CAAa;AAEjC,oCAAM,GAAiB;IAC9C,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,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE;IACtD,GAAG,EAAE,KAAK;CACV,AAV6B,CAU5B","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\tIDocumentDeltaStorageService,\n\tIDocumentDeltaConnectionEvents,\n\tIDocumentService,\n} from \"@fluidframework/driver-definitions\";\nimport {\n\tConnectionMode,\n\tIClientConfiguration,\n\tIConnected,\n\tIDocumentMessage,\n\tISequencedDocumentMessage,\n\tISignalClient,\n\tISignalMessage,\n\tITokenClaims,\n\tIVersion,\n\tScopeType,\n} from \"@fluidframework/protocol-definitions\";\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport { delay } from \"@fluidframework/core-utils\";\nimport { ReplayController } from \"./replayController.js\";\n\nconst ReplayDocumentId = \"documentId\";\n\nexport class ReplayControllerStatic extends ReplayController {\n\tprivate static readonly DelayInterval = 50;\n\tprivate static readonly ReplayResolution = 15;\n\n\tprivate firstTimeStamp: number | undefined;\n\tprivate replayCurrent = 0;\n\t// Simulated delay interval for emitting the ops\n\n\t/**\n\t * Helper class\n\t *\n\t * @param replayFrom - First op to be played on socket.\n\t * @param replayTo - Last op number to be played on socket.\n\t * @param unitIsTime - True is user want to play ops that are within a replay resolution window.\n\t */\n\tpublic constructor(\n\t\tpublic readonly replayFrom: number,\n\t\tpublic readonly replayTo: number,\n\t\tpublic readonly unitIsTime?: boolean,\n\t) {\n\t\tsuper();\n\t\tif (unitIsTime !== true) {\n\t\t\t// There is no code in here to start with snapshot, thus we have to start with op #0.\n\t\t\tthis.replayTo = 0;\n\t\t}\n\t}\n\n\tpublic async initStorage(documentService: IDocumentService) {\n\t\treturn true;\n\t}\n\n\tpublic async getVersions(versionId: string | null, count: number): Promise<IVersion[]> {\n\t\treturn [];\n\t}\n\n\tpublic async getSnapshotTree(version?: IVersion) {\n\t\treturn version ? Promise.reject(new Error(\"Invalid operation\")) : null;\n\t}\n\n\tpublic async readBlob(blobId: string): Promise<ArrayBufferLike> {\n\t\tthrow new Error(\"Invalid operation\");\n\t}\n\n\tpublic async getStartingOpSequence(): Promise<number> {\n\t\treturn 0;\n\t}\n\n\tpublic fetchTo(currentOp: number) {\n\t\tif (!(this.unitIsTime !== true && this.replayTo >= 0)) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn this.replayTo;\n\t}\n\n\tpublic isDoneFetch(currentOp: number, lastTimeStamp?: number) {\n\t\tif (this.replayTo >= 0) {\n\t\t\tif (this.unitIsTime === true) {\n\t\t\t\treturn (\n\t\t\t\t\tlastTimeStamp !== undefined &&\n\t\t\t\t\tthis.firstTimeStamp !== undefined &&\n\t\t\t\t\tlastTimeStamp - this.firstTimeStamp >= this.replayTo\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn currentOp >= this.replayTo;\n\t\t}\n\t\treturn lastTimeStamp === undefined; // No more ops\n\t}\n\n\tpublic skipToIndex(fetchedOps: ISequencedDocumentMessage[]) {\n\t\tif (this.replayFrom <= 0) {\n\t\t\treturn 0;\n\t\t}\n\t\tif (this.unitIsTime === true) {\n\t\t\tfor (let i = 0; i < fetchedOps.length; i += 1) {\n\t\t\t\tconst timeStamp = fetchedOps[i].timestamp;\n\t\t\t\tif (timeStamp !== undefined) {\n\t\t\t\t\tif (this.firstTimeStamp === undefined) {\n\t\t\t\t\t\tthis.firstTimeStamp = timeStamp;\n\t\t\t\t\t}\n\t\t\t\t\tif (timeStamp - this.firstTimeStamp >= this.replayFrom) {\n\t\t\t\t\t\treturn i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (this.replayFrom > this.replayCurrent) {\n\t\t\treturn this.replayFrom - this.replayCurrent;\n\t\t}\n\t\treturn 0;\n\t}\n\n\tpublic async replay(\n\t\temitter: (op: ISequencedDocumentMessage[]) => void,\n\t\tfetchedOps: ISequencedDocumentMessage[],\n\t): Promise<void> {\n\t\tlet current = this.skipToIndex(fetchedOps);\n\n\t\treturn new Promise((resolve) => {\n\t\t\tconst replayNextOps = () => {\n\t\t\t\t// Emit the ops from replay to the end every \"deltainterval\" milliseconds\n\t\t\t\t// to simulate the socket stream\n\t\t\t\tconst currentOp = fetchedOps[current];\n\t\t\t\tconst playbackOps = [currentOp];\n\t\t\t\tlet nextInterval = ReplayControllerStatic.DelayInterval;\n\t\t\t\tcurrent += 1;\n\n\t\t\t\tif (this.unitIsTime === true) {\n\t\t\t\t\tconst currentTimeStamp = currentOp.timestamp;\n\t\t\t\t\tif (currentTimeStamp !== undefined) {\n\t\t\t\t\t\t// Emit more ops that is in the ReplayResolution window\n\n\t\t\t\t\t\twhile (current < fetchedOps.length) {\n\t\t\t\t\t\t\tconst op = fetchedOps[current];\n\t\t\t\t\t\t\tif (op.timestamp === undefined) {\n\t\t\t\t\t\t\t\t// Missing timestamp, just delay the standard amount of time\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst timeDiff = op.timestamp - currentTimeStamp;\n\t\t\t\t\t\t\tif (timeDiff >= ReplayControllerStatic.ReplayResolution) {\n\t\t\t\t\t\t\t\t// Time exceeded the resolution window, break out the loop\n\t\t\t\t\t\t\t\t// and delay for the time difference.\n\t\t\t\t\t\t\t\tnextInterval = timeDiff;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (timeDiff < 0) {\n\t\t\t\t\t\t\t\t// Time have regressed, just delay the standard amount of time\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// The op is within the ReplayResolution emit it now\n\t\t\t\t\t\t\tplaybackOps.push(op);\n\t\t\t\t\t\t\tcurrent += 1;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tthis.firstTimeStamp !== undefined &&\n\t\t\t\t\t\t\tthis.replayTo >= 0 &&\n\t\t\t\t\t\t\tcurrentTimeStamp + nextInterval - this.firstTimeStamp > this.replayTo\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tnextInterval = -1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tscheduleNext(nextInterval);\n\t\t\t\temitter(playbackOps);\n\t\t\t};\n\t\t\tconst scheduleNext = (nextInterval: number) => {\n\t\t\t\tif (nextInterval >= 0 && current < fetchedOps.length) {\n\t\t\t\t\tsetTimeout(replayNextOps, nextInterval);\n\t\t\t\t} else {\n\t\t\t\t\tthis.replayCurrent += current;\n\t\t\t\t\tresolve();\n\t\t\t\t}\n\t\t\t};\n\t\t\tscheduleNext(ReplayControllerStatic.DelayInterval);\n\t\t});\n\t}\n}\n\nexport class ReplayDocumentDeltaConnection\n\textends TypedEventEmitter<IDocumentDeltaConnectionEvents>\n\timplements IDocumentDeltaConnection, IDisposable\n{\n\t/**\n\t * Creates a new delta connection and mimics the delta connection to replay ops on it.\n\t * @param documentService - The document service to be used to get underlying endpoints.\n\t */\n\tpublic static create(\n\t\tdocumentStorageService: IDocumentDeltaStorageService,\n\t\tcontroller: ReplayController,\n\t): IDocumentDeltaConnection {\n\t\tconst connection: IConnected = {\n\t\t\tclaims: ReplayDocumentDeltaConnection.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: ReplayDocumentDeltaConnection.ReplayMaxMessageSize,\n\t\t\tmode: \"read\",\n\t\t\tserviceConfiguration: {\n\t\t\t\tblockSize: 64436,\n\t\t\t\tmaxMessageSize: ReplayDocumentDeltaConnection.ReplayMaxMessageSize,\n\t\t\t},\n\t\t\tsupportedVersions: [ReplayDocumentDeltaConnection.replayProtocolVersion],\n\t\t\tversion: ReplayDocumentDeltaConnection.replayProtocolVersion,\n\t\t};\n\t\tconst deltaConnection = new ReplayDocumentDeltaConnection(connection);\n\t\t// eslint-disable-next-line @typescript-eslint/no-floating-promises\n\t\tdeltaConnection.fetchAndEmitOps(documentStorageService, controller);\n\n\t\treturn deltaConnection;\n\t}\n\n\tprivate static readonly replayProtocolVersion = \"^0.1.0\";\n\t// Since the replay service never actually sends messages the size below is arbitrary\n\tprivate static readonly ReplayMaxMessageSize = 16 * 1024;\n\n\tprivate static readonly claims: ITokenClaims = {\n\t\tdocumentId: ReplayDocumentId,\n\t\tscopes: [ScopeType.DocRead],\n\t\ttenantId: \"\",\n\t\tuser: {\n\t\t\tid: \"\",\n\t\t},\n\t\tiat: Math.round(new Date().getTime() / 1000),\n\t\texp: Math.round(new Date().getTime() / 1000) + 60 * 60, // 1 hour expiration\n\t\tver: \"1.0\",\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 readonly maxMessageSize = ReplayDocumentDeltaConnection.ReplayMaxMessageSize;\n\n\tconstructor(public details: IConnected) {\n\t\tsuper();\n\t}\n\n\tpublic submit(documentMessage: IDocumentMessage[]): void {\n\t\t// ReplayDocumentDeltaConnection.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(\"ReplayDocumentDeltaConnection.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\t/**\n\t * This gets the specified ops from the delta storage endpoint and replays them in the replayer.\n\t */\n\tprivate async fetchAndEmitOps(\n\t\tdocumentStorageService: IDocumentDeltaStorageService,\n\t\tcontroller: ReplayController,\n\t): Promise<void> {\n\t\tlet done;\n\t\tlet replayPromiseChain = Promise.resolve();\n\n\t\tlet currentOp = await controller.getStartingOpSequence();\n\n\t\tdo {\n\t\t\tconst fetchTo = controller.fetchTo(currentOp);\n\n\t\t\tconst abortController = new AbortController();\n\t\t\tconst stream = documentStorageService.fetchMessages(\n\t\t\t\tcurrentOp + 1,\n\t\t\t\tfetchTo,\n\t\t\t\tabortController.signal,\n\t\t\t);\n\t\t\tdo {\n\t\t\t\tconst result = await stream.read();\n\n\t\t\t\tif (result.done) {\n\t\t\t\t\t// No more ops. But, they can show up later, either because document was just created,\n\t\t\t\t\t// or because another client keeps submitting new ops.\n\t\t\t\t\tdone = controller.isDoneFetch(currentOp, undefined);\n\t\t\t\t\tif (!done) {\n\t\t\t\t\t\tawait delay(2000);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\treplayPromiseChain = replayPromiseChain.then(async () =>\n\t\t\t\t\tcontroller.replay((ops) => this.emit(\"op\", ReplayDocumentId, ops), messages),\n\t\t\t\t);\n\n\t\t\t\tconst messages = result.value;\n\t\t\t\tcurrentOp += messages.length;\n\t\t\t\tdone = controller.isDoneFetch(currentOp, messages[messages.length - 1].timestamp);\n\t\t\t} while (!done);\n\n\t\t\tabortController.abort();\n\t\t} while (!done);\n\t\treturn replayPromiseChain;\n\t}\n}\n"]}
@@ -2,16 +2,17 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
+ import { TypedEventEmitter } from "@fluid-internal/client-utils";
5
6
  import * as api from "@fluidframework/driver-definitions";
6
7
  import { IClient } from "@fluidframework/protocol-definitions";
7
- import { ReplayController } from "./replayController";
8
+ import { ReplayController } from "./replayController.js";
8
9
  /**
9
10
  * The Replay document service dummies out the snapshot and the delta storage.
10
11
  * Delta connection simulates the socket by fetching the ops from delta storage
11
12
  * and emitting them with a pre determined delay
12
13
  * @internal
13
14
  */
14
- export declare class ReplayDocumentService implements api.IDocumentService {
15
+ export declare class ReplayDocumentService extends TypedEventEmitter<api.IDocumentServiceEvents> implements api.IDocumentService {
15
16
  private readonly controller;
16
17
  private readonly deltaStorage;
17
18
  static create(documentService: api.IDocumentService, controller: ReplayController): Promise<api.IDocumentService>;
@@ -1 +1 @@
1
- {"version":3,"file":"replayDocumentService.d.ts","sourceRoot":"","sources":["../src/replayDocumentService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,GAAG,MAAM,oCAAoC,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAC;AAE/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD;;;;;GAKG;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AAG,CAAC,gBAAgB,CAAC;gBAcd,UAAU,EAAE,GAAG,CAAC,uBAAuB,EACvC,YAAY,EAAE,GAAG,CAAC,wBAAwB;IAKrD,OAAO;IAGd,IAAW,WAAW,IAAI,GAAG,CAAC,YAAY,CAEzC;IAED;;;OAGG;IACU,gBAAgB,IAAI,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC;IAIrE;;;OAGG;IACU,qBAAqB,IAAI,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC;IAI/E;;;;;OAKG;IACU,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC;CAGzF"}
@@ -5,8 +5,9 @@
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.ReplayDocumentService = void 0;
8
- const emptyDeltaStorageService_1 = require("./emptyDeltaStorageService");
9
- const replayDocumentDeltaConnection_1 = require("./replayDocumentDeltaConnection");
8
+ const client_utils_1 = require("@fluid-internal/client-utils");
9
+ const emptyDeltaStorageService_js_1 = require("./emptyDeltaStorageService.js");
10
+ const replayDocumentDeltaConnection_js_1 = require("./replayDocumentDeltaConnection.js");
10
11
  /**
11
12
  * The Replay document service dummies out the snapshot and the delta storage.
12
13
  * Delta connection simulates the socket by fetching the ops from delta storage
@@ -14,16 +15,17 @@ const replayDocumentDeltaConnection_1 = require("./replayDocumentDeltaConnection
14
15
  * @internal
15
16
  */
16
17
  // eslint-disable-next-line import/namespace
17
- class ReplayDocumentService {
18
+ class ReplayDocumentService extends client_utils_1.TypedEventEmitter {
18
19
  static async create(documentService, controller) {
19
20
  const useController = await controller.initStorage(documentService);
20
21
  if (!useController) {
21
22
  return documentService;
22
23
  }
23
- const deltaConnection = replayDocumentDeltaConnection_1.ReplayDocumentDeltaConnection.create(await documentService.connectToDeltaStorage(), controller);
24
+ const deltaConnection = replayDocumentDeltaConnection_js_1.ReplayDocumentDeltaConnection.create(await documentService.connectToDeltaStorage(), controller);
24
25
  return new ReplayDocumentService(controller, deltaConnection);
25
26
  }
26
27
  constructor(controller, deltaStorage) {
28
+ super();
27
29
  this.controller = controller;
28
30
  this.deltaStorage = deltaStorage;
29
31
  }
@@ -44,7 +46,7 @@ class ReplayDocumentService {
44
46
  * @returns returns the dummy document delta storage service for replay driver.
45
47
  */
46
48
  async connectToDeltaStorage() {
47
- return new emptyDeltaStorageService_1.EmptyDeltaStorageService();
49
+ return new emptyDeltaStorageService_js_1.EmptyDeltaStorageService();
48
50
  }
49
51
  /**
50
52
  * Connects to a delta storage endpoint of provided documentService to get ops and then replaying
@@ -1 +1 @@
1
- {"version":3,"file":"replayDocumentService.js","sourceRoot":"","sources":["../src/replayDocumentService.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,yEAAsE;AAEtE,mFAAgF;AAEhF;;;;;GAKG;AACH,4CAA4C;AAC5C,MAAa,qBAAqB;IAC1B,MAAM,CAAC,KAAK,CAAC,MAAM,CACzB,eAAqC,EACrC,UAA4B;QAE5B,MAAM,aAAa,GAAG,MAAM,UAAU,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;QACpE,IAAI,CAAC,aAAa,EAAE;YACnB,OAAO,eAAe,CAAC;SACvB;QAED,MAAM,eAAe,GAAG,6DAA6B,CAAC,MAAM,CAC3D,MAAM,eAAe,CAAC,qBAAqB,EAAE,EAC7C,UAAU,CACV,CAAC;QACF,OAAO,IAAI,qBAAqB,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;IAC/D,CAAC;IAED,YACkB,UAAuC,EACvC,YAA0C;QAD1C,eAAU,GAAV,UAAU,CAA6B;QACvC,iBAAY,GAAZ,YAAY,CAA8B;IACzD,CAAC;IAEG,OAAO,KAAI,CAAC;IAEnB,8EAA8E;IAC9E,IAAW,WAAW;QACrB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACpC,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,gBAAgB;QAC5B,OAAO,IAAI,CAAC,UAAU,CAAC;IACxB,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,qBAAqB;QACjC,OAAO,IAAI,mDAAwB,EAAE,CAAC;IACvC,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,oBAAoB,CAAC,MAAe;QAChD,OAAO,IAAI,CAAC,YAAY,CAAC;IAC1B,CAAC;CACD;AAtDD,sDAsDC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as api from \"@fluidframework/driver-definitions\";\nimport { IClient } from \"@fluidframework/protocol-definitions\";\nimport { EmptyDeltaStorageService } from \"./emptyDeltaStorageService\";\nimport { ReplayController } from \"./replayController\";\nimport { ReplayDocumentDeltaConnection } from \"./replayDocumentDeltaConnection\";\n\n/**\n * The Replay document service dummies out the snapshot and the delta storage.\n * Delta connection simulates the socket by fetching the ops from delta storage\n * and emitting them with a pre determined delay\n * @internal\n */\n// eslint-disable-next-line import/namespace\nexport class ReplayDocumentService implements api.IDocumentService {\n\tpublic static async create(\n\t\tdocumentService: api.IDocumentService,\n\t\tcontroller: ReplayController,\n\t): Promise<api.IDocumentService> {\n\t\tconst useController = await controller.initStorage(documentService);\n\t\tif (!useController) {\n\t\t\treturn documentService;\n\t\t}\n\n\t\tconst deltaConnection = ReplayDocumentDeltaConnection.create(\n\t\t\tawait documentService.connectToDeltaStorage(),\n\t\t\tcontroller,\n\t\t);\n\t\treturn new ReplayDocumentService(controller, deltaConnection);\n\t}\n\n\tconstructor(\n\t\tprivate readonly controller: api.IDocumentStorageService,\n\t\tprivate readonly deltaStorage: api.IDocumentDeltaConnection,\n\t) {}\n\n\tpublic dispose() {}\n\n\t// TODO: Issue-2109 Implement detach container api or put appropriate comment.\n\tpublic get resolvedUrl(): api.IResolvedUrl {\n\t\tthrow new Error(\"Not implemented\");\n\t}\n\n\t/**\n\t * Connects to a storage endpoint for snapshot service and blobs.\n\t * @returns returns the dummy document storage service for replay driver.\n\t */\n\tpublic async connectToStorage(): Promise<api.IDocumentStorageService> {\n\t\treturn this.controller;\n\t}\n\n\t/**\n\t * Connects to a delta storage endpoint for getting ops between a range.\n\t * @returns returns the dummy document delta storage service for replay driver.\n\t */\n\tpublic async connectToDeltaStorage(): Promise<api.IDocumentDeltaStorageService> {\n\t\treturn new EmptyDeltaStorageService();\n\t}\n\n\t/**\n\t * Connects to a delta storage endpoint of provided documentService to get ops and then replaying\n\t * them so as to mimic a delta stream endpoint.\n\t * @param client - Client that connects to socket.\n\t * @returns returns the delta stream service which replay ops from --from to --to arguments.\n\t */\n\tpublic async connectToDeltaStream(client: IClient): Promise<api.IDocumentDeltaConnection> {\n\t\treturn this.deltaStorage;\n\t}\n}\n"]}
1
+ {"version":3,"file":"replayDocumentService.js","sourceRoot":"","sources":["../src/replayDocumentService.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAiE;AAGjE,+EAAyE;AAEzE,yFAAmF;AAEnF;;;;;GAKG;AACH,4CAA4C;AAC5C,MAAa,qBACZ,SAAQ,gCAA6C;IAG9C,MAAM,CAAC,KAAK,CAAC,MAAM,CACzB,eAAqC,EACrC,UAA4B;QAE5B,MAAM,aAAa,GAAG,MAAM,UAAU,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;QACpE,IAAI,CAAC,aAAa,EAAE;YACnB,OAAO,eAAe,CAAC;SACvB;QAED,MAAM,eAAe,GAAG,gEAA6B,CAAC,MAAM,CAC3D,MAAM,eAAe,CAAC,qBAAqB,EAAE,EAC7C,UAAU,CACV,CAAC;QACF,OAAO,IAAI,qBAAqB,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;IAC/D,CAAC;IAED,YACkB,UAAuC,EACvC,YAA0C;QAE3D,KAAK,EAAE,CAAC;QAHS,eAAU,GAAV,UAAU,CAA6B;QACvC,iBAAY,GAAZ,YAAY,CAA8B;IAG5D,CAAC;IAEM,OAAO,KAAI,CAAC;IAEnB,8EAA8E;IAC9E,IAAW,WAAW;QACrB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACpC,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,gBAAgB;QAC5B,OAAO,IAAI,CAAC,UAAU,CAAC;IACxB,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,qBAAqB;QACjC,OAAO,IAAI,sDAAwB,EAAE,CAAC;IACvC,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,oBAAoB,CAAC,MAAe;QAChD,OAAO,IAAI,CAAC,YAAY,CAAC;IAC1B,CAAC;CACD;AA3DD,sDA2DC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport * as api from \"@fluidframework/driver-definitions\";\nimport { IClient } from \"@fluidframework/protocol-definitions\";\nimport { EmptyDeltaStorageService } from \"./emptyDeltaStorageService.js\";\nimport { ReplayController } from \"./replayController.js\";\nimport { ReplayDocumentDeltaConnection } from \"./replayDocumentDeltaConnection.js\";\n\n/**\n * The Replay document service dummies out the snapshot and the delta storage.\n * Delta connection simulates the socket by fetching the ops from delta storage\n * and emitting them with a pre determined delay\n * @internal\n */\n// eslint-disable-next-line import/namespace\nexport class ReplayDocumentService\n\textends TypedEventEmitter<api.IDocumentServiceEvents>\n\timplements api.IDocumentService\n{\n\tpublic static async create(\n\t\tdocumentService: api.IDocumentService,\n\t\tcontroller: ReplayController,\n\t): Promise<api.IDocumentService> {\n\t\tconst useController = await controller.initStorage(documentService);\n\t\tif (!useController) {\n\t\t\treturn documentService;\n\t\t}\n\n\t\tconst deltaConnection = ReplayDocumentDeltaConnection.create(\n\t\t\tawait documentService.connectToDeltaStorage(),\n\t\t\tcontroller,\n\t\t);\n\t\treturn new ReplayDocumentService(controller, deltaConnection);\n\t}\n\n\tconstructor(\n\t\tprivate readonly controller: api.IDocumentStorageService,\n\t\tprivate readonly deltaStorage: api.IDocumentDeltaConnection,\n\t) {\n\t\tsuper();\n\t}\n\n\tpublic dispose() {}\n\n\t// TODO: Issue-2109 Implement detach container api or put appropriate comment.\n\tpublic get resolvedUrl(): api.IResolvedUrl {\n\t\tthrow new Error(\"Not implemented\");\n\t}\n\n\t/**\n\t * Connects to a storage endpoint for snapshot service and blobs.\n\t * @returns returns the dummy document storage service for replay driver.\n\t */\n\tpublic async connectToStorage(): Promise<api.IDocumentStorageService> {\n\t\treturn this.controller;\n\t}\n\n\t/**\n\t * Connects to a delta storage endpoint for getting ops between a range.\n\t * @returns returns the dummy document delta storage service for replay driver.\n\t */\n\tpublic async connectToDeltaStorage(): Promise<api.IDocumentDeltaStorageService> {\n\t\treturn new EmptyDeltaStorageService();\n\t}\n\n\t/**\n\t * Connects to a delta storage endpoint of provided documentService to get ops and then replaying\n\t * them so as to mimic a delta stream endpoint.\n\t * @param client - Client that connects to socket.\n\t * @returns returns the delta stream service which replay ops from --from to --to arguments.\n\t */\n\tpublic async connectToDeltaStream(client: IClient): Promise<api.IDocumentDeltaConnection> {\n\t\treturn this.deltaStorage;\n\t}\n}\n"]}
@@ -5,7 +5,7 @@
5
5
  import { IDocumentService, IDocumentServiceFactory, IResolvedUrl } from "@fluidframework/driver-definitions";
6
6
  import { ISummaryTree } from "@fluidframework/protocol-definitions";
7
7
  import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
8
- import { ReplayController } from "./replayController";
8
+ import { ReplayController } from "./replayController.js";
9
9
  /**
10
10
  * @internal
11
11
  */
@@ -1 +1 @@
1
- {"version":3,"file":"replayDocumentServiceFactory.d.ts","sourceRoot":"","sources":["../src/replayDocumentServiceFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,gBAAgB,EAChB,uBAAuB,EACvB,YAAY,EACZ,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAEvE,OAAO,E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,EAC/C,UAAU,EAAE,gBAAgB;IAG9C;;;;;OAKG;IACU,qBAAqB,CACjC,WAAW,EAAE,YAAY,EACzB,MAAM,CAAC,EAAE,oBAAoB,EAC7B,kBAAkB,CAAC,EAAE,OAAO,GAC1B,OAAO,CAAC,gBAAgB,CAAC;IAmBf,eAAe,CAC3B,gBAAgB,EAAE,YAAY,EAC9B,WAAW,EAAE,YAAY,EACzB,MAAM,CAAC,EAAE,oBAAoB,EAC7B,kBAAkB,CAAC,EAAE,OAAO,GAC1B,OAAO,CAAC,gBAAgB,CAAC;CAG5B"}
@@ -6,14 +6,14 @@
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.ReplayDocumentServiceFactory = void 0;
8
8
  const telemetry_utils_1 = require("@fluidframework/telemetry-utils");
9
- const replayDocumentDeltaConnection_1 = require("./replayDocumentDeltaConnection");
10
- const replayDocumentService_1 = require("./replayDocumentService");
9
+ const replayDocumentDeltaConnection_js_1 = require("./replayDocumentDeltaConnection.js");
10
+ const replayDocumentService_js_1 = require("./replayDocumentService.js");
11
11
  /**
12
12
  * @internal
13
13
  */
14
14
  class ReplayDocumentServiceFactory {
15
15
  static create(from, to, documentServiceFactory) {
16
- return new ReplayDocumentServiceFactory(documentServiceFactory, new replayDocumentDeltaConnection_1.ReplayControllerStatic(from, to));
16
+ return new ReplayDocumentServiceFactory(documentServiceFactory, new replayDocumentDeltaConnection_js_1.ReplayControllerStatic(from, to));
17
17
  }
18
18
  constructor(documentServiceFactory, controller) {
19
19
  this.documentServiceFactory = documentServiceFactory;
@@ -32,7 +32,7 @@ class ReplayDocumentServiceFactory {
32
32
  logger,
33
33
  properties: { all: { isReplay: true } },
34
34
  });
35
- return replayDocumentService_1.ReplayDocumentService.create(await this.documentServiceFactory.createDocumentService(resolvedUrl, replayLogger, clientIsSummarizer), this.controller);
35
+ return replayDocumentService_js_1.ReplayDocumentService.create(await this.documentServiceFactory.createDocumentService(resolvedUrl, replayLogger, clientIsSummarizer), this.controller);
36
36
  }
37
37
  // TODO: Issue-2109 Implement detach container api or put appropriate comment.
38
38
  async createContainer(createNewSummary, resolvedUrl, logger, clientIsSummarizer) {
@@ -1 +1 @@
1
- {"version":3,"file":"replayDocumentServiceFactory.js","sourceRoot":"","sources":["../src/replayDocumentServiceFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AASH,qEAAoE;AAEpE,mFAAyE;AACzE,mEAAgE;AAEhE;;GAEG;AACH,MAAa,4BAA4B;IACjC,MAAM,CAAC,MAAM,CACnB,IAAY,EACZ,EAAU,EACV,sBAA+C;QAE/C,OAAO,IAAI,4BAA4B,CACtC,sBAAsB,EACtB,IAAI,sDAAsB,CAAC,IAAI,EAAE,EAAE,CAAC,CACpC,CAAC;IACH,CAAC;IAED,YACkB,sBAA+C,EAC/C,UAA4B;QAD5B,2BAAsB,GAAtB,sBAAsB,CAAyB;QAC/C,eAAU,GAAV,UAAU,CAAkB;IAC3C,CAAC;IAEJ;;;;;OAKG;IACI,KAAK,CAAC,qBAAqB,CACjC,WAAyB,EACzB,MAA6B,EAC7B,kBAA4B;QAE5B,iEAAiE;QACjE,wGAAwG;QACxG,MAAM,YAAY,GAAG,IAAA,mCAAiB,EAAC;YACtC,MAAM;YACN,UAAU,EAAE,EAAE,GAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE;SACvC,CAAC,CAAC;QAEH,OAAO,6CAAqB,CAAC,MAAM,CAClC,MAAM,IAAI,CAAC,sBAAsB,CAAC,qBAAqB,CACtD,WAAW,EACX,YAAY,EACZ,kBAAkB,CAClB,EACD,IAAI,CAAC,UAAU,CACf,CAAC;IACH,CAAC;IAED,8EAA8E;IACvE,KAAK,CAAC,eAAe,CAC3B,gBAA8B,EAC9B,WAAyB,EACzB,MAA6B,EAC7B,kBAA4B;QAE5B,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACpC,CAAC;CACD;AAtDD,oEAsDC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIDocumentService,\n\tIDocumentServiceFactory,\n\tIResolvedUrl,\n} from \"@fluidframework/driver-definitions\";\nimport { ISummaryTree } from \"@fluidframework/protocol-definitions\";\nimport { ITelemetryBaseLogger } from \"@fluidframework/core-interfaces\";\nimport { createChildLogger } from \"@fluidframework/telemetry-utils\";\nimport { ReplayController } from \"./replayController\";\nimport { ReplayControllerStatic } from \"./replayDocumentDeltaConnection\";\nimport { ReplayDocumentService } from \"./replayDocumentService\";\n\n/**\n * @internal\n */\nexport class ReplayDocumentServiceFactory implements IDocumentServiceFactory {\n\tpublic static create(\n\t\tfrom: number,\n\t\tto: number,\n\t\tdocumentServiceFactory: IDocumentServiceFactory,\n\t) {\n\t\treturn new ReplayDocumentServiceFactory(\n\t\t\tdocumentServiceFactory,\n\t\t\tnew ReplayControllerStatic(from, to),\n\t\t);\n\t}\n\n\tpublic constructor(\n\t\tprivate readonly documentServiceFactory: IDocumentServiceFactory,\n\t\tprivate readonly controller: ReplayController,\n\t) {}\n\n\t/**\n\t * Creates a replay document service which uses the document service of provided\n\t * documentServiceFactory for connecting to delta stream endpoint.\n\t * @param resolvedUrl - URL to be used for connecting to endpoints.\n\t * @returns returns the requested document service\n\t */\n\tpublic async createDocumentService(\n\t\tresolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\t// Always include isReplay: true on events for the Replay Driver.\n\t\t// It's used in testing/debugging scenarios, so we want to be able to filter these events out sometimes.\n\t\tconst replayLogger = createChildLogger({\n\t\t\tlogger,\n\t\t\tproperties: { all: { isReplay: true } },\n\t\t});\n\n\t\treturn ReplayDocumentService.create(\n\t\t\tawait this.documentServiceFactory.createDocumentService(\n\t\t\t\tresolvedUrl,\n\t\t\t\treplayLogger,\n\t\t\t\tclientIsSummarizer,\n\t\t\t),\n\t\t\tthis.controller,\n\t\t);\n\t}\n\n\t// TODO: Issue-2109 Implement detach container api or put appropriate comment.\n\tpublic async createContainer(\n\t\tcreateNewSummary: ISummaryTree,\n\t\tresolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\tthrow new Error(\"Not implemented\");\n\t}\n}\n"]}
1
+ {"version":3,"file":"replayDocumentServiceFactory.js","sourceRoot":"","sources":["../src/replayDocumentServiceFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AASH,qEAAoE;AAEpE,yFAA4E;AAC5E,yEAAmE;AAEnE;;GAEG;AACH,MAAa,4BAA4B;IACjC,MAAM,CAAC,MAAM,CACnB,IAAY,EACZ,EAAU,EACV,sBAA+C;QAE/C,OAAO,IAAI,4BAA4B,CACtC,sBAAsB,EACtB,IAAI,yDAAsB,CAAC,IAAI,EAAE,EAAE,CAAC,CACpC,CAAC;IACH,CAAC;IAED,YACkB,sBAA+C,EAC/C,UAA4B;QAD5B,2BAAsB,GAAtB,sBAAsB,CAAyB;QAC/C,eAAU,GAAV,UAAU,CAAkB;IAC3C,CAAC;IAEJ;;;;;OAKG;IACI,KAAK,CAAC,qBAAqB,CACjC,WAAyB,EACzB,MAA6B,EAC7B,kBAA4B;QAE5B,iEAAiE;QACjE,wGAAwG;QACxG,MAAM,YAAY,GAAG,IAAA,mCAAiB,EAAC;YACtC,MAAM;YACN,UAAU,EAAE,EAAE,GAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE;SACvC,CAAC,CAAC;QAEH,OAAO,gDAAqB,CAAC,MAAM,CAClC,MAAM,IAAI,CAAC,sBAAsB,CAAC,qBAAqB,CACtD,WAAW,EACX,YAAY,EACZ,kBAAkB,CAClB,EACD,IAAI,CAAC,UAAU,CACf,CAAC;IACH,CAAC;IAED,8EAA8E;IACvE,KAAK,CAAC,eAAe,CAC3B,gBAA8B,EAC9B,WAAyB,EACzB,MAA6B,EAC7B,kBAA4B;QAE5B,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACpC,CAAC;CACD;AAtDD,oEAsDC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIDocumentService,\n\tIDocumentServiceFactory,\n\tIResolvedUrl,\n} from \"@fluidframework/driver-definitions\";\nimport { ISummaryTree } from \"@fluidframework/protocol-definitions\";\nimport { ITelemetryBaseLogger } from \"@fluidframework/core-interfaces\";\nimport { createChildLogger } from \"@fluidframework/telemetry-utils\";\nimport { ReplayController } from \"./replayController.js\";\nimport { ReplayControllerStatic } from \"./replayDocumentDeltaConnection.js\";\nimport { ReplayDocumentService } from \"./replayDocumentService.js\";\n\n/**\n * @internal\n */\nexport class ReplayDocumentServiceFactory implements IDocumentServiceFactory {\n\tpublic static create(\n\t\tfrom: number,\n\t\tto: number,\n\t\tdocumentServiceFactory: IDocumentServiceFactory,\n\t) {\n\t\treturn new ReplayDocumentServiceFactory(\n\t\t\tdocumentServiceFactory,\n\t\t\tnew ReplayControllerStatic(from, to),\n\t\t);\n\t}\n\n\tpublic constructor(\n\t\tprivate readonly documentServiceFactory: IDocumentServiceFactory,\n\t\tprivate readonly controller: ReplayController,\n\t) {}\n\n\t/**\n\t * Creates a replay document service which uses the document service of provided\n\t * documentServiceFactory for connecting to delta stream endpoint.\n\t * @param resolvedUrl - URL to be used for connecting to endpoints.\n\t * @returns returns the requested document service\n\t */\n\tpublic async createDocumentService(\n\t\tresolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\t// Always include isReplay: true on events for the Replay Driver.\n\t\t// It's used in testing/debugging scenarios, so we want to be able to filter these events out sometimes.\n\t\tconst replayLogger = createChildLogger({\n\t\t\tlogger,\n\t\t\tproperties: { all: { isReplay: true } },\n\t\t});\n\n\t\treturn ReplayDocumentService.create(\n\t\t\tawait this.documentServiceFactory.createDocumentService(\n\t\t\t\tresolvedUrl,\n\t\t\t\treplayLogger,\n\t\t\t\tclientIsSummarizer,\n\t\t\t),\n\t\t\tthis.controller,\n\t\t);\n\t}\n\n\t// TODO: Issue-2109 Implement detach container api or put appropriate comment.\n\tpublic async createContainer(\n\t\tcreateNewSummary: ISummaryTree,\n\t\tresolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\tthrow new Error(\"Not implemented\");\n\t}\n}\n"]}