@fluidframework/replay-driver 2.0.0-dev.2.3.0.115467 → 2.0.0-dev.4.1.0.148229

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 (54) hide show
  1. package/.eslintrc.js +5 -7
  2. package/api-extractor.json +2 -2
  3. package/dist/emptyDeltaStorageService.d.ts.map +1 -1
  4. package/dist/emptyDeltaStorageService.js.map +1 -1
  5. package/dist/packageVersion.d.ts +1 -1
  6. package/dist/packageVersion.js +1 -1
  7. package/dist/packageVersion.js.map +1 -1
  8. package/dist/replayController.d.ts.map +1 -1
  9. package/dist/replayController.js.map +1 -1
  10. package/dist/replayDocumentDeltaConnection.d.ts.map +1 -1
  11. package/dist/replayDocumentDeltaConnection.js +12 -9
  12. package/dist/replayDocumentDeltaConnection.js.map +1 -1
  13. package/dist/replayDocumentService.d.ts.map +1 -1
  14. package/dist/replayDocumentService.js.map +1 -1
  15. package/dist/replayDocumentServiceFactory.d.ts +0 -1
  16. package/dist/replayDocumentServiceFactory.d.ts.map +1 -1
  17. package/dist/replayDocumentServiceFactory.js +0 -1
  18. package/dist/replayDocumentServiceFactory.js.map +1 -1
  19. package/dist/storageImplementations.d.ts +0 -1
  20. package/dist/storageImplementations.d.ts.map +1 -1
  21. package/dist/storageImplementations.js +0 -1
  22. package/dist/storageImplementations.js.map +1 -1
  23. package/lib/emptyDeltaStorageService.d.ts.map +1 -1
  24. package/lib/emptyDeltaStorageService.js.map +1 -1
  25. package/lib/packageVersion.d.ts +1 -1
  26. package/lib/packageVersion.js +1 -1
  27. package/lib/packageVersion.js.map +1 -1
  28. package/lib/replayController.d.ts.map +1 -1
  29. package/lib/replayController.js.map +1 -1
  30. package/lib/replayDocumentDeltaConnection.d.ts.map +1 -1
  31. package/lib/replayDocumentDeltaConnection.js +12 -9
  32. package/lib/replayDocumentDeltaConnection.js.map +1 -1
  33. package/lib/replayDocumentService.d.ts.map +1 -1
  34. package/lib/replayDocumentService.js.map +1 -1
  35. package/lib/replayDocumentServiceFactory.d.ts +0 -1
  36. package/lib/replayDocumentServiceFactory.d.ts.map +1 -1
  37. package/lib/replayDocumentServiceFactory.js +0 -1
  38. package/lib/replayDocumentServiceFactory.js.map +1 -1
  39. package/lib/storageImplementations.d.ts +0 -1
  40. package/lib/storageImplementations.d.ts.map +1 -1
  41. package/lib/storageImplementations.js +0 -1
  42. package/lib/storageImplementations.js.map +1 -1
  43. package/lib/test/types/validateReplayDriverPrevious.generated.js.map +1 -1
  44. package/package.json +35 -39
  45. package/prettier.config.cjs +1 -1
  46. package/src/emptyDeltaStorageService.ts +14 -13
  47. package/src/packageVersion.ts +1 -1
  48. package/src/replayController.ts +59 -55
  49. package/src/replayDocumentDeltaConnection.ts +323 -310
  50. package/src/replayDocumentService.ts +46 -44
  51. package/src/replayDocumentServiceFactory.ts +55 -45
  52. package/src/storageImplementations.ts +153 -150
  53. package/tsconfig.esnext.json +6 -6
  54. package/tsconfig.json +8 -13
@@ -4,9 +4,9 @@
4
4
  */
5
5
 
6
6
  import {
7
- IDocumentService,
8
- IDocumentStorageService,
9
- ISummaryContext,
7
+ IDocumentService,
8
+ IDocumentStorageService,
9
+ ISummaryContext,
10
10
  } from "@fluidframework/driver-definitions";
11
11
  import * as api from "@fluidframework/protocol-definitions";
12
12
 
@@ -14,25 +14,28 @@ import * as api from "@fluidframework/protocol-definitions";
14
14
  * Partial implementation of IDocumentStorageService
15
15
  */
16
16
  export abstract class ReadDocumentStorageServiceBase implements IDocumentStorageService {
17
- public abstract getVersions(versionId: string | null, count: number): Promise<api.IVersion[]>;
18
- public abstract getSnapshotTree(version?: api.IVersion): Promise<api.ISnapshotTree | null>;
19
- public abstract readBlob(blobId: string): Promise<ArrayBufferLike>;
17
+ public abstract getVersions(versionId: string | null, count: number): Promise<api.IVersion[]>;
18
+ public abstract getSnapshotTree(version?: api.IVersion): Promise<api.ISnapshotTree | null>;
19
+ public abstract readBlob(blobId: string): Promise<ArrayBufferLike>;
20
20
 
21
- public async uploadSummaryWithContext(summary: api.ISummaryTree, context: ISummaryContext): Promise<string> {
22
- return Promise.reject(new Error("Invalid operation"));
23
- }
21
+ public async uploadSummaryWithContext(
22
+ summary: api.ISummaryTree,
23
+ context: ISummaryContext,
24
+ ): Promise<string> {
25
+ return Promise.reject(new Error("Invalid operation"));
26
+ }
24
27
 
25
- public async createBlob(file: ArrayBufferLike): Promise<api.ICreateBlobResponse> {
26
- return Promise.reject(new Error("Invalid operation"));
27
- }
28
+ public async createBlob(file: ArrayBufferLike): Promise<api.ICreateBlobResponse> {
29
+ return Promise.reject(new Error("Invalid operation"));
30
+ }
28
31
 
29
- public async downloadSummary(handle: api.ISummaryHandle): Promise<api.ISummaryTree> {
30
- return Promise.reject(new Error("Invalid operation"));
31
- }
32
+ public async downloadSummary(handle: api.ISummaryHandle): Promise<api.ISummaryTree> {
33
+ return Promise.reject(new Error("Invalid operation"));
34
+ }
32
35
 
33
- public get repositoryUrl(): string {
34
- throw new Error("Invalid operation");
35
- }
36
+ public get repositoryUrl(): string {
37
+ throw new Error("Invalid operation");
38
+ }
36
39
  }
37
40
 
38
41
  /**
@@ -41,45 +44,46 @@ export abstract class ReadDocumentStorageServiceBase implements IDocumentStorage
41
44
  * As well as dispatch of ops
42
45
  */
43
46
  export abstract class ReplayController extends ReadDocumentStorageServiceBase {
44
- /**
45
- * Initialize reply controller
46
- * @param documentService - the real document service
47
- * @returns - Boolean, indicating if controller should be used.
48
- * If false is returned, caller should fallback to original storage.
49
- */
50
- public abstract initStorage(documentService: IDocumentService): Promise<boolean>;
47
+ /**
48
+ * Initialize reply controller
49
+ * @param documentService - the real document service
50
+ * @returns - Boolean, indicating if controller should be used.
51
+ * If false is returned, caller should fallback to original storage.
52
+ */
53
+ public abstract initStorage(documentService: IDocumentService): Promise<boolean>;
51
54
 
52
- /**
53
- * Returns sequence number to start processing ops
54
- * Should be zero if not using snapshot, and snapshot seq# otherwise
55
- */
56
- public abstract getStartingOpSequence(): Promise<number>;
55
+ /**
56
+ * Returns sequence number to start processing ops
57
+ * Should be zero if not using snapshot, and snapshot seq# otherwise
58
+ */
59
+ public abstract getStartingOpSequence(): Promise<number>;
57
60
 
58
- /**
59
- * Returns last op number to fetch from current op
60
- * Note: this API is called while replay() is in progress - next batch of ops is downloaded in parallel
61
- * @param currentOp - current op
62
- */
63
- public abstract fetchTo(currentOp: number): number | undefined;
61
+ /**
62
+ * Returns last op number to fetch from current op
63
+ * Note: this API is called while replay() is in progress - next batch of ops is downloaded in parallel
64
+ * @param currentOp - current op
65
+ */
66
+ public abstract fetchTo(currentOp: number): number | undefined;
64
67
 
65
- /**
66
- * Returns true if no more ops should be processed (or downloaded for future processing).
67
- * It's called at end of each batch with latest op timestamp.
68
- * Also it's called when there are no more ops available (lastTimeStamp === undefined).
69
- * If false is returned and there are no more ops, request for more ops is made every 2 seconds.
70
- * Note: this API is called while replay() is in progress - next batch of ops is downloaded in parallel
71
- * @param currentOp - current op
72
- * @param lastTimeStamp - timestamp of last op (if more ops are available). Undefined otherwise.
73
- */
74
- public abstract isDoneFetch(currentOp: number, lastTimeStamp?: number): boolean;
68
+ /**
69
+ * Returns true if no more ops should be processed (or downloaded for future processing).
70
+ * It's called at end of each batch with latest op timestamp.
71
+ * Also it's called when there are no more ops available (lastTimeStamp === undefined).
72
+ * If false is returned and there are no more ops, request for more ops is made every 2 seconds.
73
+ * Note: this API is called while replay() is in progress - next batch of ops is downloaded in parallel
74
+ * @param currentOp - current op
75
+ * @param lastTimeStamp - timestamp of last op (if more ops are available). Undefined otherwise.
76
+ */
77
+ public abstract isDoneFetch(currentOp: number, lastTimeStamp?: number): boolean;
75
78
 
76
- /**
77
- * Replay batch of ops
78
- * NOTE: new batch of ops is fetched (fetchTo() & isDoneFetch() APIs are called) while this call is in flights
79
- * @param emitter - callback to emit ops
80
- * @param fetchedOps - ops to process
81
- */
82
- public abstract replay(
83
- emitter: (op: api.ISequencedDocumentMessage[]) => void,
84
- fetchedOps: api.ISequencedDocumentMessage[]): Promise<void>;
79
+ /**
80
+ * Replay batch of ops
81
+ * NOTE: new batch of ops is fetched (fetchTo() & isDoneFetch() APIs are called) while this call is in flights
82
+ * @param emitter - callback to emit ops
83
+ * @param fetchedOps - ops to process
84
+ */
85
+ public abstract replay(
86
+ emitter: (op: api.ISequencedDocumentMessage[]) => void,
87
+ fetchedOps: api.ISequencedDocumentMessage[],
88
+ ): Promise<void>;
85
89
  }