@fluidframework/local-driver 2.0.0-dev-rc.2.0.0.246488 → 2.0.0-dev-rc.3.0.0.253463
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/api-report/local-driver.api.md +16 -16
- package/dist/local-driver-alpha.d.ts +15 -15
- package/dist/local-driver-beta.d.ts +15 -15
- package/dist/local-driver-public.d.ts +15 -15
- package/dist/local-driver-untrimmed.d.ts +16 -16
- package/dist/localCreateDocument.d.ts +1 -1
- package/dist/localCreateDocument.d.ts.map +1 -1
- package/dist/localCreateDocument.js +4 -4
- package/dist/localCreateDocument.js.map +1 -1
- package/dist/localDeltaStorageService.d.ts +1 -1
- package/dist/localDeltaStorageService.d.ts.map +1 -1
- package/dist/localDeltaStorageService.js +2 -2
- package/dist/localDeltaStorageService.js.map +1 -1
- package/dist/localDocumentDeltaConnection.d.ts +3 -3
- 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 +2 -2
- package/dist/localDocumentService.d.ts.map +1 -1
- package/dist/localDocumentService.js +2 -2
- package/dist/localDocumentService.js.map +1 -1
- package/dist/localDocumentServiceFactory.d.ts +2 -2
- package/dist/localDocumentServiceFactory.d.ts.map +1 -1
- package/dist/localDocumentServiceFactory.js +3 -3
- 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 +3 -3
- package/dist/localDocumentStorageService.js.map +1 -1
- package/dist/localResolver.d.ts +1 -1
- package/dist/localResolver.d.ts.map +1 -1
- package/dist/localResolver.js +4 -4
- package/dist/localResolver.js.map +1 -1
- package/lib/local-driver-alpha.d.ts +15 -15
- package/lib/local-driver-beta.d.ts +15 -15
- package/lib/local-driver-public.d.ts +15 -15
- package/lib/local-driver-untrimmed.d.ts +16 -16
- package/lib/localCreateDocument.d.ts +1 -1
- package/lib/localCreateDocument.d.ts.map +1 -1
- package/lib/localCreateDocument.js +1 -1
- package/lib/localCreateDocument.js.map +1 -1
- package/lib/localDeltaStorageService.d.ts +1 -1
- package/lib/localDeltaStorageService.d.ts.map +1 -1
- package/lib/localDeltaStorageService.js +1 -1
- package/lib/localDeltaStorageService.js.map +1 -1
- package/lib/localDocumentDeltaConnection.d.ts +3 -3
- package/lib/localDocumentDeltaConnection.d.ts.map +1 -1
- package/lib/localDocumentDeltaConnection.js +2 -2
- package/lib/localDocumentDeltaConnection.js.map +1 -1
- package/lib/localDocumentService.d.ts +2 -2
- package/lib/localDocumentService.d.ts.map +1 -1
- package/lib/localDocumentService.js +2 -2
- package/lib/localDocumentService.js.map +1 -1
- package/lib/localDocumentServiceFactory.d.ts +2 -2
- package/lib/localDocumentServiceFactory.d.ts.map +1 -1
- package/lib/localDocumentServiceFactory.js +2 -2
- 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 +2 -2
- package/lib/localDocumentStorageService.js.map +1 -1
- package/lib/localResolver.d.ts +1 -1
- package/lib/localResolver.d.ts.map +1 -1
- package/lib/localResolver.js +2 -2
- package/lib/localResolver.js.map +1 -1
- package/lib/tsdoc-metadata.json +11 -0
- package/package.json +17 -26
- package/src/localCreateDocument.ts +2 -2
- package/src/localDeltaStorageService.ts +2 -2
- package/src/localDocumentDeltaConnection.ts +4 -4
- package/src/localDocumentService.ts +6 -5
- package/src/localDocumentServiceFactory.ts +6 -5
- package/src/localDocumentStorageService.ts +9 -8
- package/src/localResolver.ts +7 -2
- package/lib/test/localResolverTest.spec.js +0 -47
- package/lib/test/localResolverTest.spec.js.map +0 -1
- package/lib/test/types/validateLocalDriverPrevious.generated.js +0 -26
- package/lib/test/types/validateLocalDriverPrevious.generated.js.map +0 -1
|
@@ -4,36 +4,36 @@
|
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
6
|
|
|
7
|
-
import { DocumentDeltaConnection } from '@fluidframework/driver-base';
|
|
7
|
+
import { DocumentDeltaConnection } from '@fluidframework/driver-base/internal';
|
|
8
8
|
import { GitManager } from '@fluidframework/server-services-client';
|
|
9
9
|
import { IClient } from '@fluidframework/protocol-definitions';
|
|
10
10
|
import { ICreateBlobResponse } from '@fluidframework/protocol-definitions';
|
|
11
11
|
import { IDatabaseManager } from '@fluidframework/server-services-core';
|
|
12
12
|
import { IDb } from '@fluidframework/server-services-core';
|
|
13
|
-
import { IDocumentDeltaConnection } from '@fluidframework/driver-definitions';
|
|
14
|
-
import { IDocumentDeltaStorageService } from '@fluidframework/driver-definitions';
|
|
13
|
+
import { IDocumentDeltaConnection } from '@fluidframework/driver-definitions/internal';
|
|
14
|
+
import { IDocumentDeltaStorageService } from '@fluidframework/driver-definitions/internal';
|
|
15
15
|
import { IDocumentMessage } from '@fluidframework/protocol-definitions';
|
|
16
|
-
import { IDocumentService } from '@fluidframework/driver-definitions';
|
|
17
|
-
import { IDocumentServiceEvents } from '@fluidframework/driver-definitions';
|
|
18
|
-
import { IDocumentServiceFactory } from '@fluidframework/driver-definitions';
|
|
19
|
-
import { IDocumentServicePolicies } from '@fluidframework/driver-definitions';
|
|
20
|
-
import { IDocumentStorageService } from '@fluidframework/driver-definitions';
|
|
21
|
-
import { IDocumentStorageServicePolicies } from '@fluidframework/driver-definitions';
|
|
16
|
+
import { IDocumentService } from '@fluidframework/driver-definitions/internal';
|
|
17
|
+
import { IDocumentServiceEvents } from '@fluidframework/driver-definitions/internal';
|
|
18
|
+
import { IDocumentServiceFactory } from '@fluidframework/driver-definitions/internal';
|
|
19
|
+
import { IDocumentServicePolicies } from '@fluidframework/driver-definitions/internal';
|
|
20
|
+
import { IDocumentStorageService } from '@fluidframework/driver-definitions/internal';
|
|
21
|
+
import { IDocumentStorageServicePolicies } from '@fluidframework/driver-definitions/internal';
|
|
22
22
|
import { ILocalDeltaConnectionServer } from '@fluidframework/server-local-server';
|
|
23
23
|
import { IRequest } from '@fluidframework/core-interfaces';
|
|
24
|
-
import { IResolvedUrl } from '@fluidframework/driver-definitions';
|
|
24
|
+
import { IResolvedUrl } from '@fluidframework/driver-definitions/internal';
|
|
25
25
|
import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
|
|
26
|
-
import { ISnapshot } from '@fluidframework/driver-definitions';
|
|
27
|
-
import { ISnapshotFetchOptions } from '@fluidframework/driver-definitions';
|
|
26
|
+
import { ISnapshot } from '@fluidframework/driver-definitions/internal';
|
|
27
|
+
import { ISnapshotFetchOptions } from '@fluidframework/driver-definitions/internal';
|
|
28
28
|
import { ISnapshotTreeEx } from '@fluidframework/protocol-definitions';
|
|
29
|
-
import { IStream } from '@fluidframework/driver-definitions';
|
|
30
|
-
import { ISummaryContext } from '@fluidframework/driver-definitions';
|
|
29
|
+
import { IStream } from '@fluidframework/driver-definitions/internal';
|
|
30
|
+
import { ISummaryContext } from '@fluidframework/driver-definitions/internal';
|
|
31
31
|
import { ISummaryHandle } from '@fluidframework/protocol-definitions';
|
|
32
32
|
import { ISummaryTree } from '@fluidframework/protocol-definitions';
|
|
33
33
|
import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
|
|
34
34
|
import { ITestDbFactory } from '@fluidframework/server-test-utils';
|
|
35
35
|
import { ITokenProvider } from '@fluidframework/routerlicious-driver';
|
|
36
|
-
import { IUrlResolver } from '@fluidframework/driver-definitions';
|
|
36
|
+
import { IUrlResolver } from '@fluidframework/driver-definitions/internal';
|
|
37
37
|
import { IVersion } from '@fluidframework/protocol-definitions';
|
|
38
38
|
import { IWebSocketServer } from '@fluidframework/server-services-core';
|
|
39
39
|
import { NackErrorType } from '@fluidframework/protocol-definitions';
|
|
@@ -60,7 +60,7 @@ export class LocalDocumentDeltaConnection extends DocumentDeltaConnection {
|
|
|
60
60
|
disconnectClient(disconnectReason: string): void;
|
|
61
61
|
nackClient(code: number | undefined, type: NackErrorType | undefined, message: any): void;
|
|
62
62
|
submit(messages: IDocumentMessage[]): void;
|
|
63
|
-
submitSignal(message:
|
|
63
|
+
submitSignal(message: string): void;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
// @internal
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { DocumentDeltaConnection } from '@fluidframework/driver-base';
|
|
1
|
+
import { DocumentDeltaConnection } from '@fluidframework/driver-base/internal';
|
|
2
2
|
import { GitManager } from '@fluidframework/server-services-client';
|
|
3
3
|
import { IClient } from '@fluidframework/protocol-definitions';
|
|
4
4
|
import { ICreateBlobResponse } from '@fluidframework/protocol-definitions';
|
|
5
5
|
import { IDatabaseManager } from '@fluidframework/server-services-core';
|
|
6
6
|
import { IDb } from '@fluidframework/server-services-core';
|
|
7
|
-
import { IDocumentDeltaConnection } from '@fluidframework/driver-definitions';
|
|
8
|
-
import { IDocumentDeltaStorageService } from '@fluidframework/driver-definitions';
|
|
7
|
+
import { IDocumentDeltaConnection } from '@fluidframework/driver-definitions/internal';
|
|
8
|
+
import { IDocumentDeltaStorageService } from '@fluidframework/driver-definitions/internal';
|
|
9
9
|
import { IDocumentMessage } from '@fluidframework/protocol-definitions';
|
|
10
|
-
import { IDocumentService } from '@fluidframework/driver-definitions';
|
|
11
|
-
import { IDocumentServiceEvents } from '@fluidframework/driver-definitions';
|
|
12
|
-
import { IDocumentServiceFactory } from '@fluidframework/driver-definitions';
|
|
13
|
-
import { IDocumentServicePolicies } from '@fluidframework/driver-definitions';
|
|
14
|
-
import { IDocumentStorageService } from '@fluidframework/driver-definitions';
|
|
15
|
-
import { IDocumentStorageServicePolicies } from '@fluidframework/driver-definitions';
|
|
10
|
+
import { IDocumentService } from '@fluidframework/driver-definitions/internal';
|
|
11
|
+
import { IDocumentServiceEvents } from '@fluidframework/driver-definitions/internal';
|
|
12
|
+
import { IDocumentServiceFactory } from '@fluidframework/driver-definitions/internal';
|
|
13
|
+
import { IDocumentServicePolicies } from '@fluidframework/driver-definitions/internal';
|
|
14
|
+
import { IDocumentStorageService } from '@fluidframework/driver-definitions/internal';
|
|
15
|
+
import { IDocumentStorageServicePolicies } from '@fluidframework/driver-definitions/internal';
|
|
16
16
|
import { ILocalDeltaConnectionServer } from '@fluidframework/server-local-server';
|
|
17
17
|
import { IRequest } from '@fluidframework/core-interfaces';
|
|
18
|
-
import { IResolvedUrl } from '@fluidframework/driver-definitions';
|
|
18
|
+
import { IResolvedUrl } from '@fluidframework/driver-definitions/internal';
|
|
19
19
|
import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
|
|
20
|
-
import { ISnapshot } from '@fluidframework/driver-definitions';
|
|
21
|
-
import { ISnapshotFetchOptions } from '@fluidframework/driver-definitions';
|
|
20
|
+
import { ISnapshot } from '@fluidframework/driver-definitions/internal';
|
|
21
|
+
import { ISnapshotFetchOptions } from '@fluidframework/driver-definitions/internal';
|
|
22
22
|
import { ISnapshotTreeEx } from '@fluidframework/protocol-definitions';
|
|
23
|
-
import { IStream } from '@fluidframework/driver-definitions';
|
|
24
|
-
import { ISummaryContext } from '@fluidframework/driver-definitions';
|
|
23
|
+
import { IStream } from '@fluidframework/driver-definitions/internal';
|
|
24
|
+
import { ISummaryContext } from '@fluidframework/driver-definitions/internal';
|
|
25
25
|
import { ISummaryHandle } from '@fluidframework/protocol-definitions';
|
|
26
26
|
import { ISummaryTree } from '@fluidframework/protocol-definitions';
|
|
27
27
|
import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
|
|
28
28
|
import { ITestDbFactory } from '@fluidframework/server-test-utils';
|
|
29
29
|
import { ITokenProvider } from '@fluidframework/routerlicious-driver';
|
|
30
|
-
import { IUrlResolver } from '@fluidframework/driver-definitions';
|
|
30
|
+
import { IUrlResolver } from '@fluidframework/driver-definitions/internal';
|
|
31
31
|
import { IVersion } from '@fluidframework/protocol-definitions';
|
|
32
32
|
import { IWebSocketServer } from '@fluidframework/server-services-core';
|
|
33
33
|
import { NackErrorType } from '@fluidframework/protocol-definitions';
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { DocumentDeltaConnection } from '@fluidframework/driver-base';
|
|
1
|
+
import { DocumentDeltaConnection } from '@fluidframework/driver-base/internal';
|
|
2
2
|
import { GitManager } from '@fluidframework/server-services-client';
|
|
3
3
|
import { IClient } from '@fluidframework/protocol-definitions';
|
|
4
4
|
import { ICreateBlobResponse } from '@fluidframework/protocol-definitions';
|
|
5
5
|
import { IDatabaseManager } from '@fluidframework/server-services-core';
|
|
6
6
|
import { IDb } from '@fluidframework/server-services-core';
|
|
7
|
-
import { IDocumentDeltaConnection } from '@fluidframework/driver-definitions';
|
|
8
|
-
import { IDocumentDeltaStorageService } from '@fluidframework/driver-definitions';
|
|
7
|
+
import { IDocumentDeltaConnection } from '@fluidframework/driver-definitions/internal';
|
|
8
|
+
import { IDocumentDeltaStorageService } from '@fluidframework/driver-definitions/internal';
|
|
9
9
|
import { IDocumentMessage } from '@fluidframework/protocol-definitions';
|
|
10
|
-
import { IDocumentService } from '@fluidframework/driver-definitions';
|
|
11
|
-
import { IDocumentServiceEvents } from '@fluidframework/driver-definitions';
|
|
12
|
-
import { IDocumentServiceFactory } from '@fluidframework/driver-definitions';
|
|
13
|
-
import { IDocumentServicePolicies } from '@fluidframework/driver-definitions';
|
|
14
|
-
import { IDocumentStorageService } from '@fluidframework/driver-definitions';
|
|
15
|
-
import { IDocumentStorageServicePolicies } from '@fluidframework/driver-definitions';
|
|
10
|
+
import { IDocumentService } from '@fluidframework/driver-definitions/internal';
|
|
11
|
+
import { IDocumentServiceEvents } from '@fluidframework/driver-definitions/internal';
|
|
12
|
+
import { IDocumentServiceFactory } from '@fluidframework/driver-definitions/internal';
|
|
13
|
+
import { IDocumentServicePolicies } from '@fluidframework/driver-definitions/internal';
|
|
14
|
+
import { IDocumentStorageService } from '@fluidframework/driver-definitions/internal';
|
|
15
|
+
import { IDocumentStorageServicePolicies } from '@fluidframework/driver-definitions/internal';
|
|
16
16
|
import { ILocalDeltaConnectionServer } from '@fluidframework/server-local-server';
|
|
17
17
|
import { IRequest } from '@fluidframework/core-interfaces';
|
|
18
|
-
import { IResolvedUrl } from '@fluidframework/driver-definitions';
|
|
18
|
+
import { IResolvedUrl } from '@fluidframework/driver-definitions/internal';
|
|
19
19
|
import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
|
|
20
|
-
import { ISnapshot } from '@fluidframework/driver-definitions';
|
|
21
|
-
import { ISnapshotFetchOptions } from '@fluidframework/driver-definitions';
|
|
20
|
+
import { ISnapshot } from '@fluidframework/driver-definitions/internal';
|
|
21
|
+
import { ISnapshotFetchOptions } from '@fluidframework/driver-definitions/internal';
|
|
22
22
|
import { ISnapshotTreeEx } from '@fluidframework/protocol-definitions';
|
|
23
|
-
import { IStream } from '@fluidframework/driver-definitions';
|
|
24
|
-
import { ISummaryContext } from '@fluidframework/driver-definitions';
|
|
23
|
+
import { IStream } from '@fluidframework/driver-definitions/internal';
|
|
24
|
+
import { ISummaryContext } from '@fluidframework/driver-definitions/internal';
|
|
25
25
|
import { ISummaryHandle } from '@fluidframework/protocol-definitions';
|
|
26
26
|
import { ISummaryTree } from '@fluidframework/protocol-definitions';
|
|
27
27
|
import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
|
|
28
28
|
import { ITestDbFactory } from '@fluidframework/server-test-utils';
|
|
29
29
|
import { ITokenProvider } from '@fluidframework/routerlicious-driver';
|
|
30
|
-
import { IUrlResolver } from '@fluidframework/driver-definitions';
|
|
30
|
+
import { IUrlResolver } from '@fluidframework/driver-definitions/internal';
|
|
31
31
|
import { IVersion } from '@fluidframework/protocol-definitions';
|
|
32
32
|
import { IWebSocketServer } from '@fluidframework/server-services-core';
|
|
33
33
|
import { NackErrorType } from '@fluidframework/protocol-definitions';
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { DocumentDeltaConnection } from '@fluidframework/driver-base';
|
|
1
|
+
import { DocumentDeltaConnection } from '@fluidframework/driver-base/internal';
|
|
2
2
|
import { GitManager } from '@fluidframework/server-services-client';
|
|
3
3
|
import { IClient } from '@fluidframework/protocol-definitions';
|
|
4
4
|
import { ICreateBlobResponse } from '@fluidframework/protocol-definitions';
|
|
5
5
|
import { IDatabaseManager } from '@fluidframework/server-services-core';
|
|
6
6
|
import { IDb } from '@fluidframework/server-services-core';
|
|
7
|
-
import { IDocumentDeltaConnection } from '@fluidframework/driver-definitions';
|
|
8
|
-
import { IDocumentDeltaStorageService } from '@fluidframework/driver-definitions';
|
|
7
|
+
import { IDocumentDeltaConnection } from '@fluidframework/driver-definitions/internal';
|
|
8
|
+
import { IDocumentDeltaStorageService } from '@fluidframework/driver-definitions/internal';
|
|
9
9
|
import { IDocumentMessage } from '@fluidframework/protocol-definitions';
|
|
10
|
-
import { IDocumentService } from '@fluidframework/driver-definitions';
|
|
11
|
-
import { IDocumentServiceEvents } from '@fluidframework/driver-definitions';
|
|
12
|
-
import { IDocumentServiceFactory } from '@fluidframework/driver-definitions';
|
|
13
|
-
import { IDocumentServicePolicies } from '@fluidframework/driver-definitions';
|
|
14
|
-
import { IDocumentStorageService } from '@fluidframework/driver-definitions';
|
|
15
|
-
import { IDocumentStorageServicePolicies } from '@fluidframework/driver-definitions';
|
|
10
|
+
import { IDocumentService } from '@fluidframework/driver-definitions/internal';
|
|
11
|
+
import { IDocumentServiceEvents } from '@fluidframework/driver-definitions/internal';
|
|
12
|
+
import { IDocumentServiceFactory } from '@fluidframework/driver-definitions/internal';
|
|
13
|
+
import { IDocumentServicePolicies } from '@fluidframework/driver-definitions/internal';
|
|
14
|
+
import { IDocumentStorageService } from '@fluidframework/driver-definitions/internal';
|
|
15
|
+
import { IDocumentStorageServicePolicies } from '@fluidframework/driver-definitions/internal';
|
|
16
16
|
import { ILocalDeltaConnectionServer } from '@fluidframework/server-local-server';
|
|
17
17
|
import { IRequest } from '@fluidframework/core-interfaces';
|
|
18
|
-
import { IResolvedUrl } from '@fluidframework/driver-definitions';
|
|
18
|
+
import { IResolvedUrl } from '@fluidframework/driver-definitions/internal';
|
|
19
19
|
import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
|
|
20
|
-
import { ISnapshot } from '@fluidframework/driver-definitions';
|
|
21
|
-
import { ISnapshotFetchOptions } from '@fluidframework/driver-definitions';
|
|
20
|
+
import { ISnapshot } from '@fluidframework/driver-definitions/internal';
|
|
21
|
+
import { ISnapshotFetchOptions } from '@fluidframework/driver-definitions/internal';
|
|
22
22
|
import { ISnapshotTreeEx } from '@fluidframework/protocol-definitions';
|
|
23
|
-
import { IStream } from '@fluidframework/driver-definitions';
|
|
24
|
-
import { ISummaryContext } from '@fluidframework/driver-definitions';
|
|
23
|
+
import { IStream } from '@fluidframework/driver-definitions/internal';
|
|
24
|
+
import { ISummaryContext } from '@fluidframework/driver-definitions/internal';
|
|
25
25
|
import { ISummaryHandle } from '@fluidframework/protocol-definitions';
|
|
26
26
|
import { ISummaryTree } from '@fluidframework/protocol-definitions';
|
|
27
27
|
import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
|
|
28
28
|
import { ITestDbFactory } from '@fluidframework/server-test-utils';
|
|
29
29
|
import { ITokenProvider } from '@fluidframework/routerlicious-driver';
|
|
30
|
-
import { IUrlResolver } from '@fluidframework/driver-definitions';
|
|
30
|
+
import { IUrlResolver } from '@fluidframework/driver-definitions/internal';
|
|
31
31
|
import { IVersion } from '@fluidframework/protocol-definitions';
|
|
32
32
|
import { IWebSocketServer } from '@fluidframework/server-services-core';
|
|
33
33
|
import { NackErrorType } from '@fluidframework/protocol-definitions';
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { DocumentDeltaConnection } from '@fluidframework/driver-base';
|
|
1
|
+
import { DocumentDeltaConnection } from '@fluidframework/driver-base/internal';
|
|
2
2
|
import { GitManager } from '@fluidframework/server-services-client';
|
|
3
3
|
import { IClient } from '@fluidframework/protocol-definitions';
|
|
4
4
|
import { ICreateBlobResponse } from '@fluidframework/protocol-definitions';
|
|
5
5
|
import { IDatabaseManager } from '@fluidframework/server-services-core';
|
|
6
6
|
import { IDb } from '@fluidframework/server-services-core';
|
|
7
|
-
import { IDocumentDeltaConnection } from '@fluidframework/driver-definitions';
|
|
8
|
-
import { IDocumentDeltaStorageService } from '@fluidframework/driver-definitions';
|
|
7
|
+
import { IDocumentDeltaConnection } from '@fluidframework/driver-definitions/internal';
|
|
8
|
+
import { IDocumentDeltaStorageService } from '@fluidframework/driver-definitions/internal';
|
|
9
9
|
import { IDocumentMessage } from '@fluidframework/protocol-definitions';
|
|
10
|
-
import { IDocumentService } from '@fluidframework/driver-definitions';
|
|
11
|
-
import { IDocumentServiceEvents } from '@fluidframework/driver-definitions';
|
|
12
|
-
import { IDocumentServiceFactory } from '@fluidframework/driver-definitions';
|
|
13
|
-
import { IDocumentServicePolicies } from '@fluidframework/driver-definitions';
|
|
14
|
-
import { IDocumentStorageService } from '@fluidframework/driver-definitions';
|
|
15
|
-
import { IDocumentStorageServicePolicies } from '@fluidframework/driver-definitions';
|
|
10
|
+
import { IDocumentService } from '@fluidframework/driver-definitions/internal';
|
|
11
|
+
import { IDocumentServiceEvents } from '@fluidframework/driver-definitions/internal';
|
|
12
|
+
import { IDocumentServiceFactory } from '@fluidframework/driver-definitions/internal';
|
|
13
|
+
import { IDocumentServicePolicies } from '@fluidframework/driver-definitions/internal';
|
|
14
|
+
import { IDocumentStorageService } from '@fluidframework/driver-definitions/internal';
|
|
15
|
+
import { IDocumentStorageServicePolicies } from '@fluidframework/driver-definitions/internal';
|
|
16
16
|
import { ILocalDeltaConnectionServer } from '@fluidframework/server-local-server';
|
|
17
17
|
import { IRequest } from '@fluidframework/core-interfaces';
|
|
18
|
-
import { IResolvedUrl } from '@fluidframework/driver-definitions';
|
|
18
|
+
import { IResolvedUrl } from '@fluidframework/driver-definitions/internal';
|
|
19
19
|
import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
|
|
20
|
-
import { ISnapshot } from '@fluidframework/driver-definitions';
|
|
21
|
-
import { ISnapshotFetchOptions } from '@fluidframework/driver-definitions';
|
|
20
|
+
import { ISnapshot } from '@fluidframework/driver-definitions/internal';
|
|
21
|
+
import { ISnapshotFetchOptions } from '@fluidframework/driver-definitions/internal';
|
|
22
22
|
import { ISnapshotTreeEx } from '@fluidframework/protocol-definitions';
|
|
23
|
-
import { IStream } from '@fluidframework/driver-definitions';
|
|
24
|
-
import { ISummaryContext } from '@fluidframework/driver-definitions';
|
|
23
|
+
import { IStream } from '@fluidframework/driver-definitions/internal';
|
|
24
|
+
import { ISummaryContext } from '@fluidframework/driver-definitions/internal';
|
|
25
25
|
import { ISummaryHandle } from '@fluidframework/protocol-definitions';
|
|
26
26
|
import { ISummaryTree } from '@fluidframework/protocol-definitions';
|
|
27
27
|
import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
|
|
28
28
|
import { ITestDbFactory } from '@fluidframework/server-test-utils';
|
|
29
29
|
import { ITokenProvider } from '@fluidframework/routerlicious-driver';
|
|
30
|
-
import { IUrlResolver } from '@fluidframework/driver-definitions';
|
|
30
|
+
import { IUrlResolver } from '@fluidframework/driver-definitions/internal';
|
|
31
31
|
import { IVersion } from '@fluidframework/protocol-definitions';
|
|
32
32
|
import { IWebSocketServer } from '@fluidframework/server-services-core';
|
|
33
33
|
import { NackErrorType } from '@fluidframework/protocol-definitions';
|
|
@@ -86,7 +86,7 @@ export declare class LocalDocumentDeltaConnection extends DocumentDeltaConnectio
|
|
|
86
86
|
/**
|
|
87
87
|
* Submits a new signal to the server
|
|
88
88
|
*/
|
|
89
|
-
submitSignal(message:
|
|
89
|
+
submitSignal(message: string): void;
|
|
90
90
|
/**
|
|
91
91
|
* Send a "disconnect" message on the socket.
|
|
92
92
|
* @param disconnectReason - The reason of the disconnection.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { IResolvedUrl } from "@fluidframework/driver-definitions";
|
|
5
|
+
import { IResolvedUrl } from "@fluidframework/driver-definitions/internal";
|
|
6
6
|
import { ISummaryTree } from "@fluidframework/protocol-definitions";
|
|
7
7
|
export declare function createDocument(localDeltaConnectionServer: any, resolvedUrl: IResolvedUrl, summary: ISummaryTree): Promise<void>;
|
|
8
8
|
//# sourceMappingURL=localCreateDocument.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localCreateDocument.d.ts","sourceRoot":"","sources":["../src/localCreateDocument.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"localCreateDocument.d.ts","sourceRoot":"","sources":["../src/localCreateDocument.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,6CAA6C,CAAC;AAM3E,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAIpE,wBAAsB,cAAc,CACnC,0BAA0B,KAAA,EAC1B,WAAW,EAAE,YAAY,EACzB,OAAO,EAAE,YAAY,iBA6BrB"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.createDocument = void 0;
|
|
8
|
-
const
|
|
8
|
+
const internal_1 = require("@fluidframework/driver-utils/internal");
|
|
9
9
|
const server_services_client_1 = require("@fluidframework/server-services-client");
|
|
10
10
|
async function createDocument(localDeltaConnectionServer, resolvedUrl, summary) {
|
|
11
11
|
const pathName = new URL(resolvedUrl.url).pathname;
|
|
@@ -14,13 +14,13 @@ async function createDocument(localDeltaConnectionServer, resolvedUrl, summary)
|
|
|
14
14
|
const id = pathArr[pathArr.length - 1];
|
|
15
15
|
const documentStorage = localDeltaConnectionServer
|
|
16
16
|
.documentStorage;
|
|
17
|
-
if (!(0,
|
|
17
|
+
if (!(0, internal_1.isCombinedAppAndProtocolSummary)(summary)) {
|
|
18
18
|
throw new Error("Protocol and App Summary required in the full summary");
|
|
19
19
|
}
|
|
20
20
|
const protocolSummary = summary.tree[".protocol"];
|
|
21
21
|
const appSummary = summary.tree[".app"];
|
|
22
|
-
const documentAttributes = (0,
|
|
23
|
-
const quorumValues = (0,
|
|
22
|
+
const documentAttributes = (0, internal_1.getDocAttributesFromProtocolSummary)(protocolSummary);
|
|
23
|
+
const quorumValues = (0, internal_1.getQuorumValuesFromProtocolSummary)(protocolSummary);
|
|
24
24
|
const sequenceNumber = documentAttributes.sequenceNumber;
|
|
25
25
|
await documentStorage.createDocument(tenantId, id, appSummary, sequenceNumber, server_services_client_1.defaultHash, resolvedUrl.endpoints.ordererUrl ?? "", resolvedUrl.endpoints.storageUrl ?? "", resolvedUrl.endpoints.deltaStorageUrl ?? "", quorumValues, false /* enableDiscovery */, false /* isEphemeralContainer */);
|
|
26
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localCreateDocument.js","sourceRoot":"","sources":["../src/localCreateDocument.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH
|
|
1
|
+
{"version":3,"file":"localCreateDocument.js","sourceRoot":"","sources":["../src/localCreateDocument.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,oEAI+C;AAG/C,mFAAqE;AAE9D,KAAK,UAAU,cAAc,CACnC,0BAA0B,EAC1B,WAAyB,EACzB,OAAqB;IAErB,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC;IACnD,MAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACpC,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC7C,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACvC,MAAM,eAAe,GAAI,0BAAyD;SAChF,eAAe,CAAC;IAClB,IAAI,CAAC,IAAA,0CAA+B,EAAC,OAAO,CAAC,EAAE;QAC9C,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;KACzE;IACD,MAAM,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAClD,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACxC,MAAM,kBAAkB,GAAG,IAAA,8CAAmC,EAAC,eAAe,CAAC,CAAC;IAChF,MAAM,YAAY,GAAG,IAAA,6CAAkC,EAAC,eAAe,CAAC,CAAC;IACzE,MAAM,cAAc,GAAG,kBAAkB,CAAC,cAAc,CAAC;IACzD,MAAM,eAAe,CAAC,cAAc,CACnC,QAAQ,EACR,EAAE,EACF,UAAU,EACV,cAAc,EACd,oCAAW,EACX,WAAW,CAAC,SAAS,CAAC,UAAU,IAAI,EAAE,EACtC,WAAW,CAAC,SAAS,CAAC,UAAU,IAAI,EAAE,EACtC,WAAW,CAAC,SAAS,CAAC,eAAe,IAAI,EAAE,EAC3C,YAAY,EACZ,KAAK,CAAC,qBAAqB,EAC3B,KAAK,CAAC,0BAA0B,CAChC,CAAC;AACH,CAAC;AAhCD,wCAgCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IResolvedUrl } from \"@fluidframework/driver-definitions/internal\";\nimport {\n\tgetDocAttributesFromProtocolSummary,\n\tgetQuorumValuesFromProtocolSummary,\n\tisCombinedAppAndProtocolSummary,\n} from \"@fluidframework/driver-utils/internal\";\nimport { ISummaryTree } from \"@fluidframework/protocol-definitions\";\nimport { LocalDeltaConnectionServer } from \"@fluidframework/server-local-server\";\nimport { defaultHash } from \"@fluidframework/server-services-client\";\n\nexport async function createDocument(\n\tlocalDeltaConnectionServer,\n\tresolvedUrl: IResolvedUrl,\n\tsummary: ISummaryTree,\n) {\n\tconst pathName = new URL(resolvedUrl.url).pathname;\n\tconst pathArr = pathName.split(\"/\");\n\tconst tenantId = pathArr[pathArr.length - 2];\n\tconst id = pathArr[pathArr.length - 1];\n\tconst documentStorage = (localDeltaConnectionServer as LocalDeltaConnectionServer)\n\t\t.documentStorage;\n\tif (!isCombinedAppAndProtocolSummary(summary)) {\n\t\tthrow new Error(\"Protocol and App Summary required in the full summary\");\n\t}\n\tconst protocolSummary = summary.tree[\".protocol\"];\n\tconst appSummary = summary.tree[\".app\"];\n\tconst documentAttributes = getDocAttributesFromProtocolSummary(protocolSummary);\n\tconst quorumValues = getQuorumValuesFromProtocolSummary(protocolSummary);\n\tconst sequenceNumber = documentAttributes.sequenceNumber;\n\tawait documentStorage.createDocument(\n\t\ttenantId,\n\t\tid,\n\t\tappSummary,\n\t\tsequenceNumber,\n\t\tdefaultHash,\n\t\tresolvedUrl.endpoints.ordererUrl ?? \"\",\n\t\tresolvedUrl.endpoints.storageUrl ?? \"\",\n\t\tresolvedUrl.endpoints.deltaStorageUrl ?? \"\",\n\t\tquorumValues,\n\t\tfalse /* enableDiscovery */,\n\t\tfalse /* isEphemeralContainer */,\n\t);\n}\n"]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { IDocumentDeltaStorageService, IStream } from "@fluidframework/driver-definitions";
|
|
5
|
+
import { IDocumentDeltaStorageService, IStream } from "@fluidframework/driver-definitions/internal";
|
|
6
6
|
import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
7
7
|
import { IDatabaseManager } from "@fluidframework/server-services-core";
|
|
8
8
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localDeltaStorageService.d.ts","sourceRoot":"","sources":["../src/localDeltaStorageService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,4BAA4B,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"localDeltaStorageService.d.ts","sourceRoot":"","sources":["../src/localDeltaStorageService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,4BAA4B,EAAE,OAAO,EAAE,MAAM,6CAA6C,CAAC;AAEpG,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAExE;;;GAGG;AACH,qBAAa,wBAAyB,YAAW,4BAA4B;IAE3E,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,EAAE;IACnB,OAAO,CAAC,QAAQ,CAAC,eAAe;gBAFf,QAAQ,EAAE,MAAM,EAChB,EAAE,EAAE,MAAM,EACV,eAAe,EAAE,gBAAgB;IAG5C,aAAa,CACnB,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,GAAG,SAAS,EACtB,WAAW,CAAC,EAAE,WAAW,EACzB,UAAU,CAAC,EAAE,OAAO,GAClB,OAAO,CAAC,yBAAyB,EAAE,CAAC;YAIzB,OAAO;CAcrB"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.LocalDeltaStorageService = void 0;
|
|
8
|
-
const
|
|
8
|
+
const internal_1 = require("@fluidframework/driver-utils/internal");
|
|
9
9
|
/**
|
|
10
10
|
* Provides access to the underlying delta storage on the server for local driver.
|
|
11
11
|
* @internal
|
|
@@ -17,7 +17,7 @@ class LocalDeltaStorageService {
|
|
|
17
17
|
this.databaseManager = databaseManager;
|
|
18
18
|
}
|
|
19
19
|
fetchMessages(from, to, abortSignal, cachedOnly) {
|
|
20
|
-
return (0,
|
|
20
|
+
return (0, internal_1.streamFromMessages)(this.getCore(from, to));
|
|
21
21
|
}
|
|
22
22
|
async getCore(from, to) {
|
|
23
23
|
const query = { documentId: this.id, tenantId: this.tenantId };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localDeltaStorageService.js","sourceRoot":"","sources":["../src/localDeltaStorageService.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;
|
|
1
|
+
{"version":3,"file":"localDeltaStorageService.js","sourceRoot":"","sources":["../src/localDeltaStorageService.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,oEAA2E;AAI3E;;;GAGG;AACH,MAAa,wBAAwB;IACpC,YACkB,QAAgB,EAChB,EAAU,EACV,eAAiC;QAFjC,aAAQ,GAAR,QAAQ,CAAQ;QAChB,OAAE,GAAF,EAAE,CAAQ;QACV,oBAAe,GAAf,eAAe,CAAkB;IAChD,CAAC;IAEG,aAAa,CACnB,IAAY,EACZ,EAAsB,EACtB,WAAyB,EACzB,UAAoB;QAEpB,OAAO,IAAA,6BAAkB,EAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;IACnD,CAAC;IAEO,KAAK,CAAC,OAAO,CAAC,IAAY,EAAE,EAAW;QAC9C,MAAM,KAAK,GAAG,EAAE,UAAU,EAAE,IAAI,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC;QAC/D,KAAK,CAAC,0BAA0B,CAAC,GAAG,EAAE,CAAC;QACvC,KAAK,CAAC,0BAA0B,CAAC,CAAC,GAAG,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,oBAAoB;QAEtE,kFAAkF;QAClF,iBAAiB;QACjB,KAAK,CAAC,0BAA0B,CAAC,CAAC,GAAG,GAAG,EAAE,IAAI,MAAM,CAAC,gBAAgB,CAAC;QAEtE,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,kBAAkB,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;QACxF,MAAM,QAAQ,GAAG,MAAM,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,0BAA0B,EAAE,CAAC,EAAE,CAAC,CAAC;QAChF,MAAM,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QAC1D,OAAO,QAAQ,CAAC;IACjB,CAAC;CACD;AA9BD,4DA8BC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IDocumentDeltaStorageService, IStream } from \"@fluidframework/driver-definitions/internal\";\nimport { streamFromMessages } from \"@fluidframework/driver-utils/internal\";\nimport { ISequencedDocumentMessage } from \"@fluidframework/protocol-definitions\";\nimport { IDatabaseManager } from \"@fluidframework/server-services-core\";\n\n/**\n * Provides access to the underlying delta storage on the server for local driver.\n * @internal\n */\nexport class LocalDeltaStorageService implements IDocumentDeltaStorageService {\n\tconstructor(\n\t\tprivate readonly tenantId: string,\n\t\tprivate readonly id: string,\n\t\tprivate readonly databaseManager: IDatabaseManager,\n\t) {}\n\n\tpublic fetchMessages(\n\t\tfrom: number,\n\t\tto: number | undefined,\n\t\tabortSignal?: AbortSignal,\n\t\tcachedOnly?: boolean,\n\t): IStream<ISequencedDocumentMessage[]> {\n\t\treturn streamFromMessages(this.getCore(from, to));\n\t}\n\n\tprivate async getCore(from: number, to?: number) {\n\t\tconst query = { documentId: this.id, tenantId: this.tenantId };\n\t\tquery[\"operation.sequenceNumber\"] = {};\n\t\tquery[\"operation.sequenceNumber\"].$gt = from - 1; // from is inclusive\n\n\t\t// This looks like a bug. It used to work without setting $lt key. Now it does not\n\t\t// Need follow up\n\t\tquery[\"operation.sequenceNumber\"].$lt = to ?? Number.MAX_SAFE_INTEGER;\n\n\t\tconst allDeltas = await this.databaseManager.getDeltaCollection(this.tenantId, this.id);\n\t\tconst dbDeltas = await allDeltas.find(query, { \"operation.sequenceNumber\": 1 });\n\t\tconst messages = dbDeltas.map((delta) => delta.operation);\n\t\treturn messages;\n\t}\n}\n"]}
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
6
|
+
import { DocumentDeltaConnection } from "@fluidframework/driver-base/internal";
|
|
6
7
|
import { IClient, IDocumentMessage, NackErrorType } from "@fluidframework/protocol-definitions";
|
|
7
8
|
import { IWebSocketServer } from "@fluidframework/server-services-core";
|
|
8
9
|
import type { Socket } from "socket.io-client";
|
|
9
|
-
import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
10
10
|
/**
|
|
11
11
|
* Represents a connection to a stream of delta updates
|
|
12
12
|
* @internal
|
|
@@ -31,7 +31,7 @@ export declare class LocalDocumentDeltaConnection extends DocumentDeltaConnectio
|
|
|
31
31
|
/**
|
|
32
32
|
* Submits a new signal to the server
|
|
33
33
|
*/
|
|
34
|
-
submitSignal(message:
|
|
34
|
+
submitSignal(message: string): void;
|
|
35
35
|
/**
|
|
36
36
|
* Send a "disconnect" message on the socket.
|
|
37
37
|
* @param disconnectReason - The reason of the disconnection.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localDocumentDeltaConnection.d.ts","sourceRoot":"","sources":["../src/localDocumentDeltaConnection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"localDocumentDeltaConnection.d.ts","sourceRoot":"","sources":["../src/localDocumentDeltaConnection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EACN,OAAO,EAEP,gBAAgB,EAChB,aAAa,EACb,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAExE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAI/C;;;GAGG;AACH,qBAAa,4BAA6B,SAAQ,uBAAuB;IACxE;;;;;;;;;OASG;WACiB,MAAM,CACzB,QAAQ,EAAE,MAAM,EAChB,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,OAAO,EACf,eAAe,EAAE,gBAAgB,EACjC,SAAS,SAAQ,EACjB,MAAM,CAAC,EAAE,oBAAoB,GAC3B,OAAO,CAAC,4BAA4B,CAAC;gBAqB5B,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,oBAAoB;IAI7E;;OAEG;IACI,MAAM,CAAC,QAAQ,EAAE,gBAAgB,EAAE,GAAG,IAAI;IAQjD;;OAEG;IACI,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAI1C;;;OAGG;IACI,gBAAgB,CAAC,gBAAgB,EAAE,MAAM;IAIhD;;;;;OAKG;IACI,UAAU,CAChB,IAAI,oBAAc,EAClB,IAAI,2BAA+C,EACnD,OAAO,EAAE,GAAG;CAab"}
|
|
@@ -5,15 +5,15 @@
|
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.LocalDocumentDeltaConnection = void 0;
|
|
8
|
-
const
|
|
8
|
+
const internal_1 = require("@fluidframework/driver-base/internal");
|
|
9
9
|
const protocol_definitions_1 = require("@fluidframework/protocol-definitions");
|
|
10
|
-
const
|
|
10
|
+
const internal_2 = require("@fluidframework/telemetry-utils/internal");
|
|
11
11
|
const testProtocolVersions = ["^0.3.0", "^0.2.0", "^0.1.0"];
|
|
12
12
|
/**
|
|
13
13
|
* Represents a connection to a stream of delta updates
|
|
14
14
|
* @internal
|
|
15
15
|
*/
|
|
16
|
-
class LocalDocumentDeltaConnection extends
|
|
16
|
+
class LocalDocumentDeltaConnection extends internal_1.DocumentDeltaConnection {
|
|
17
17
|
/**
|
|
18
18
|
* Create a LocalDocumentDeltaConnection
|
|
19
19
|
* Handle initial messages, contents or signals if they were in queue
|
|
@@ -42,7 +42,7 @@ class LocalDocumentDeltaConnection extends driver_base_1.DocumentDeltaConnection
|
|
|
42
42
|
return deltaConnection;
|
|
43
43
|
}
|
|
44
44
|
constructor(socket, documentId, logger) {
|
|
45
|
-
super(socket, documentId, (0,
|
|
45
|
+
super(socket, documentId, (0, internal_2.createChildLogger)({ logger }));
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
48
48
|
* Submits a new delta operation to the server
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localDocumentDeltaConnection.js","sourceRoot":"","sources":["../src/localDocumentDeltaConnection.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;
|
|
1
|
+
{"version":3,"file":"localDocumentDeltaConnection.js","sourceRoot":"","sources":["../src/localDocumentDeltaConnection.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,mEAA+E;AAC/E,+EAK8C;AAG9C,uEAA6E;AAG7E,MAAM,oBAAoB,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAE5D;;;GAGG;AACH,MAAa,4BAA6B,SAAQ,kCAAuB;IACxE;;;;;;;;;OASG;IACI,MAAM,CAAC,KAAK,CAAC,MAAM,CACzB,QAAgB,EAChB,EAAU,EACV,KAAa,EACb,MAAe,EACf,eAAiC,EACjC,SAAS,GAAG,KAAK,EACjB,MAA6B;QAE7B,MAAM,MAAM,GAAI,eAAwC,CAAC,gBAAgB,EAAE,CAAC;QAE5E,4GAA4G;QAC5G,0EAA0E;QAC1E,MAAM,kBAAkB,GAAG,MAA2B,CAAC;QAEvD,MAAM,eAAe,GAAG,IAAI,4BAA4B,CAAC,kBAAkB,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC;QAEzF,MAAM,cAAc,GAAa;YAChC,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oEA4FC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryBaseLogger } from \"@fluidframework/core-interfaces\";\nimport { DocumentDeltaConnection } from \"@fluidframework/driver-base/internal\";\nimport {\n\tIClient,\n\tIConnect,\n\tIDocumentMessage,\n\tNackErrorType,\n} from \"@fluidframework/protocol-definitions\";\nimport { LocalWebSocketServer } from \"@fluidframework/server-local-server\";\nimport { IWebSocketServer } from \"@fluidframework/server-services-core\";\nimport { createChildLogger } from \"@fluidframework/telemetry-utils/internal\";\nimport type { Socket } from \"socket.io-client\";\n\nconst testProtocolVersions = [\"^0.3.0\", \"^0.2.0\", \"^0.1.0\"];\n\n/**\n * Represents a connection to a stream of delta updates\n * @internal\n */\nexport class LocalDocumentDeltaConnection extends DocumentDeltaConnection {\n\t/**\n\t * Create a LocalDocumentDeltaConnection\n\t * Handle initial messages, contents or signals if they were in queue\n\t *\n\t * @param tenantId - the ID of the tenant\n\t * @param id - document ID\n\t * @param token - authorization token for storage service\n\t * @param client - information about the client\n\t * @param webSocketServer - web socket server to create connection\n\t */\n\tpublic static async create(\n\t\ttenantId: string,\n\t\tid: string,\n\t\ttoken: string,\n\t\tclient: IClient,\n\t\twebSocketServer: IWebSocketServer,\n\t\ttimeoutMs = 60000,\n\t\tlogger?: ITelemetryBaseLogger,\n\t): Promise<LocalDocumentDeltaConnection> {\n\t\tconst socket = (webSocketServer as LocalWebSocketServer).createConnection();\n\n\t\t// Cast LocalWebSocket to SocketIOClient.Socket which is the socket that the base class needs. This is hacky\n\t\t// but should be fine because this delta connection is for local use only.\n\t\tconst socketWithListener = socket as unknown as Socket;\n\n\t\tconst deltaConnection = new LocalDocumentDeltaConnection(socketWithListener, id, logger);\n\n\t\tconst connectMessage: IConnect = {\n\t\t\tclient,\n\t\t\tid,\n\t\t\tmode: client.mode,\n\t\t\ttenantId,\n\t\t\ttoken, // Token is going to indicate tenant level information, etc...\n\t\t\tversions: testProtocolVersions,\n\t\t};\n\t\tawait deltaConnection.initialize(connectMessage, timeoutMs);\n\t\treturn deltaConnection;\n\t}\n\n\tconstructor(socket: Socket, documentId: string, logger?: ITelemetryBaseLogger) {\n\t\tsuper(socket, documentId, createChildLogger({ logger }));\n\t}\n\n\t/**\n\t * Submits a new delta operation to the server\n\t */\n\tpublic submit(messages: IDocumentMessage[]): void {\n\t\t// We use a promise resolve to force a turn break given message processing is sync\n\t\t// eslint-disable-next-line @typescript-eslint/no-floating-promises\n\t\tPromise.resolve().then(() => {\n\t\t\tthis.emitMessages(\"submitOp\", [messages]);\n\t\t});\n\t}\n\n\t/**\n\t * Submits a new signal to the server\n\t */\n\tpublic submitSignal(message: string): void {\n\t\tthis.emitMessages(\"submitSignal\", [[message]]);\n\t}\n\n\t/**\n\t * Send a \"disconnect\" message on the socket.\n\t * @param disconnectReason - The reason of the disconnection.\n\t */\n\tpublic disconnectClient(disconnectReason: string) {\n\t\tthis.socket.emit(\"disconnect\", disconnectReason);\n\t}\n\n\t/**\n\t * * Sends a \"nack\" message on the socket.\n\t * @param code - An error code number that represents the error. It will be a valid HTTP error code.\n\t * @param type - Type of the Nack.\n\t * @param message - A message about the nack for debugging/logging/telemetry purposes.\n\t */\n\tpublic nackClient(\n\t\tcode: number = 400,\n\t\ttype: NackErrorType = NackErrorType.ThrottlingError,\n\t\tmessage: any,\n\t) {\n\t\tconst nackMessage = {\n\t\t\toperation: undefined,\n\t\t\tsequenceNumber: -1,\n\t\t\tcontent: {\n\t\t\t\tcode,\n\t\t\t\ttype,\n\t\t\t\tmessage,\n\t\t\t},\n\t\t};\n\t\tthis.socket.emit(\"nack\", \"\", [nackMessage]);\n\t}\n}\n"]}
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import { TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
6
|
-
import {
|
|
6
|
+
import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
7
|
+
import { IDocumentDeltaConnection, IDocumentDeltaStorageService, IDocumentService, IDocumentServiceEvents, IDocumentServicePolicies, IDocumentStorageService, IResolvedUrl } from "@fluidframework/driver-definitions/internal";
|
|
7
8
|
import { IClient } from "@fluidframework/protocol-definitions";
|
|
8
9
|
import { ITokenProvider } from "@fluidframework/routerlicious-driver";
|
|
9
10
|
import { ILocalDeltaConnectionServer } from "@fluidframework/server-local-server";
|
|
10
|
-
import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
11
11
|
import { LocalDocumentDeltaConnection } from "./localDocumentDeltaConnection.js";
|
|
12
12
|
/**
|
|
13
13
|
* Basic implementation of a document service for local use.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localDocumentService.d.ts","sourceRoot":"","sources":["../src/localDocumentService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EACN,wBAAwB,EACxB,4BAA4B,EAC5B,gBAAgB,EAChB,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,EACvB,YAAY,EACZ,MAAM,
|
|
1
|
+
{"version":3,"file":"localDocumentService.d.ts","sourceRoot":"","sources":["../src/localDocumentService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EACN,wBAAwB,EACxB,4BAA4B,EAC5B,gBAAgB,EAChB,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,EACvB,YAAY,EACZ,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAKlF,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AE,wBAAwB,EACnC,oBAAoB,CAAC,EAAE,gBAAgB,EACvC,MAAM,CAAC,EAAE,oBAAoB,GAC3B,gBAAgB,CAYlB"}
|
|
@@ -8,9 +8,9 @@ exports.createLocalDocumentService = exports.LocalDocumentService = void 0;
|
|
|
8
8
|
const client_utils_1 = require("@fluid-internal/client-utils");
|
|
9
9
|
const server_services_client_1 = require("@fluidframework/server-services-client");
|
|
10
10
|
const server_test_utils_1 = require("@fluidframework/server-test-utils");
|
|
11
|
-
const localDocumentStorageService_js_1 = require("./localDocumentStorageService.js");
|
|
12
|
-
const localDocumentDeltaConnection_js_1 = require("./localDocumentDeltaConnection.js");
|
|
13
11
|
const localDeltaStorageService_js_1 = require("./localDeltaStorageService.js");
|
|
12
|
+
const localDocumentDeltaConnection_js_1 = require("./localDocumentDeltaConnection.js");
|
|
13
|
+
const localDocumentStorageService_js_1 = require("./localDocumentStorageService.js");
|
|
14
14
|
/**
|
|
15
15
|
* Basic implementation of a document service for local use.
|
|
16
16
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localDocumentService.js","sourceRoot":"","sources":["../src/localDocumentService.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAiE;
|
|
1
|
+
{"version":3,"file":"localDocumentService.js","sourceRoot":"","sources":["../src/localDocumentService.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAiE;AAcjE,mFAAoE;AACpE,yEAAkE;AAElE,+EAAyE;AACzE,uFAAiF;AACjF,qFAA+E;AAE/E;;;GAGG;AACH,MAAa,oBACZ,SAAQ,gCAAyC;IAGjD;;;;;OAKG;IACH,YACiB,WAAyB,EACxB,0BAAuD,EACvD,aAA6B,EAC7B,QAAgB,EAChB,UAAkB,EAClB,2BAAsE,EACvE,WAAqC,EAAE,qBAAqB,EAAE,IAAI,EAAE,EACnE,oBAAuC,EACvC,MAA6B;QAE9C,KAAK,EAAE,CAAC;QAVQ,gBAAW,GAAX,WAAW,C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AC,aAAa,CAAC,iBAAiB,CAC9D,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,UAAU,CACf,CAAC;QACF,MAAM,uBAAuB,GAAG,MAAM,8DAA4B,CAAC,MAAM,CACxE,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,UAAU,EACf,YAAY,CAAC,GAAG,EAChB,MAAM,EACN,IAAI,CAAC,0BAA0B,CAAC,eAAe,EAC/C,SAAS,EACT,IAAI,CAAC,MAAM,CACX,CAAC;QACF,MAAM,QAAQ,GAAG,uBAAuB,CAAC,QAAQ,CAAC;QAElD,8EAA8E;QAC9E,IAAI,CAAC,2BAA2B,CAAC,GAAG,CAAC,QAAQ,EAAE,uBAAuB,CAAC,CAAC;QAExE,kFAAkF;QAClF,uBAAuB,CAAC,EAAE,CAAC,YAAY,EAAE,GAAG,EAAE;YAC7C,IAAI,CAAC,2BAA2B,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;QAEH,OAAO,uBAAuB,CAAC;IAChC,CAAC;CACD;AA7FD,oDA6FC;AAED;;;;;;;GAOG;AACH,SAAgB,0BAA0B,CACzC,WAAyB,EACzB,0BAAuD,EACvD,aAA6B,EAC7B,QAAgB,EAChB,UAAkB,EAClB,2BAAsE,EACtE,QAAmC,EACnC,oBAAuC,EACvC,MAA6B;IAE7B,OAAO,IAAI,oBAAoB,CAC9B,WAAW,EACX,0BAA0B,EAC1B,aAAa,EACb,QAAQ,EACR,UAAU,EACV,2BAA2B,EAC3B,QAAQ,EACR,oBAAoB,EACpB,MAAM,CACN,CAAC;AACH,CAAC;AAtBD,gEAsBC","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 { ITelemetryBaseLogger } from \"@fluidframework/core-interfaces\";\nimport {\n\tIDocumentDeltaConnection,\n\tIDocumentDeltaStorageService,\n\tIDocumentService,\n\tIDocumentServiceEvents,\n\tIDocumentServicePolicies,\n\tIDocumentStorageService,\n\tIResolvedUrl,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { IClient } from \"@fluidframework/protocol-definitions\";\nimport { ITokenProvider } from \"@fluidframework/routerlicious-driver\";\nimport { ILocalDeltaConnectionServer } from \"@fluidframework/server-local-server\";\nimport { GitManager } from \"@fluidframework/server-services-client\";\nimport { TestHistorian } from \"@fluidframework/server-test-utils\";\n\nimport { LocalDeltaStorageService } from \"./localDeltaStorageService.js\";\nimport { LocalDocumentDeltaConnection } from \"./localDocumentDeltaConnection.js\";\nimport { LocalDocumentStorageService } from \"./localDocumentStorageService.js\";\n\n/**\n * Basic implementation of a document service for local use.\n * @internal\n */\nexport class LocalDocumentService\n\textends TypedEventEmitter<IDocumentServiceEvents>\n\timplements IDocumentService\n{\n\t/**\n\t * @param localDeltaConnectionServer - delta connection server for ops\n\t * @param tokenProvider - token provider\n\t * @param tenantId - ID of tenant\n\t * @param documentId - ID of document\n\t */\n\tconstructor(\n\t\tpublic readonly resolvedUrl: IResolvedUrl,\n\t\tprivate readonly localDeltaConnectionServer: ILocalDeltaConnectionServer,\n\t\tprivate readonly tokenProvider: ITokenProvider,\n\t\tprivate readonly tenantId: string,\n\t\tprivate readonly documentId: string,\n\t\tprivate readonly documentDeltaConnectionsMap: Map<string, LocalDocumentDeltaConnection>,\n\t\tpublic readonly policies: IDocumentServicePolicies = { supportGetSnapshotApi: true },\n\t\tprivate readonly innerDocumentService?: IDocumentService,\n\t\tprivate readonly logger?: ITelemetryBaseLogger,\n\t) {\n\t\tsuper();\n\t}\n\n\tpublic dispose() {}\n\n\t/**\n\t * Creates and returns a document storage service for local use.\n\t */\n\tpublic async connectToStorage(): Promise<IDocumentStorageService> {\n\t\treturn new LocalDocumentStorageService(\n\t\t\tthis.documentId,\n\t\t\tnew GitManager(\n\t\t\t\tnew TestHistorian(this.localDeltaConnectionServer.testDbFactory.testDatabase),\n\t\t\t),\n\t\t\t{\n\t\t\t\tmaximumCacheDurationMs: 432_000_000, // 5 days in ms. Not actually enforced but shouldn't matter for any local driver scenario\n\t\t\t},\n\t\t\tthis.localDeltaConnectionServer,\n\t\t\tthis.resolvedUrl,\n\t\t);\n\t}\n\n\t/**\n\t * Creates and returns a delta storage service for local use.\n\t */\n\tpublic async connectToDeltaStorage(): Promise<IDocumentDeltaStorageService> {\n\t\tif (this.innerDocumentService) {\n\t\t\treturn this.innerDocumentService.connectToDeltaStorage();\n\t\t}\n\t\treturn new LocalDeltaStorageService(\n\t\t\tthis.tenantId,\n\t\t\tthis.documentId,\n\t\t\tthis.localDeltaConnectionServer.databaseManager,\n\t\t);\n\t}\n\n\t/**\n\t * Creates and returns a delta stream for local use.\n\t * @param client - client data\n\t */\n\tpublic async connectToDeltaStream(client: IClient): Promise<IDocumentDeltaConnection> {\n\t\tif (this.policies.storageOnly === true) {\n\t\t\tthrow new Error(\"can't connect to delta stream in storage-only mode\");\n\t\t}\n\t\tif (this.innerDocumentService) {\n\t\t\treturn this.innerDocumentService.connectToDeltaStream(client);\n\t\t}\n\t\tconst ordererToken = await this.tokenProvider.fetchOrdererToken(\n\t\t\tthis.tenantId,\n\t\t\tthis.documentId,\n\t\t);\n\t\tconst documentDeltaConnection = await LocalDocumentDeltaConnection.create(\n\t\t\tthis.tenantId,\n\t\t\tthis.documentId,\n\t\t\tordererToken.jwt,\n\t\t\tclient,\n\t\t\tthis.localDeltaConnectionServer.webSocketServer,\n\t\t\tundefined,\n\t\t\tthis.logger,\n\t\t);\n\t\tconst clientId = documentDeltaConnection.clientId;\n\n\t\t// Add this document service for the clientId in the document service factory.\n\t\tthis.documentDeltaConnectionsMap.set(clientId, documentDeltaConnection);\n\n\t\t// Add a listener to remove this document service when the client is disconnected.\n\t\tdocumentDeltaConnection.on(\"disconnect\", () => {\n\t\t\tthis.documentDeltaConnectionsMap.delete(clientId);\n\t\t});\n\n\t\treturn documentDeltaConnection;\n\t}\n}\n\n/**\n * Creates and returns a document service for local use.\n * @param localDeltaConnectionServer - delta connection server for ops\n * @param tokenProvider - token provider with a single token\n * @param tenantId - ID of tenant\n * @param documentId - ID of document\n * @internal\n */\nexport function createLocalDocumentService(\n\tresolvedUrl: IResolvedUrl,\n\tlocalDeltaConnectionServer: ILocalDeltaConnectionServer,\n\ttokenProvider: ITokenProvider,\n\ttenantId: string,\n\tdocumentId: string,\n\tdocumentDeltaConnectionsMap: Map<string, LocalDocumentDeltaConnection>,\n\tpolicies?: IDocumentServicePolicies,\n\tinnerDocumentService?: IDocumentService,\n\tlogger?: ITelemetryBaseLogger,\n): IDocumentService {\n\treturn new LocalDocumentService(\n\t\tresolvedUrl,\n\t\tlocalDeltaConnectionServer,\n\t\ttokenProvider,\n\t\ttenantId,\n\t\tdocumentId,\n\t\tdocumentDeltaConnectionsMap,\n\t\tpolicies,\n\t\tinnerDocumentService,\n\t\tlogger,\n\t);\n}\n"]}
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { IDocumentService, IDocumentServiceFactory, IDocumentServicePolicies, IResolvedUrl } from "@fluidframework/driver-definitions";
|
|
6
5
|
import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
7
|
-
import {
|
|
6
|
+
import { IDocumentService, IDocumentServiceFactory, IDocumentServicePolicies, IResolvedUrl } from "@fluidframework/driver-definitions/internal";
|
|
8
7
|
import { ISummaryTree, NackErrorType } from "@fluidframework/protocol-definitions";
|
|
8
|
+
import { ILocalDeltaConnectionServer } from "@fluidframework/server-local-server";
|
|
9
9
|
/**
|
|
10
10
|
* Implementation of document service factory for local use.
|
|
11
11
|
* @alpha
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localDocumentServiceFactory.d.ts","sourceRoot":"","sources":["../src/localDocumentServiceFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAC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