@fluidframework/replay-driver 2.0.0-rc.4.0.5 → 2.0.0-rc.5.0.0
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.
- package/CHANGELOG.md +8 -0
- package/api-extractor/api-extractor-lint-bundle.json +5 -0
- package/api-extractor/api-extractor-lint-public.cjs.json +5 -0
- package/api-extractor/api-extractor-lint-public.esm.json +5 -0
- package/api-extractor.json +1 -1
- package/api-report/replay-driver.alpha.api.md +29 -0
- package/api-report/replay-driver.beta.api.md +29 -0
- package/api-report/replay-driver.public.api.md +29 -0
- package/biome.jsonc +4 -0
- package/dist/emptyDeltaStorageService.d.ts +1 -2
- package/dist/emptyDeltaStorageService.d.ts.map +1 -1
- package/dist/emptyDeltaStorageService.js.map +1 -1
- package/dist/replayController.d.ts +8 -8
- package/dist/replayController.d.ts.map +1 -1
- package/dist/replayController.js.map +1 -1
- package/dist/replayDocumentDeltaConnection.d.ts +2 -2
- package/dist/replayDocumentDeltaConnection.d.ts.map +1 -1
- package/dist/replayDocumentDeltaConnection.js +3 -3
- package/dist/replayDocumentDeltaConnection.js.map +1 -1
- package/dist/replayDocumentService.d.ts +9 -9
- package/dist/replayDocumentService.d.ts.map +1 -1
- package/dist/replayDocumentService.js.map +1 -1
- package/dist/replayDocumentServiceFactory.d.ts +1 -1
- package/dist/replayDocumentServiceFactory.d.ts.map +1 -1
- package/dist/replayDocumentServiceFactory.js.map +1 -1
- package/dist/storageImplementations.d.ts +2 -2
- package/dist/storageImplementations.d.ts.map +1 -1
- package/dist/storageImplementations.js.map +1 -1
- package/lib/emptyDeltaStorageService.d.ts +1 -2
- package/lib/emptyDeltaStorageService.d.ts.map +1 -1
- package/lib/emptyDeltaStorageService.js.map +1 -1
- package/lib/replayController.d.ts +8 -8
- package/lib/replayController.d.ts.map +1 -1
- package/lib/replayController.js.map +1 -1
- package/lib/replayDocumentDeltaConnection.d.ts +2 -2
- package/lib/replayDocumentDeltaConnection.d.ts.map +1 -1
- package/lib/replayDocumentDeltaConnection.js +2 -2
- package/lib/replayDocumentDeltaConnection.js.map +1 -1
- package/lib/replayDocumentService.d.ts +9 -9
- package/lib/replayDocumentService.d.ts.map +1 -1
- package/lib/replayDocumentService.js.map +1 -1
- package/lib/replayDocumentServiceFactory.d.ts +1 -1
- package/lib/replayDocumentServiceFactory.d.ts.map +1 -1
- package/lib/replayDocumentServiceFactory.js.map +1 -1
- package/lib/storageImplementations.d.ts +2 -2
- package/lib/storageImplementations.d.ts.map +1 -1
- package/lib/storageImplementations.js.map +1 -1
- package/lib/tsdoc-metadata.json +1 -1
- package/package.json +23 -17
- package/src/emptyDeltaStorageService.ts +5 -2
- package/src/replayController.ts +12 -8
- package/src/replayDocumentDeltaConnection.ts +4 -6
- package/src/replayDocumentService.ts +19 -12
- package/src/replayDocumentServiceFactory.ts +1 -1
- package/src/storageImplementations.ts +3 -6
- package/tsconfig.json +2 -0
- package/tsdoc.json +4 -0
- package/api-report/replay-driver.api.md +0 -139
|
@@ -6,24 +6,22 @@
|
|
|
6
6
|
import { TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
7
7
|
import { IDisposable } from "@fluidframework/core-interfaces";
|
|
8
8
|
import { delay } from "@fluidframework/core-utils/internal";
|
|
9
|
+
import { ConnectionMode } from "@fluidframework/driver-definitions";
|
|
9
10
|
import {
|
|
10
11
|
IDocumentDeltaConnection,
|
|
11
12
|
IDocumentDeltaConnectionEvents,
|
|
12
13
|
IDocumentDeltaStorageService,
|
|
13
14
|
IDocumentService,
|
|
14
|
-
} from "@fluidframework/driver-definitions/internal";
|
|
15
|
-
import {
|
|
16
|
-
ConnectionMode,
|
|
17
15
|
IClientConfiguration,
|
|
18
16
|
IConnected,
|
|
19
17
|
IDocumentMessage,
|
|
20
|
-
ISequencedDocumentMessage,
|
|
21
18
|
ISignalClient,
|
|
22
|
-
ISignalMessage,
|
|
23
19
|
ITokenClaims,
|
|
24
20
|
IVersion,
|
|
25
21
|
ScopeType,
|
|
26
|
-
|
|
22
|
+
ISequencedDocumentMessage,
|
|
23
|
+
ISignalMessage,
|
|
24
|
+
} from "@fluidframework/driver-definitions/internal";
|
|
27
25
|
|
|
28
26
|
import { ReplayController } from "./replayController.js";
|
|
29
27
|
|
|
@@ -4,8 +4,15 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
7
|
+
import { IClient } from "@fluidframework/driver-definitions";
|
|
8
|
+
import {
|
|
9
|
+
IDocumentServiceEvents,
|
|
10
|
+
IDocumentService,
|
|
11
|
+
IDocumentStorageService,
|
|
12
|
+
IDocumentDeltaConnection,
|
|
13
|
+
IResolvedUrl,
|
|
14
|
+
IDocumentDeltaStorageService,
|
|
15
|
+
} from "@fluidframework/driver-definitions/internal";
|
|
9
16
|
|
|
10
17
|
import { EmptyDeltaStorageService } from "./emptyDeltaStorageService.js";
|
|
11
18
|
import { ReplayController } from "./replayController.js";
|
|
@@ -18,14 +25,14 @@ import { ReplayDocumentDeltaConnection } from "./replayDocumentDeltaConnection.j
|
|
|
18
25
|
* @internal
|
|
19
26
|
*/
|
|
20
27
|
export class ReplayDocumentService
|
|
21
|
-
extends TypedEventEmitter<
|
|
28
|
+
extends TypedEventEmitter<IDocumentServiceEvents>
|
|
22
29
|
// eslint-disable-next-line import/namespace
|
|
23
|
-
implements
|
|
30
|
+
implements IDocumentService
|
|
24
31
|
{
|
|
25
32
|
public static async create(
|
|
26
|
-
documentService:
|
|
33
|
+
documentService: IDocumentService,
|
|
27
34
|
controller: ReplayController,
|
|
28
|
-
): Promise<
|
|
35
|
+
): Promise<IDocumentService> {
|
|
29
36
|
const useController = await controller.initStorage(documentService);
|
|
30
37
|
if (!useController) {
|
|
31
38
|
return documentService;
|
|
@@ -39,8 +46,8 @@ export class ReplayDocumentService
|
|
|
39
46
|
}
|
|
40
47
|
|
|
41
48
|
constructor(
|
|
42
|
-
private readonly controller:
|
|
43
|
-
private readonly deltaStorage:
|
|
49
|
+
private readonly controller: IDocumentStorageService,
|
|
50
|
+
private readonly deltaStorage: IDocumentDeltaConnection,
|
|
44
51
|
) {
|
|
45
52
|
super();
|
|
46
53
|
}
|
|
@@ -48,7 +55,7 @@ export class ReplayDocumentService
|
|
|
48
55
|
public dispose() {}
|
|
49
56
|
|
|
50
57
|
// TODO: Issue-2109 Implement detach container api or put appropriate comment.
|
|
51
|
-
public get resolvedUrl():
|
|
58
|
+
public get resolvedUrl(): IResolvedUrl {
|
|
52
59
|
throw new Error("Not implemented");
|
|
53
60
|
}
|
|
54
61
|
|
|
@@ -56,7 +63,7 @@ export class ReplayDocumentService
|
|
|
56
63
|
* Connects to a storage endpoint for snapshot service and blobs.
|
|
57
64
|
* @returns returns the dummy document storage service for replay driver.
|
|
58
65
|
*/
|
|
59
|
-
public async connectToStorage(): Promise<
|
|
66
|
+
public async connectToStorage(): Promise<IDocumentStorageService> {
|
|
60
67
|
return this.controller;
|
|
61
68
|
}
|
|
62
69
|
|
|
@@ -64,7 +71,7 @@ export class ReplayDocumentService
|
|
|
64
71
|
* Connects to a delta storage endpoint for getting ops between a range.
|
|
65
72
|
* @returns returns the dummy document delta storage service for replay driver.
|
|
66
73
|
*/
|
|
67
|
-
public async connectToDeltaStorage(): Promise<
|
|
74
|
+
public async connectToDeltaStorage(): Promise<IDocumentDeltaStorageService> {
|
|
68
75
|
return new EmptyDeltaStorageService();
|
|
69
76
|
}
|
|
70
77
|
|
|
@@ -74,7 +81,7 @@ export class ReplayDocumentService
|
|
|
74
81
|
* @param client - Client that connects to socket.
|
|
75
82
|
* @returns returns the delta stream service which replay ops from --from to --to arguments.
|
|
76
83
|
*/
|
|
77
|
-
public async connectToDeltaStream(client: IClient): Promise<
|
|
84
|
+
public async connectToDeltaStream(client: IClient): Promise<IDocumentDeltaConnection> {
|
|
78
85
|
return this.deltaStorage;
|
|
79
86
|
}
|
|
80
87
|
}
|
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
7
|
+
import { ISummaryTree } from "@fluidframework/driver-definitions";
|
|
7
8
|
import {
|
|
8
9
|
IDocumentService,
|
|
9
10
|
IDocumentServiceFactory,
|
|
10
11
|
IResolvedUrl,
|
|
11
12
|
} from "@fluidframework/driver-definitions/internal";
|
|
12
|
-
import { ISummaryTree } from "@fluidframework/protocol-definitions";
|
|
13
13
|
import { createChildLogger } from "@fluidframework/telemetry-utils/internal";
|
|
14
14
|
|
|
15
15
|
import { ReplayController } from "./replayController.js";
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import { TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
7
7
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
8
|
+
import { IClient, ISummaryTree } from "@fluidframework/driver-definitions";
|
|
8
9
|
import {
|
|
9
10
|
IDocumentDeltaConnection,
|
|
10
11
|
IDocumentDeltaStorageService,
|
|
@@ -13,15 +14,11 @@ import {
|
|
|
13
14
|
IDocumentServiceFactory,
|
|
14
15
|
IDocumentStorageService,
|
|
15
16
|
IResolvedUrl,
|
|
16
|
-
} from "@fluidframework/driver-definitions/internal";
|
|
17
|
-
import { buildSnapshotTree } from "@fluidframework/driver-utils/internal";
|
|
18
|
-
import {
|
|
19
|
-
IClient,
|
|
20
17
|
ISnapshotTree,
|
|
21
|
-
ISummaryTree,
|
|
22
18
|
ITree,
|
|
23
19
|
IVersion,
|
|
24
|
-
} from "@fluidframework/
|
|
20
|
+
} from "@fluidframework/driver-definitions/internal";
|
|
21
|
+
import { buildSnapshotTree } from "@fluidframework/driver-utils/internal";
|
|
25
22
|
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
|
|
26
23
|
|
|
27
24
|
import { EmptyDeltaStorageService } from "./emptyDeltaStorageService.js";
|
package/tsconfig.json
CHANGED
package/tsdoc.json
ADDED
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
## API Report File for "@fluidframework/replay-driver"
|
|
2
|
-
|
|
3
|
-
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
-
|
|
5
|
-
```ts
|
|
6
|
-
|
|
7
|
-
import * as api from '@fluidframework/protocol-definitions';
|
|
8
|
-
import * as api_2 from '@fluidframework/driver-definitions/internal';
|
|
9
|
-
import { IClient } from '@fluidframework/protocol-definitions';
|
|
10
|
-
import { IDocumentService } from '@fluidframework/driver-definitions/internal';
|
|
11
|
-
import { IDocumentServiceFactory } from '@fluidframework/driver-definitions/internal';
|
|
12
|
-
import { IDocumentStorageService } from '@fluidframework/driver-definitions/internal';
|
|
13
|
-
import { IResolvedUrl } from '@fluidframework/driver-definitions/internal';
|
|
14
|
-
import { ISnapshotTree } from '@fluidframework/protocol-definitions';
|
|
15
|
-
import { ISummaryContext } from '@fluidframework/driver-definitions/internal';
|
|
16
|
-
import { ISummaryTree } from '@fluidframework/protocol-definitions';
|
|
17
|
-
import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
|
|
18
|
-
import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils/internal';
|
|
19
|
-
import { ITree } from '@fluidframework/protocol-definitions';
|
|
20
|
-
import { IVersion } from '@fluidframework/protocol-definitions';
|
|
21
|
-
import { TypedEventEmitter } from '@fluid-internal/client-utils';
|
|
22
|
-
|
|
23
|
-
// @internal (undocumented)
|
|
24
|
-
export class FileSnapshotReader extends ReadDocumentStorageServiceBase implements IDocumentStorageService {
|
|
25
|
-
constructor(json: IFileSnapshot);
|
|
26
|
-
// (undocumented)
|
|
27
|
-
protected blobs: Map<string, ArrayBufferLike>;
|
|
28
|
-
// (undocumented)
|
|
29
|
-
protected readonly commits: {
|
|
30
|
-
[key: string]: ITree;
|
|
31
|
-
};
|
|
32
|
-
// (undocumented)
|
|
33
|
-
protected docId?: string;
|
|
34
|
-
// (undocumented)
|
|
35
|
-
protected docTree: ISnapshotTree;
|
|
36
|
-
// (undocumented)
|
|
37
|
-
protected static readonly FileStorageVersionTreeId = "FileStorageTreeId";
|
|
38
|
-
// (undocumented)
|
|
39
|
-
getSnapshotTree(versionRequested?: IVersion): Promise<ISnapshotTree | null>;
|
|
40
|
-
// (undocumented)
|
|
41
|
-
getVersions(versionId: string | null, count: number): Promise<IVersion[]>;
|
|
42
|
-
// (undocumented)
|
|
43
|
-
readBlob(blobId: string): Promise<ArrayBufferLike>;
|
|
44
|
-
// (undocumented)
|
|
45
|
-
protected readonly trees: {
|
|
46
|
-
[key: string]: ISnapshotTree;
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// @internal
|
|
51
|
-
export interface IFileSnapshot {
|
|
52
|
-
// (undocumented)
|
|
53
|
-
commits: {
|
|
54
|
-
[key: string]: ITree;
|
|
55
|
-
};
|
|
56
|
-
// (undocumented)
|
|
57
|
-
tree: ITree;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// @internal
|
|
61
|
-
export abstract class ReadDocumentStorageServiceBase implements IDocumentStorageService {
|
|
62
|
-
// (undocumented)
|
|
63
|
-
createBlob(file: ArrayBufferLike): Promise<api.ICreateBlobResponse>;
|
|
64
|
-
// (undocumented)
|
|
65
|
-
downloadSummary(handle: api.ISummaryHandle): Promise<api.ISummaryTree>;
|
|
66
|
-
// (undocumented)
|
|
67
|
-
abstract getSnapshotTree(version?: api.IVersion): Promise<api.ISnapshotTree | null>;
|
|
68
|
-
// (undocumented)
|
|
69
|
-
abstract getVersions(versionId: string | null, count: number): Promise<api.IVersion[]>;
|
|
70
|
-
// (undocumented)
|
|
71
|
-
abstract readBlob(blobId: string): Promise<ArrayBufferLike>;
|
|
72
|
-
// (undocumented)
|
|
73
|
-
uploadSummaryWithContext(summary: api.ISummaryTree, context: ISummaryContext): Promise<string>;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// @internal
|
|
77
|
-
export abstract class ReplayController extends ReadDocumentStorageServiceBase {
|
|
78
|
-
abstract fetchTo(currentOp: number): number | undefined;
|
|
79
|
-
abstract getStartingOpSequence(): Promise<number>;
|
|
80
|
-
abstract initStorage(documentService: IDocumentService): Promise<boolean>;
|
|
81
|
-
abstract isDoneFetch(currentOp: number, lastTimeStamp?: number): boolean;
|
|
82
|
-
abstract replay(emitter: (op: api.ISequencedDocumentMessage[]) => void, fetchedOps: api.ISequencedDocumentMessage[]): Promise<void>;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
// @internal
|
|
86
|
-
export class ReplayDocumentService extends TypedEventEmitter<api_2.IDocumentServiceEvents> implements api_2.IDocumentService {
|
|
87
|
-
constructor(controller: api_2.IDocumentStorageService, deltaStorage: api_2.IDocumentDeltaConnection);
|
|
88
|
-
connectToDeltaStorage(): Promise<api_2.IDocumentDeltaStorageService>;
|
|
89
|
-
connectToDeltaStream(client: IClient): Promise<api_2.IDocumentDeltaConnection>;
|
|
90
|
-
connectToStorage(): Promise<api_2.IDocumentStorageService>;
|
|
91
|
-
// (undocumented)
|
|
92
|
-
static create(documentService: api_2.IDocumentService, controller: ReplayController): Promise<api_2.IDocumentService>;
|
|
93
|
-
// (undocumented)
|
|
94
|
-
dispose(): void;
|
|
95
|
-
// (undocumented)
|
|
96
|
-
get resolvedUrl(): api_2.IResolvedUrl;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// @internal (undocumented)
|
|
100
|
-
export class ReplayDocumentServiceFactory implements IDocumentServiceFactory {
|
|
101
|
-
constructor(documentServiceFactory: IDocumentServiceFactory, controller: ReplayController);
|
|
102
|
-
// (undocumented)
|
|
103
|
-
static create(from: number, to: number, documentServiceFactory: IDocumentServiceFactory): ReplayDocumentServiceFactory;
|
|
104
|
-
// (undocumented)
|
|
105
|
-
createContainer(createNewSummary: ISummaryTree, resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
|
|
106
|
-
createDocumentService(resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// @internal (undocumented)
|
|
110
|
-
export class SnapshotStorage extends ReadDocumentStorageServiceBase {
|
|
111
|
-
constructor(storage: IDocumentStorageService, docTree: ISnapshotTree | null);
|
|
112
|
-
// (undocumented)
|
|
113
|
-
protected docId?: string;
|
|
114
|
-
// (undocumented)
|
|
115
|
-
protected readonly docTree: ISnapshotTree | null;
|
|
116
|
-
// (undocumented)
|
|
117
|
-
getSnapshotTree(versionRequested?: IVersion): Promise<ISnapshotTree | null>;
|
|
118
|
-
// (undocumented)
|
|
119
|
-
getVersions(versionId: string | null, count: number): Promise<IVersion[]>;
|
|
120
|
-
// (undocumented)
|
|
121
|
-
readBlob(blobId: string): Promise<ArrayBufferLike>;
|
|
122
|
-
// (undocumented)
|
|
123
|
-
protected readonly storage: IDocumentStorageService;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
// @internal (undocumented)
|
|
127
|
-
export class StaticStorageDocumentServiceFactory implements IDocumentServiceFactory {
|
|
128
|
-
constructor(storage: IDocumentStorageService);
|
|
129
|
-
// (undocumented)
|
|
130
|
-
createContainer(createNewSummary: ISummaryTree, resolvedUrl: IResolvedUrl, logger: ITelemetryLoggerExt, clientIsSummarizer?: boolean): Promise<IDocumentService>;
|
|
131
|
-
// (undocumented)
|
|
132
|
-
createDocumentService(fileURL: IResolvedUrl, logger?: ITelemetryLoggerExt, clientIsSummarizer?: boolean): Promise<IDocumentService>;
|
|
133
|
-
// (undocumented)
|
|
134
|
-
protected readonly storage: IDocumentStorageService;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
// (No @packageDocumentation comment for this package)
|
|
138
|
-
|
|
139
|
-
```
|