@fluidframework/file-driver 2.0.0-dev.6.4.0.192049 → 2.0.0-dev.7.2.0.204906
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 +52 -0
- package/api-extractor.json +9 -1
- package/api-report/file-driver.api.md +171 -0
- package/dist/file-driver-alpha.d.ts +188 -0
- package/dist/file-driver-beta.d.ts +188 -0
- package/dist/file-driver-public.d.ts +188 -0
- package/dist/file-driver-untrimmed.d.ts +187 -0
- package/dist/fileDocumentDeltaConnection.js +7 -7
- package/dist/fileDocumentDeltaConnection.js.map +1 -1
- package/dist/fileDocumentStorageService.d.ts +3 -3
- package/dist/fileDocumentStorageService.d.ts.map +1 -1
- package/dist/fileDocumentStorageService.js +10 -2
- package/dist/fileDocumentStorageService.js.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/package.json +19 -20
- package/src/fileDocumentStorageService.ts +9 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,57 @@
|
|
|
1
1
|
# @fluidframework/file-driver
|
|
2
2
|
|
|
3
|
+
## 2.0.0-internal.7.1.0
|
|
4
|
+
|
|
5
|
+
Dependency updates only.
|
|
6
|
+
|
|
7
|
+
## 2.0.0-internal.7.0.0
|
|
8
|
+
|
|
9
|
+
### Major Changes
|
|
10
|
+
|
|
11
|
+
- Dependencies on @fluidframework/protocol-definitions package updated to 3.0.0 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
|
|
12
|
+
|
|
13
|
+
This included the following changes from the protocol-definitions release:
|
|
14
|
+
|
|
15
|
+
- Updating signal interfaces for some planned improvements. The intention is split the interface between signals
|
|
16
|
+
submitted by clients to the server and the resulting signals sent from the server to clients.
|
|
17
|
+
- A new optional type member is available on the ISignalMessage interface and a new ISentSignalMessage interface has
|
|
18
|
+
been added, which will be the typing for signals sent from the client to the server. Both extend a new
|
|
19
|
+
ISignalMessageBase interface that contains common members.
|
|
20
|
+
- The @fluidframework/common-definitions package dependency has been updated to version 1.0.0.
|
|
21
|
+
|
|
22
|
+
- Server upgrade: dependencies on Fluid server packages updated to 2.0.1 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
|
|
23
|
+
|
|
24
|
+
Dependencies on the following Fluid server package have been updated to version 2.0.1:
|
|
25
|
+
|
|
26
|
+
- @fluidframework/gitresources: 2.0.1
|
|
27
|
+
- @fluidframework/server-kafka-orderer: 2.0.1
|
|
28
|
+
- @fluidframework/server-lambdas: 2.0.1
|
|
29
|
+
- @fluidframework/server-lambdas-driver: 2.0.1
|
|
30
|
+
- @fluidframework/server-local-server: 2.0.1
|
|
31
|
+
- @fluidframework/server-memory-orderer: 2.0.1
|
|
32
|
+
- @fluidframework/protocol-base: 2.0.1
|
|
33
|
+
- @fluidframework/server-routerlicious: 2.0.1
|
|
34
|
+
- @fluidframework/server-routerlicious-base: 2.0.1
|
|
35
|
+
- @fluidframework/server-services: 2.0.1
|
|
36
|
+
- @fluidframework/server-services-client: 2.0.1
|
|
37
|
+
- @fluidframework/server-services-core: 2.0.1
|
|
38
|
+
- @fluidframework/server-services-ordering-kafkanode: 2.0.1
|
|
39
|
+
- @fluidframework/server-services-ordering-rdkafka: 2.0.1
|
|
40
|
+
- @fluidframework/server-services-ordering-zookeeper: 2.0.1
|
|
41
|
+
- @fluidframework/server-services-shared: 2.0.1
|
|
42
|
+
- @fluidframework/server-services-telemetry: 2.0.1
|
|
43
|
+
- @fluidframework/server-services-utils: 2.0.1
|
|
44
|
+
- @fluidframework/server-test-utils: 2.0.1
|
|
45
|
+
- tinylicious: 2.0.1
|
|
46
|
+
|
|
47
|
+
- Minimum TypeScript version now 5.1.6 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
|
|
48
|
+
|
|
49
|
+
The minimum supported TypeScript version for Fluid 2.0 clients is now 5.1.6.
|
|
50
|
+
|
|
51
|
+
## 2.0.0-internal.6.4.0
|
|
52
|
+
|
|
53
|
+
Dependency updates only.
|
|
54
|
+
|
|
3
55
|
## 2.0.0-internal.6.3.0
|
|
4
56
|
|
|
5
57
|
Dependency updates only.
|
package/api-extractor.json
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
-
"extends": "@fluidframework/build-common/api-extractor-
|
|
3
|
+
"extends": "@fluidframework/build-common/api-extractor-base.json",
|
|
4
|
+
"messages": {
|
|
5
|
+
"extractorMessageReporting": {
|
|
6
|
+
"ae-missing-release-tag": {
|
|
7
|
+
// TODO: Fix violations and remove this rule override
|
|
8
|
+
"logLevel": "none"
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
4
12
|
}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
## API Report File for "@fluidframework/file-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 { ConnectionMode } from '@fluidframework/protocol-definitions';
|
|
9
|
+
import { IClientConfiguration } from '@fluidframework/protocol-definitions';
|
|
10
|
+
import { IConnected } from '@fluidframework/protocol-definitions';
|
|
11
|
+
import { IDisposable } from '@fluidframework/core-interfaces';
|
|
12
|
+
import { IDocumentDeltaConnection } from '@fluidframework/driver-definitions';
|
|
13
|
+
import { IDocumentDeltaConnectionEvents } from '@fluidframework/driver-definitions';
|
|
14
|
+
import { IDocumentDeltaStorageService } from '@fluidframework/driver-definitions';
|
|
15
|
+
import { IDocumentMessage } from '@fluidframework/protocol-definitions';
|
|
16
|
+
import { IDocumentService } from '@fluidframework/driver-definitions';
|
|
17
|
+
import { IDocumentServiceFactory } from '@fluidframework/driver-definitions';
|
|
18
|
+
import { IDocumentStorageService } from '@fluidframework/driver-definitions';
|
|
19
|
+
import { IDocumentStorageServicePolicies } from '@fluidframework/driver-definitions';
|
|
20
|
+
import { IFileSnapshot } from '@fluidframework/replay-driver';
|
|
21
|
+
import { IResolvedUrl } from '@fluidframework/driver-definitions';
|
|
22
|
+
import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
|
|
23
|
+
import { ISignalClient } from '@fluidframework/protocol-definitions';
|
|
24
|
+
import { ISignalMessage } from '@fluidframework/protocol-definitions';
|
|
25
|
+
import { IStream } from '@fluidframework/driver-definitions';
|
|
26
|
+
import { ISummaryContext } from '@fluidframework/driver-definitions';
|
|
27
|
+
import { ISummaryTree } from '@fluidframework/protocol-definitions';
|
|
28
|
+
import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
|
|
29
|
+
import { ITokenClaims } from '@fluidframework/protocol-definitions';
|
|
30
|
+
import { ReadDocumentStorageServiceBase } from '@fluidframework/replay-driver';
|
|
31
|
+
import { TypedEventEmitter } from '@fluid-internal/client-utils';
|
|
32
|
+
|
|
33
|
+
// @public
|
|
34
|
+
export class FileDeltaStorageService implements IDocumentDeltaStorageService {
|
|
35
|
+
constructor(path: string);
|
|
36
|
+
// (undocumented)
|
|
37
|
+
fetchMessages(from: number, to: number | undefined, abortSignal?: AbortSignal, cachedOnly?: boolean): IStream<api.ISequencedDocumentMessage[]>;
|
|
38
|
+
getFromWebSocket(from: number, to: number): api.ISequencedDocumentMessage[];
|
|
39
|
+
// (undocumented)
|
|
40
|
+
get ops(): readonly Readonly<api.ISequencedDocumentMessage>[];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// @public
|
|
44
|
+
export class FileDocumentServiceFactory implements IDocumentServiceFactory {
|
|
45
|
+
constructor(storage: IDocumentStorageService, deltaStorage: FileDeltaStorageService, deltaConnection: IDocumentDeltaConnection);
|
|
46
|
+
// (undocumented)
|
|
47
|
+
createContainer(createNewSummary: ISummaryTree, resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
|
|
48
|
+
createDocumentService(resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// @public (undocumented)
|
|
52
|
+
export const FileSnapshotWriterClassFactory: <TBase extends ReaderConstructor>(Base: TBase) => {
|
|
53
|
+
new (...args: any[]): {
|
|
54
|
+
blobsWriter: Map<string, ArrayBufferLike>;
|
|
55
|
+
latestWriterTree?: api.ISnapshotTree | undefined;
|
|
56
|
+
docId?: string | undefined;
|
|
57
|
+
reset(): void;
|
|
58
|
+
onSnapshotHandler(snapshot: IFileSnapshot): void;
|
|
59
|
+
readBlob(sha: string): Promise<ArrayBufferLike>;
|
|
60
|
+
getVersions(versionId: string | null, count: number): Promise<api.IVersion[]>;
|
|
61
|
+
getSnapshotTree(version?: api.IVersion): Promise<api.ISnapshotTree | null>;
|
|
62
|
+
uploadSummaryWithContext(summary: api.ISummaryTree, context: ISummaryContext): Promise<string>;
|
|
63
|
+
buildTree(snapshotTree: api.ISnapshotTree): Promise<api.ITree>;
|
|
64
|
+
repositoryUrl: string;
|
|
65
|
+
readonly policies?: IDocumentStorageServicePolicies | undefined;
|
|
66
|
+
createBlob(file: ArrayBufferLike): Promise<api.ICreateBlobResponse>;
|
|
67
|
+
downloadSummary(handle: api.ISummaryHandle): Promise<api.ISummaryTree>;
|
|
68
|
+
readonly disposed?: boolean | undefined;
|
|
69
|
+
dispose?: ((error?: Error | undefined) => void) | undefined;
|
|
70
|
+
};
|
|
71
|
+
} & TBase;
|
|
72
|
+
|
|
73
|
+
// @public (undocumented)
|
|
74
|
+
export const FileStorageDocumentName = "FileStorageDocId";
|
|
75
|
+
|
|
76
|
+
// @public
|
|
77
|
+
export class FluidFetchReader extends ReadDocumentStorageServiceBase implements IDocumentStorageService {
|
|
78
|
+
constructor(path: string, versionName?: string | undefined);
|
|
79
|
+
// (undocumented)
|
|
80
|
+
protected docTree: api.ISnapshotTree | null;
|
|
81
|
+
getSnapshotTree(version?: api.IVersion): Promise<api.ISnapshotTree | null>;
|
|
82
|
+
getVersions(versionId: string | null, count: number): Promise<api.IVersion[]>;
|
|
83
|
+
// (undocumented)
|
|
84
|
+
readBlob(sha: string): Promise<ArrayBufferLike>;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// @public (undocumented)
|
|
88
|
+
export const FluidFetchReaderFileSnapshotWriter: {
|
|
89
|
+
new (...args: any[]): {
|
|
90
|
+
blobsWriter: Map<string, ArrayBufferLike>;
|
|
91
|
+
latestWriterTree?: api.ISnapshotTree | undefined;
|
|
92
|
+
docId?: string | undefined;
|
|
93
|
+
reset(): void;
|
|
94
|
+
onSnapshotHandler(snapshot: IFileSnapshot): void;
|
|
95
|
+
readBlob(sha: string): Promise<ArrayBufferLike>;
|
|
96
|
+
getVersions(versionId: string | null, count: number): Promise<api.IVersion[]>;
|
|
97
|
+
getSnapshotTree(version?: api.IVersion): Promise<api.ISnapshotTree | null>;
|
|
98
|
+
uploadSummaryWithContext(summary: api.ISummaryTree, context: ISummaryContext): Promise<string>;
|
|
99
|
+
buildTree(snapshotTree: api.ISnapshotTree): Promise<api.ITree>;
|
|
100
|
+
repositoryUrl: string;
|
|
101
|
+
readonly policies?: IDocumentStorageServicePolicies | undefined;
|
|
102
|
+
createBlob(file: ArrayBufferLike): Promise<api.ICreateBlobResponse>;
|
|
103
|
+
downloadSummary(handle: api.ISummaryHandle): Promise<api.ISummaryTree>;
|
|
104
|
+
readonly disposed?: boolean | undefined;
|
|
105
|
+
dispose?: ((error?: Error | undefined) => void) | undefined;
|
|
106
|
+
};
|
|
107
|
+
} & typeof FluidFetchReader;
|
|
108
|
+
|
|
109
|
+
// @public (undocumented)
|
|
110
|
+
export interface ISnapshotWriterStorage extends IDocumentStorageService {
|
|
111
|
+
// (undocumented)
|
|
112
|
+
onSnapshotHandler(snapshot: IFileSnapshot): void;
|
|
113
|
+
// (undocumented)
|
|
114
|
+
reset(): void;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// @public (undocumented)
|
|
118
|
+
export type ReaderConstructor = new (...args: any[]) => IDocumentStorageService;
|
|
119
|
+
|
|
120
|
+
// @public
|
|
121
|
+
export class Replayer {
|
|
122
|
+
constructor(deltaConnection: ReplayFileDeltaConnection, documentStorageService: FileDeltaStorageService);
|
|
123
|
+
// (undocumented)
|
|
124
|
+
get currentReplayedOp(): number;
|
|
125
|
+
set currentReplayedOp(op: number);
|
|
126
|
+
// (undocumented)
|
|
127
|
+
get ops(): readonly Readonly<ISequencedDocumentMessage>[];
|
|
128
|
+
replay(replayTo: number): number;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// @public (undocumented)
|
|
132
|
+
export class ReplayFileDeltaConnection extends TypedEventEmitter<IDocumentDeltaConnectionEvents> implements IDocumentDeltaConnection, IDisposable {
|
|
133
|
+
constructor(details: IConnected, documentDeltaStorageService: FileDeltaStorageService);
|
|
134
|
+
// (undocumented)
|
|
135
|
+
get claims(): ITokenClaims;
|
|
136
|
+
// (undocumented)
|
|
137
|
+
get clientId(): string;
|
|
138
|
+
static create(documentDeltaStorageService: FileDeltaStorageService): Promise<ReplayFileDeltaConnection>;
|
|
139
|
+
// (undocumented)
|
|
140
|
+
details: IConnected;
|
|
141
|
+
// (undocumented)
|
|
142
|
+
dispose(): void;
|
|
143
|
+
// (undocumented)
|
|
144
|
+
get disposed(): boolean;
|
|
145
|
+
// (undocumented)
|
|
146
|
+
get existing(): boolean;
|
|
147
|
+
// (undocumented)
|
|
148
|
+
getReplayer(): Replayer;
|
|
149
|
+
// (undocumented)
|
|
150
|
+
get initialClients(): ISignalClient[];
|
|
151
|
+
// (undocumented)
|
|
152
|
+
get initialMessages(): ISequencedDocumentMessage[];
|
|
153
|
+
// (undocumented)
|
|
154
|
+
get initialSignals(): ISignalMessage[];
|
|
155
|
+
// (undocumented)
|
|
156
|
+
readonly maxMessageSize: number;
|
|
157
|
+
// (undocumented)
|
|
158
|
+
get mode(): ConnectionMode;
|
|
159
|
+
// (undocumented)
|
|
160
|
+
get serviceConfiguration(): IClientConfiguration;
|
|
161
|
+
// (undocumented)
|
|
162
|
+
submit(documentMessages: IDocumentMessage[]): void;
|
|
163
|
+
// (undocumented)
|
|
164
|
+
submitSignal(message: any): Promise<void>;
|
|
165
|
+
// (undocumented)
|
|
166
|
+
get version(): string;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// (No @packageDocumentation comment for this package)
|
|
170
|
+
|
|
171
|
+
```
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import * as api from '@fluidframework/protocol-definitions';
|
|
2
|
+
import { ConnectionMode } from '@fluidframework/protocol-definitions';
|
|
3
|
+
import { IClientConfiguration } from '@fluidframework/protocol-definitions';
|
|
4
|
+
import { IConnected } from '@fluidframework/protocol-definitions';
|
|
5
|
+
import { IDisposable } from '@fluidframework/core-interfaces';
|
|
6
|
+
import { IDocumentDeltaConnection } from '@fluidframework/driver-definitions';
|
|
7
|
+
import { IDocumentDeltaConnectionEvents } from '@fluidframework/driver-definitions';
|
|
8
|
+
import { IDocumentDeltaStorageService } from '@fluidframework/driver-definitions';
|
|
9
|
+
import { IDocumentMessage } from '@fluidframework/protocol-definitions';
|
|
10
|
+
import { IDocumentService } from '@fluidframework/driver-definitions';
|
|
11
|
+
import { IDocumentServiceFactory } from '@fluidframework/driver-definitions';
|
|
12
|
+
import { IDocumentStorageService } from '@fluidframework/driver-definitions';
|
|
13
|
+
import { IDocumentStorageServicePolicies } from '@fluidframework/driver-definitions';
|
|
14
|
+
import { IFileSnapshot } from '@fluidframework/replay-driver';
|
|
15
|
+
import { IResolvedUrl } from '@fluidframework/driver-definitions';
|
|
16
|
+
import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
|
|
17
|
+
import { ISignalClient } from '@fluidframework/protocol-definitions';
|
|
18
|
+
import { ISignalMessage } from '@fluidframework/protocol-definitions';
|
|
19
|
+
import { IStream } from '@fluidframework/driver-definitions';
|
|
20
|
+
import { ISummaryContext } from '@fluidframework/driver-definitions';
|
|
21
|
+
import { ISummaryTree } from '@fluidframework/protocol-definitions';
|
|
22
|
+
import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
|
|
23
|
+
import { ITokenClaims } from '@fluidframework/protocol-definitions';
|
|
24
|
+
import { ReadDocumentStorageServiceBase } from '@fluidframework/replay-driver';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Provides access to the underlying delta storage on the local file storage for file driver.
|
|
28
|
+
*/
|
|
29
|
+
export declare class FileDeltaStorageService implements IDocumentDeltaStorageService {
|
|
30
|
+
private readonly path;
|
|
31
|
+
private readonly messages;
|
|
32
|
+
private lastOps;
|
|
33
|
+
constructor(path: string);
|
|
34
|
+
fetchMessages(from: number, to: number | undefined, abortSignal?: AbortSignal, cachedOnly?: boolean): IStream<api.ISequencedDocumentMessage[]>;
|
|
35
|
+
get ops(): readonly Readonly<api.ISequencedDocumentMessage>[];
|
|
36
|
+
/**
|
|
37
|
+
* Retrieve ops within the exclusive sequence number range.
|
|
38
|
+
*
|
|
39
|
+
* @param from - First op to be fetched.
|
|
40
|
+
* @param to - Last op to be fetched. This is exclusive.
|
|
41
|
+
*/
|
|
42
|
+
getFromWebSocket(from: number, to: number): api.ISequencedDocumentMessage[];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Factory for creating the file document service. Use this if you want to
|
|
47
|
+
* use the local file storage as underlying storage.
|
|
48
|
+
*/
|
|
49
|
+
export declare class FileDocumentServiceFactory implements IDocumentServiceFactory {
|
|
50
|
+
private readonly storage;
|
|
51
|
+
private readonly deltaStorage;
|
|
52
|
+
private readonly deltaConnection;
|
|
53
|
+
constructor(storage: IDocumentStorageService, deltaStorage: FileDeltaStorageService, deltaConnection: IDocumentDeltaConnection);
|
|
54
|
+
/**
|
|
55
|
+
* Creates the file document service if the path exists.
|
|
56
|
+
*
|
|
57
|
+
* @param fileURL - Path of directory containing ops/snapshots.
|
|
58
|
+
* @returns file document service.
|
|
59
|
+
*/
|
|
60
|
+
createDocumentService(resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
|
|
61
|
+
createContainer(createNewSummary: ISummaryTree, resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export declare const FileSnapshotWriterClassFactory: <TBase extends ReaderConstructor>(Base: TBase) => {
|
|
65
|
+
new (...args: any[]): {
|
|
66
|
+
blobsWriter: Map<string, ArrayBufferLike>;
|
|
67
|
+
latestWriterTree?: api.ISnapshotTree | undefined;
|
|
68
|
+
docId?: string | undefined;
|
|
69
|
+
reset(): void;
|
|
70
|
+
onSnapshotHandler(snapshot: IFileSnapshot): void;
|
|
71
|
+
readBlob(sha: string): Promise<ArrayBufferLike>;
|
|
72
|
+
getVersions(versionId: string | null, count: number): Promise<api.IVersion[]>;
|
|
73
|
+
getSnapshotTree(version?: api.IVersion): Promise<api.ISnapshotTree | null>;
|
|
74
|
+
uploadSummaryWithContext(summary: api.ISummaryTree, context: ISummaryContext): Promise<string>;
|
|
75
|
+
buildTree(snapshotTree: api.ISnapshotTree): Promise<api.ITree>;
|
|
76
|
+
repositoryUrl: string;
|
|
77
|
+
readonly policies?: IDocumentStorageServicePolicies | undefined;
|
|
78
|
+
createBlob(file: ArrayBufferLike): Promise<api.ICreateBlobResponse>;
|
|
79
|
+
downloadSummary(handle: api.ISummaryHandle): Promise<api.ISummaryTree>;
|
|
80
|
+
readonly disposed?: boolean | undefined;
|
|
81
|
+
dispose?: ((error?: Error | undefined) => void) | undefined;
|
|
82
|
+
};
|
|
83
|
+
} & TBase;
|
|
84
|
+
|
|
85
|
+
export declare const FileStorageDocumentName = "FileStorageDocId";
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Document storage service for the file driver.
|
|
89
|
+
*/
|
|
90
|
+
export declare class FluidFetchReader extends ReadDocumentStorageServiceBase implements IDocumentStorageService {
|
|
91
|
+
private readonly path;
|
|
92
|
+
private readonly versionName?;
|
|
93
|
+
protected docTree: api.ISnapshotTree | null;
|
|
94
|
+
constructor(path: string, versionName?: string | undefined);
|
|
95
|
+
/**
|
|
96
|
+
* Read the file and returns the snapshot tree.
|
|
97
|
+
* @param version - The version contains the path of the file which contains the snapshot tree.
|
|
98
|
+
*/
|
|
99
|
+
getSnapshotTree(version?: api.IVersion): Promise<api.ISnapshotTree | null>;
|
|
100
|
+
/**
|
|
101
|
+
* Gets the path of the snapshot tree to be read.
|
|
102
|
+
* @param versionId - version ID.
|
|
103
|
+
* @param count - Number of versions to be returned.
|
|
104
|
+
*/
|
|
105
|
+
getVersions(versionId: string | null, count: number): Promise<api.IVersion[]>;
|
|
106
|
+
readBlob(sha: string): Promise<ArrayBufferLike>;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export declare const FluidFetchReaderFileSnapshotWriter: {
|
|
110
|
+
new (...args: any[]): {
|
|
111
|
+
blobsWriter: Map<string, ArrayBufferLike>;
|
|
112
|
+
latestWriterTree?: api.ISnapshotTree | undefined;
|
|
113
|
+
docId?: string | undefined;
|
|
114
|
+
reset(): void;
|
|
115
|
+
onSnapshotHandler(snapshot: IFileSnapshot): void;
|
|
116
|
+
readBlob(sha: string): Promise<ArrayBufferLike>;
|
|
117
|
+
getVersions(versionId: string | null, count: number): Promise<api.IVersion[]>;
|
|
118
|
+
getSnapshotTree(version?: api.IVersion): Promise<api.ISnapshotTree | null>;
|
|
119
|
+
uploadSummaryWithContext(summary: api.ISummaryTree, context: ISummaryContext): Promise<string>;
|
|
120
|
+
buildTree(snapshotTree: api.ISnapshotTree): Promise<api.ITree>;
|
|
121
|
+
repositoryUrl: string;
|
|
122
|
+
readonly policies?: IDocumentStorageServicePolicies | undefined;
|
|
123
|
+
createBlob(file: ArrayBufferLike): Promise<api.ICreateBlobResponse>;
|
|
124
|
+
downloadSummary(handle: api.ISummaryHandle): Promise<api.ISummaryTree>;
|
|
125
|
+
readonly disposed?: boolean | undefined;
|
|
126
|
+
dispose?: ((error?: Error | undefined) => void) | undefined;
|
|
127
|
+
};
|
|
128
|
+
} & typeof FluidFetchReader;
|
|
129
|
+
|
|
130
|
+
export declare interface ISnapshotWriterStorage extends IDocumentStorageService {
|
|
131
|
+
onSnapshotHandler(snapshot: IFileSnapshot): void;
|
|
132
|
+
reset(): void;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export declare type ReaderConstructor = new (...args: any[]) => IDocumentStorageService;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Replay service used to play ops using the delta connection.
|
|
139
|
+
*/
|
|
140
|
+
export declare class Replayer {
|
|
141
|
+
private readonly deltaConnection;
|
|
142
|
+
private readonly documentStorageService;
|
|
143
|
+
private currentReplayOp;
|
|
144
|
+
constructor(deltaConnection: ReplayFileDeltaConnection, documentStorageService: FileDeltaStorageService);
|
|
145
|
+
get currentReplayedOp(): number;
|
|
146
|
+
set currentReplayedOp(op: number);
|
|
147
|
+
get ops(): readonly Readonly<ISequencedDocumentMessage>[];
|
|
148
|
+
/**
|
|
149
|
+
* Replay the ops upto a certain number.
|
|
150
|
+
* @param replayTo - The last op number to be replayed.
|
|
151
|
+
*/
|
|
152
|
+
replay(replayTo: number): number;
|
|
153
|
+
private isDoneFetch;
|
|
154
|
+
private emit;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export declare class ReplayFileDeltaConnection extends TypedEventEmitter<IDocumentDeltaConnectionEvents> implements IDocumentDeltaConnection, IDisposable {
|
|
158
|
+
details: IConnected;
|
|
159
|
+
/**
|
|
160
|
+
* Mimic the delta connection to replay ops on it.
|
|
161
|
+
*
|
|
162
|
+
* @param documentDeltaStorageService - The delta storage service to get ops from.
|
|
163
|
+
* @returns Document delta connection.
|
|
164
|
+
*/
|
|
165
|
+
static create(documentDeltaStorageService: FileDeltaStorageService): Promise<ReplayFileDeltaConnection>;
|
|
166
|
+
readonly maxMessageSize: number;
|
|
167
|
+
private readonly replayer;
|
|
168
|
+
constructor(details: IConnected, documentDeltaStorageService: FileDeltaStorageService);
|
|
169
|
+
getReplayer(): Replayer;
|
|
170
|
+
get clientId(): string;
|
|
171
|
+
get mode(): ConnectionMode;
|
|
172
|
+
get claims(): ITokenClaims;
|
|
173
|
+
get existing(): boolean;
|
|
174
|
+
get version(): string;
|
|
175
|
+
get initialMessages(): ISequencedDocumentMessage[];
|
|
176
|
+
get initialSignals(): ISignalMessage[];
|
|
177
|
+
get initialClients(): ISignalClient[];
|
|
178
|
+
get serviceConfiguration(): IClientConfiguration;
|
|
179
|
+
submit(documentMessages: IDocumentMessage[]): void;
|
|
180
|
+
submitSignal(message: any): Promise<void>;
|
|
181
|
+
private _disposed;
|
|
182
|
+
get disposed(): boolean;
|
|
183
|
+
dispose(): void;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/* Excluded from this release type: TypedEventEmitter */
|
|
187
|
+
|
|
188
|
+
export { }
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import * as api from '@fluidframework/protocol-definitions';
|
|
2
|
+
import { ConnectionMode } from '@fluidframework/protocol-definitions';
|
|
3
|
+
import { IClientConfiguration } from '@fluidframework/protocol-definitions';
|
|
4
|
+
import { IConnected } from '@fluidframework/protocol-definitions';
|
|
5
|
+
import { IDisposable } from '@fluidframework/core-interfaces';
|
|
6
|
+
import { IDocumentDeltaConnection } from '@fluidframework/driver-definitions';
|
|
7
|
+
import { IDocumentDeltaConnectionEvents } from '@fluidframework/driver-definitions';
|
|
8
|
+
import { IDocumentDeltaStorageService } from '@fluidframework/driver-definitions';
|
|
9
|
+
import { IDocumentMessage } from '@fluidframework/protocol-definitions';
|
|
10
|
+
import { IDocumentService } from '@fluidframework/driver-definitions';
|
|
11
|
+
import { IDocumentServiceFactory } from '@fluidframework/driver-definitions';
|
|
12
|
+
import { IDocumentStorageService } from '@fluidframework/driver-definitions';
|
|
13
|
+
import { IDocumentStorageServicePolicies } from '@fluidframework/driver-definitions';
|
|
14
|
+
import { IFileSnapshot } from '@fluidframework/replay-driver';
|
|
15
|
+
import { IResolvedUrl } from '@fluidframework/driver-definitions';
|
|
16
|
+
import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
|
|
17
|
+
import { ISignalClient } from '@fluidframework/protocol-definitions';
|
|
18
|
+
import { ISignalMessage } from '@fluidframework/protocol-definitions';
|
|
19
|
+
import { IStream } from '@fluidframework/driver-definitions';
|
|
20
|
+
import { ISummaryContext } from '@fluidframework/driver-definitions';
|
|
21
|
+
import { ISummaryTree } from '@fluidframework/protocol-definitions';
|
|
22
|
+
import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
|
|
23
|
+
import { ITokenClaims } from '@fluidframework/protocol-definitions';
|
|
24
|
+
import { ReadDocumentStorageServiceBase } from '@fluidframework/replay-driver';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Provides access to the underlying delta storage on the local file storage for file driver.
|
|
28
|
+
*/
|
|
29
|
+
export declare class FileDeltaStorageService implements IDocumentDeltaStorageService {
|
|
30
|
+
private readonly path;
|
|
31
|
+
private readonly messages;
|
|
32
|
+
private lastOps;
|
|
33
|
+
constructor(path: string);
|
|
34
|
+
fetchMessages(from: number, to: number | undefined, abortSignal?: AbortSignal, cachedOnly?: boolean): IStream<api.ISequencedDocumentMessage[]>;
|
|
35
|
+
get ops(): readonly Readonly<api.ISequencedDocumentMessage>[];
|
|
36
|
+
/**
|
|
37
|
+
* Retrieve ops within the exclusive sequence number range.
|
|
38
|
+
*
|
|
39
|
+
* @param from - First op to be fetched.
|
|
40
|
+
* @param to - Last op to be fetched. This is exclusive.
|
|
41
|
+
*/
|
|
42
|
+
getFromWebSocket(from: number, to: number): api.ISequencedDocumentMessage[];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Factory for creating the file document service. Use this if you want to
|
|
47
|
+
* use the local file storage as underlying storage.
|
|
48
|
+
*/
|
|
49
|
+
export declare class FileDocumentServiceFactory implements IDocumentServiceFactory {
|
|
50
|
+
private readonly storage;
|
|
51
|
+
private readonly deltaStorage;
|
|
52
|
+
private readonly deltaConnection;
|
|
53
|
+
constructor(storage: IDocumentStorageService, deltaStorage: FileDeltaStorageService, deltaConnection: IDocumentDeltaConnection);
|
|
54
|
+
/**
|
|
55
|
+
* Creates the file document service if the path exists.
|
|
56
|
+
*
|
|
57
|
+
* @param fileURL - Path of directory containing ops/snapshots.
|
|
58
|
+
* @returns file document service.
|
|
59
|
+
*/
|
|
60
|
+
createDocumentService(resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
|
|
61
|
+
createContainer(createNewSummary: ISummaryTree, resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export declare const FileSnapshotWriterClassFactory: <TBase extends ReaderConstructor>(Base: TBase) => {
|
|
65
|
+
new (...args: any[]): {
|
|
66
|
+
blobsWriter: Map<string, ArrayBufferLike>;
|
|
67
|
+
latestWriterTree?: api.ISnapshotTree | undefined;
|
|
68
|
+
docId?: string | undefined;
|
|
69
|
+
reset(): void;
|
|
70
|
+
onSnapshotHandler(snapshot: IFileSnapshot): void;
|
|
71
|
+
readBlob(sha: string): Promise<ArrayBufferLike>;
|
|
72
|
+
getVersions(versionId: string | null, count: number): Promise<api.IVersion[]>;
|
|
73
|
+
getSnapshotTree(version?: api.IVersion): Promise<api.ISnapshotTree | null>;
|
|
74
|
+
uploadSummaryWithContext(summary: api.ISummaryTree, context: ISummaryContext): Promise<string>;
|
|
75
|
+
buildTree(snapshotTree: api.ISnapshotTree): Promise<api.ITree>;
|
|
76
|
+
repositoryUrl: string;
|
|
77
|
+
readonly policies?: IDocumentStorageServicePolicies | undefined;
|
|
78
|
+
createBlob(file: ArrayBufferLike): Promise<api.ICreateBlobResponse>;
|
|
79
|
+
downloadSummary(handle: api.ISummaryHandle): Promise<api.ISummaryTree>;
|
|
80
|
+
readonly disposed?: boolean | undefined;
|
|
81
|
+
dispose?: ((error?: Error | undefined) => void) | undefined;
|
|
82
|
+
};
|
|
83
|
+
} & TBase;
|
|
84
|
+
|
|
85
|
+
export declare const FileStorageDocumentName = "FileStorageDocId";
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Document storage service for the file driver.
|
|
89
|
+
*/
|
|
90
|
+
export declare class FluidFetchReader extends ReadDocumentStorageServiceBase implements IDocumentStorageService {
|
|
91
|
+
private readonly path;
|
|
92
|
+
private readonly versionName?;
|
|
93
|
+
protected docTree: api.ISnapshotTree | null;
|
|
94
|
+
constructor(path: string, versionName?: string | undefined);
|
|
95
|
+
/**
|
|
96
|
+
* Read the file and returns the snapshot tree.
|
|
97
|
+
* @param version - The version contains the path of the file which contains the snapshot tree.
|
|
98
|
+
*/
|
|
99
|
+
getSnapshotTree(version?: api.IVersion): Promise<api.ISnapshotTree | null>;
|
|
100
|
+
/**
|
|
101
|
+
* Gets the path of the snapshot tree to be read.
|
|
102
|
+
* @param versionId - version ID.
|
|
103
|
+
* @param count - Number of versions to be returned.
|
|
104
|
+
*/
|
|
105
|
+
getVersions(versionId: string | null, count: number): Promise<api.IVersion[]>;
|
|
106
|
+
readBlob(sha: string): Promise<ArrayBufferLike>;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export declare const FluidFetchReaderFileSnapshotWriter: {
|
|
110
|
+
new (...args: any[]): {
|
|
111
|
+
blobsWriter: Map<string, ArrayBufferLike>;
|
|
112
|
+
latestWriterTree?: api.ISnapshotTree | undefined;
|
|
113
|
+
docId?: string | undefined;
|
|
114
|
+
reset(): void;
|
|
115
|
+
onSnapshotHandler(snapshot: IFileSnapshot): void;
|
|
116
|
+
readBlob(sha: string): Promise<ArrayBufferLike>;
|
|
117
|
+
getVersions(versionId: string | null, count: number): Promise<api.IVersion[]>;
|
|
118
|
+
getSnapshotTree(version?: api.IVersion): Promise<api.ISnapshotTree | null>;
|
|
119
|
+
uploadSummaryWithContext(summary: api.ISummaryTree, context: ISummaryContext): Promise<string>;
|
|
120
|
+
buildTree(snapshotTree: api.ISnapshotTree): Promise<api.ITree>;
|
|
121
|
+
repositoryUrl: string;
|
|
122
|
+
readonly policies?: IDocumentStorageServicePolicies | undefined;
|
|
123
|
+
createBlob(file: ArrayBufferLike): Promise<api.ICreateBlobResponse>;
|
|
124
|
+
downloadSummary(handle: api.ISummaryHandle): Promise<api.ISummaryTree>;
|
|
125
|
+
readonly disposed?: boolean | undefined;
|
|
126
|
+
dispose?: ((error?: Error | undefined) => void) | undefined;
|
|
127
|
+
};
|
|
128
|
+
} & typeof FluidFetchReader;
|
|
129
|
+
|
|
130
|
+
export declare interface ISnapshotWriterStorage extends IDocumentStorageService {
|
|
131
|
+
onSnapshotHandler(snapshot: IFileSnapshot): void;
|
|
132
|
+
reset(): void;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export declare type ReaderConstructor = new (...args: any[]) => IDocumentStorageService;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Replay service used to play ops using the delta connection.
|
|
139
|
+
*/
|
|
140
|
+
export declare class Replayer {
|
|
141
|
+
private readonly deltaConnection;
|
|
142
|
+
private readonly documentStorageService;
|
|
143
|
+
private currentReplayOp;
|
|
144
|
+
constructor(deltaConnection: ReplayFileDeltaConnection, documentStorageService: FileDeltaStorageService);
|
|
145
|
+
get currentReplayedOp(): number;
|
|
146
|
+
set currentReplayedOp(op: number);
|
|
147
|
+
get ops(): readonly Readonly<ISequencedDocumentMessage>[];
|
|
148
|
+
/**
|
|
149
|
+
* Replay the ops upto a certain number.
|
|
150
|
+
* @param replayTo - The last op number to be replayed.
|
|
151
|
+
*/
|
|
152
|
+
replay(replayTo: number): number;
|
|
153
|
+
private isDoneFetch;
|
|
154
|
+
private emit;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export declare class ReplayFileDeltaConnection extends TypedEventEmitter<IDocumentDeltaConnectionEvents> implements IDocumentDeltaConnection, IDisposable {
|
|
158
|
+
details: IConnected;
|
|
159
|
+
/**
|
|
160
|
+
* Mimic the delta connection to replay ops on it.
|
|
161
|
+
*
|
|
162
|
+
* @param documentDeltaStorageService - The delta storage service to get ops from.
|
|
163
|
+
* @returns Document delta connection.
|
|
164
|
+
*/
|
|
165
|
+
static create(documentDeltaStorageService: FileDeltaStorageService): Promise<ReplayFileDeltaConnection>;
|
|
166
|
+
readonly maxMessageSize: number;
|
|
167
|
+
private readonly replayer;
|
|
168
|
+
constructor(details: IConnected, documentDeltaStorageService: FileDeltaStorageService);
|
|
169
|
+
getReplayer(): Replayer;
|
|
170
|
+
get clientId(): string;
|
|
171
|
+
get mode(): ConnectionMode;
|
|
172
|
+
get claims(): ITokenClaims;
|
|
173
|
+
get existing(): boolean;
|
|
174
|
+
get version(): string;
|
|
175
|
+
get initialMessages(): ISequencedDocumentMessage[];
|
|
176
|
+
get initialSignals(): ISignalMessage[];
|
|
177
|
+
get initialClients(): ISignalClient[];
|
|
178
|
+
get serviceConfiguration(): IClientConfiguration;
|
|
179
|
+
submit(documentMessages: IDocumentMessage[]): void;
|
|
180
|
+
submitSignal(message: any): Promise<void>;
|
|
181
|
+
private _disposed;
|
|
182
|
+
get disposed(): boolean;
|
|
183
|
+
dispose(): void;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/* Excluded from this release type: TypedEventEmitter */
|
|
187
|
+
|
|
188
|
+
export { }
|