@fluidframework/local-driver 2.0.0-dev.5.2.0.169897 → 2.0.0-dev.6.4.0.191258
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 +36 -0
- package/README.md +4 -3
- package/dist/localCreateDocument.d.ts.map +1 -1
- package/dist/localCreateDocument.js +1 -5
- package/dist/localCreateDocument.js.map +1 -1
- package/dist/localDeltaStorageService.js +1 -1
- package/dist/localDeltaStorageService.js.map +1 -1
- package/dist/localDocumentDeltaConnection.d.ts +3 -2
- package/dist/localDocumentDeltaConnection.d.ts.map +1 -1
- package/dist/localDocumentDeltaConnection.js +4 -4
- package/dist/localDocumentDeltaConnection.js.map +1 -1
- package/dist/localDocumentService.d.ts +4 -2
- package/dist/localDocumentService.d.ts.map +1 -1
- package/dist/localDocumentService.js +5 -4
- package/dist/localDocumentService.js.map +1 -1
- package/dist/localDocumentServiceFactory.d.ts +1 -1
- package/dist/localDocumentServiceFactory.d.ts.map +1 -1
- package/dist/localDocumentServiceFactory.js +1 -1
- package/dist/localDocumentServiceFactory.js.map +1 -1
- package/dist/localDocumentStorageService.d.ts +2 -2
- package/dist/localDocumentStorageService.d.ts.map +1 -1
- package/dist/localDocumentStorageService.js +5 -6
- package/dist/localDocumentStorageService.js.map +1 -1
- package/dist/localResolver.js +2 -2
- package/dist/localResolver.js.map +1 -1
- package/lib/localCreateDocument.d.ts.map +1 -1
- package/lib/localCreateDocument.js +1 -5
- package/lib/localCreateDocument.js.map +1 -1
- package/lib/localDeltaStorageService.js +1 -1
- package/lib/localDeltaStorageService.js.map +1 -1
- package/lib/localDocumentDeltaConnection.d.ts +3 -2
- package/lib/localDocumentDeltaConnection.d.ts.map +1 -1
- package/lib/localDocumentDeltaConnection.js +5 -5
- package/lib/localDocumentDeltaConnection.js.map +1 -1
- package/lib/localDocumentService.d.ts +4 -2
- package/lib/localDocumentService.d.ts.map +1 -1
- package/lib/localDocumentService.js +5 -4
- package/lib/localDocumentService.js.map +1 -1
- package/lib/localDocumentServiceFactory.d.ts +1 -1
- package/lib/localDocumentServiceFactory.d.ts.map +1 -1
- package/lib/localDocumentServiceFactory.js +1 -1
- package/lib/localDocumentServiceFactory.js.map +1 -1
- package/lib/localDocumentStorageService.d.ts +2 -2
- package/lib/localDocumentStorageService.d.ts.map +1 -1
- package/lib/localDocumentStorageService.js +4 -5
- package/lib/localDocumentStorageService.js.map +1 -1
- package/lib/localResolver.js +1 -1
- package/lib/localResolver.js.map +1 -1
- package/package.json +28 -30
- package/src/localCreateDocument.ts +0 -2
- package/src/localDocumentDeltaConnection.ts +6 -4
- package/src/localDocumentService.ts +6 -0
- package/src/localDocumentServiceFactory.ts +2 -1
- package/src/localDocumentStorageService.ts +3 -3
- package/src/localResolver.ts +1 -1
|
@@ -10,10 +10,11 @@ import {
|
|
|
10
10
|
IDocumentMessage,
|
|
11
11
|
NackErrorType,
|
|
12
12
|
} from "@fluidframework/protocol-definitions";
|
|
13
|
-
import {
|
|
13
|
+
import { createChildLogger } from "@fluidframework/telemetry-utils";
|
|
14
14
|
import { LocalWebSocketServer } from "@fluidframework/server-local-server";
|
|
15
15
|
import { IWebSocketServer } from "@fluidframework/server-services-core";
|
|
16
16
|
import type { Socket } from "socket.io-client";
|
|
17
|
+
import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
17
18
|
|
|
18
19
|
const testProtocolVersions = ["^0.3.0", "^0.2.0", "^0.1.0"];
|
|
19
20
|
|
|
@@ -38,6 +39,7 @@ export class LocalDocumentDeltaConnection extends DocumentDeltaConnection {
|
|
|
38
39
|
client: IClient,
|
|
39
40
|
webSocketServer: IWebSocketServer,
|
|
40
41
|
timeoutMs = 60000,
|
|
42
|
+
logger?: ITelemetryBaseLogger,
|
|
41
43
|
): Promise<LocalDocumentDeltaConnection> {
|
|
42
44
|
const socket = (webSocketServer as LocalWebSocketServer).createConnection();
|
|
43
45
|
|
|
@@ -45,7 +47,7 @@ export class LocalDocumentDeltaConnection extends DocumentDeltaConnection {
|
|
|
45
47
|
// but should be fine because this delta connection is for local use only.
|
|
46
48
|
const socketWithListener = socket as unknown as Socket;
|
|
47
49
|
|
|
48
|
-
const deltaConnection = new LocalDocumentDeltaConnection(socketWithListener, id);
|
|
50
|
+
const deltaConnection = new LocalDocumentDeltaConnection(socketWithListener, id, logger);
|
|
49
51
|
|
|
50
52
|
const connectMessage: IConnect = {
|
|
51
53
|
client,
|
|
@@ -59,8 +61,8 @@ export class LocalDocumentDeltaConnection extends DocumentDeltaConnection {
|
|
|
59
61
|
return deltaConnection;
|
|
60
62
|
}
|
|
61
63
|
|
|
62
|
-
constructor(socket: Socket, documentId: string) {
|
|
63
|
-
super(socket, documentId,
|
|
64
|
+
constructor(socket: Socket, documentId: string, logger?: ITelemetryBaseLogger) {
|
|
65
|
+
super(socket, documentId, createChildLogger({ logger }));
|
|
64
66
|
}
|
|
65
67
|
|
|
66
68
|
/**
|
|
@@ -16,6 +16,7 @@ import { ITokenProvider } from "@fluidframework/routerlicious-driver";
|
|
|
16
16
|
import { GitManager } from "@fluidframework/server-services-client";
|
|
17
17
|
import { TestHistorian } from "@fluidframework/server-test-utils";
|
|
18
18
|
import { ILocalDeltaConnectionServer } from "@fluidframework/server-local-server";
|
|
19
|
+
import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
19
20
|
import { LocalDocumentStorageService } from "./localDocumentStorageService";
|
|
20
21
|
import { LocalDocumentDeltaConnection } from "./localDocumentDeltaConnection";
|
|
21
22
|
import { LocalDeltaStorageService } from "./localDeltaStorageService";
|
|
@@ -39,6 +40,7 @@ export class LocalDocumentService implements IDocumentService {
|
|
|
39
40
|
private readonly documentDeltaConnectionsMap: Map<string, LocalDocumentDeltaConnection>,
|
|
40
41
|
public readonly policies: IDocumentServicePolicies = {},
|
|
41
42
|
private readonly innerDocumentService?: IDocumentService,
|
|
43
|
+
private readonly logger?: ITelemetryBaseLogger,
|
|
42
44
|
) {}
|
|
43
45
|
|
|
44
46
|
public dispose() {}
|
|
@@ -96,6 +98,8 @@ export class LocalDocumentService implements IDocumentService {
|
|
|
96
98
|
ordererToken.jwt,
|
|
97
99
|
client,
|
|
98
100
|
this.localDeltaConnectionServer.webSocketServer,
|
|
101
|
+
undefined,
|
|
102
|
+
this.logger,
|
|
99
103
|
);
|
|
100
104
|
const clientId = documentDeltaConnection.clientId;
|
|
101
105
|
|
|
@@ -127,6 +131,7 @@ export function createLocalDocumentService(
|
|
|
127
131
|
documentDeltaConnectionsMap: Map<string, LocalDocumentDeltaConnection>,
|
|
128
132
|
policies?: IDocumentServicePolicies,
|
|
129
133
|
innerDocumentService?: IDocumentService,
|
|
134
|
+
logger?: ITelemetryBaseLogger,
|
|
130
135
|
): IDocumentService {
|
|
131
136
|
return new LocalDocumentService(
|
|
132
137
|
resolvedUrl,
|
|
@@ -137,5 +142,6 @@ export function createLocalDocumentService(
|
|
|
137
142
|
documentDeltaConnectionsMap,
|
|
138
143
|
policies,
|
|
139
144
|
innerDocumentService,
|
|
145
|
+
logger,
|
|
140
146
|
);
|
|
141
147
|
}
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
IDocumentServicePolicies,
|
|
11
11
|
IResolvedUrl,
|
|
12
12
|
} from "@fluidframework/driver-definitions";
|
|
13
|
-
import { ITelemetryBaseLogger } from "@fluidframework/
|
|
13
|
+
import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
14
14
|
import { DefaultTokenProvider } from "@fluidframework/routerlicious-driver";
|
|
15
15
|
import { ILocalDeltaConnectionServer } from "@fluidframework/server-local-server";
|
|
16
16
|
import { ISummaryTree, NackErrorType } from "@fluidframework/protocol-definitions";
|
|
@@ -85,6 +85,7 @@ export class LocalDocumentServiceFactory implements IDocumentServiceFactory {
|
|
|
85
85
|
this.documentDeltaConnectionsMap,
|
|
86
86
|
this.policies,
|
|
87
87
|
this.innerDocumentService,
|
|
88
|
+
logger,
|
|
88
89
|
);
|
|
89
90
|
}
|
|
90
91
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { stringToBuffer, Uint8ArrayToString } from "@
|
|
6
|
+
import { stringToBuffer, Uint8ArrayToString } from "@fluid-internal/client-utils";
|
|
7
7
|
import {
|
|
8
8
|
IDocumentStorageService,
|
|
9
9
|
IDocumentStorageServicePolicies,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
ISummaryTree,
|
|
18
18
|
IVersion,
|
|
19
19
|
} from "@fluidframework/protocol-definitions";
|
|
20
|
-
import {
|
|
20
|
+
import { buildGitTreeHierarchy } from "@fluidframework/protocol-base";
|
|
21
21
|
import {
|
|
22
22
|
GitManager,
|
|
23
23
|
ISummaryUploadManager,
|
|
@@ -73,7 +73,7 @@ export class LocalDocumentStorageService implements IDocumentStorageService {
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
const rawTree = await this.manager.getTree(requestVersion.treeId);
|
|
76
|
-
const tree =
|
|
76
|
+
const tree = buildGitTreeHierarchy(rawTree, this.blobsShaCache, true);
|
|
77
77
|
return tree;
|
|
78
78
|
}
|
|
79
79
|
|
package/src/localResolver.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { parse } from "url";
|
|
7
|
-
import { assert } from "@fluidframework/
|
|
7
|
+
import { assert } from "@fluidframework/core-utils";
|
|
8
8
|
import { IRequest } from "@fluidframework/core-interfaces";
|
|
9
9
|
import { IResolvedUrl, IUrlResolver, DriverHeader } from "@fluidframework/driver-definitions";
|
|
10
10
|
import { ScopeType } from "@fluidframework/protocol-definitions";
|