@fluidframework/local-driver 2.0.0-internal.7.3.0 → 2.0.0-internal.8.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/api-extractor-lint.json +13 -0
  3. package/api-extractor.json +3 -3
  4. package/api-report/local-driver.api.md +10 -10
  5. package/dist/local-driver-alpha.d.ts +108 -0
  6. package/dist/local-driver-beta.d.ts +81 -0
  7. package/dist/local-driver-public.d.ts +81 -0
  8. package/dist/local-driver-untrimmed.d.ts +224 -0
  9. package/dist/localDeltaStorageService.cjs +1 -0
  10. package/dist/localDeltaStorageService.cjs.map +1 -1
  11. package/dist/localDeltaStorageService.d.ts +1 -0
  12. package/dist/localDeltaStorageService.d.ts.map +1 -1
  13. package/dist/localDocumentDeltaConnection.cjs +1 -0
  14. package/dist/localDocumentDeltaConnection.cjs.map +1 -1
  15. package/dist/localDocumentDeltaConnection.d.ts +1 -0
  16. package/dist/localDocumentDeltaConnection.d.ts.map +1 -1
  17. package/dist/localDocumentService.cjs +2 -0
  18. package/dist/localDocumentService.cjs.map +1 -1
  19. package/dist/localDocumentService.d.ts +2 -0
  20. package/dist/localDocumentService.d.ts.map +1 -1
  21. package/dist/localDocumentServiceFactory.cjs +1 -0
  22. package/dist/localDocumentServiceFactory.cjs.map +1 -1
  23. package/dist/localDocumentServiceFactory.d.ts +1 -0
  24. package/dist/localDocumentServiceFactory.d.ts.map +1 -1
  25. package/dist/localDocumentStorageService.cjs +4 -4
  26. package/dist/localDocumentStorageService.cjs.map +1 -1
  27. package/dist/localDocumentStorageService.d.ts +4 -1
  28. package/dist/localDocumentStorageService.d.ts.map +1 -1
  29. package/dist/localResolver.cjs +4 -0
  30. package/dist/localResolver.cjs.map +1 -1
  31. package/dist/localResolver.d.ts +4 -0
  32. package/dist/localResolver.d.ts.map +1 -1
  33. package/dist/localSessionStorageDb.cjs +1 -0
  34. package/dist/localSessionStorageDb.cjs.map +1 -1
  35. package/dist/localSessionStorageDb.d.ts +1 -0
  36. package/dist/localSessionStorageDb.d.ts.map +1 -1
  37. package/lib/auth.d.ts.map +1 -1
  38. package/lib/index.d.ts +7 -7
  39. package/lib/index.d.ts.map +1 -1
  40. package/lib/local-driver-alpha.d.ts +108 -0
  41. package/lib/local-driver-beta.d.ts +81 -0
  42. package/lib/local-driver-public.d.ts +81 -0
  43. package/lib/local-driver-untrimmed.d.ts +224 -0
  44. package/lib/localCreateDocument.d.ts.map +1 -1
  45. package/lib/localDeltaStorageService.d.ts +1 -0
  46. package/lib/localDeltaStorageService.d.ts.map +1 -1
  47. package/lib/localDeltaStorageService.mjs +1 -0
  48. package/lib/localDeltaStorageService.mjs.map +1 -1
  49. package/lib/localDocumentDeltaConnection.d.ts +1 -0
  50. package/lib/localDocumentDeltaConnection.d.ts.map +1 -1
  51. package/lib/localDocumentDeltaConnection.mjs +1 -0
  52. package/lib/localDocumentDeltaConnection.mjs.map +1 -1
  53. package/lib/localDocumentService.d.ts +3 -1
  54. package/lib/localDocumentService.d.ts.map +1 -1
  55. package/lib/localDocumentService.mjs +2 -0
  56. package/lib/localDocumentService.mjs.map +1 -1
  57. package/lib/localDocumentServiceFactory.d.ts +1 -0
  58. package/lib/localDocumentServiceFactory.d.ts.map +1 -1
  59. package/lib/localDocumentServiceFactory.mjs +1 -0
  60. package/lib/localDocumentServiceFactory.mjs.map +1 -1
  61. package/lib/localDocumentStorageService.d.ts +4 -1
  62. package/lib/localDocumentStorageService.d.ts.map +1 -1
  63. package/lib/localDocumentStorageService.mjs +4 -4
  64. package/lib/localDocumentStorageService.mjs.map +1 -1
  65. package/lib/localResolver.d.ts +4 -0
  66. package/lib/localResolver.d.ts.map +1 -1
  67. package/lib/localResolver.mjs +4 -0
  68. package/lib/localResolver.mjs.map +1 -1
  69. package/lib/localSessionStorageDb.d.ts +1 -0
  70. package/lib/localSessionStorageDb.d.ts.map +1 -1
  71. package/lib/localSessionStorageDb.mjs +1 -0
  72. package/lib/localSessionStorageDb.mjs.map +1 -1
  73. package/package.json +34 -27
  74. package/src/localDeltaStorageService.ts +1 -0
  75. package/src/localDocumentDeltaConnection.ts +1 -0
  76. package/src/localDocumentService.ts +2 -0
  77. package/src/localDocumentServiceFactory.ts +1 -0
  78. package/src/localDocumentStorageService.ts +4 -4
  79. package/src/localResolver.ts +4 -0
  80. package/src/localSessionStorageDb.ts +1 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @fluidframework/local-driver
2
2
 
3
+ ## 2.0.0-internal.8.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - local-driver: LocalDocumentStorageService class property type changes [9a451d4946](https://github.com/microsoft/FluidFramework/commits/9a451d4946b5c51a52e4d1ab5bf51e7b285b0d74)
8
+
9
+ The `repositoryUrl` property on the `LocalDocumentStorageService` class has changed from a property getter to a
10
+ `readonly` field. While this is an API change, there should be no changes required on the consumer side since calling
11
+ code should remain the same.
12
+
13
+ ## 2.0.0-internal.7.4.0
14
+
15
+ Dependency updates only.
16
+
3
17
  ## 2.0.0-internal.7.3.0
4
18
 
5
19
  Dependency updates only.
@@ -0,0 +1,13 @@
1
+ {
2
+ "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
+ "extends": "../../../common/build/build-common/api-extractor-lint.json",
4
+ "messages": {
5
+ "extractorMessageReporting": {
6
+ // TODO: remove once base config has this enabled as an error
7
+ "ae-incompatible-release-tags": {
8
+ "logLevel": "error",
9
+ "addToApiReportFile": false
10
+ }
11
+ }
12
+ }
13
+ }
@@ -1,10 +1,10 @@
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-base.json",
3
+ "extends": "../../../common/build/build-common/api-extractor-base.json",
4
4
  "messages": {
5
5
  "extractorMessageReporting": {
6
- "ae-missing-release-tag": {
7
- // TODO: Fix violations and remove this rule override
6
+ // TODO: Add missing documentation and remove this rule override
7
+ "ae-undocumented": {
8
8
  "logLevel": "none"
9
9
  }
10
10
  }
@@ -36,20 +36,20 @@ import { IWebSocketServer } from '@fluidframework/server-services-core';
36
36
  import { NackErrorType } from '@fluidframework/protocol-definitions';
37
37
  import type { Socket } from 'socket.io-client';
38
38
 
39
- // @public
39
+ // @internal
40
40
  export function createLocalDocumentService(resolvedUrl: IResolvedUrl, localDeltaConnectionServer: ILocalDeltaConnectionServer, tokenProvider: ITokenProvider, tenantId: string, documentId: string, documentDeltaConnectionsMap: Map<string, LocalDocumentDeltaConnection>, policies?: IDocumentServicePolicies, innerDocumentService?: IDocumentService, logger?: ITelemetryBaseLogger): IDocumentService;
41
41
 
42
- // @public (undocumented)
42
+ // @alpha (undocumented)
43
43
  export function createLocalResolverCreateNewRequest(documentId: string): IRequest;
44
44
 
45
- // @public
45
+ // @internal
46
46
  export class LocalDeltaStorageService implements IDocumentDeltaStorageService {
47
47
  constructor(tenantId: string, id: string, databaseManager: IDatabaseManager);
48
48
  // (undocumented)
49
49
  fetchMessages(from: number, to: number | undefined, abortSignal?: AbortSignal, cachedOnly?: boolean): IStream<ISequencedDocumentMessage[]>;
50
50
  }
51
51
 
52
- // @public
52
+ // @internal
53
53
  export class LocalDocumentDeltaConnection extends DocumentDeltaConnection {
54
54
  constructor(socket: Socket, documentId: string, logger?: ITelemetryBaseLogger);
55
55
  static create(tenantId: string, id: string, token: string, client: IClient, webSocketServer: IWebSocketServer, timeoutMs?: number, logger?: ITelemetryBaseLogger): Promise<LocalDocumentDeltaConnection>;
@@ -59,7 +59,7 @@ export class LocalDocumentDeltaConnection extends DocumentDeltaConnection {
59
59
  submitSignal(message: any): void;
60
60
  }
61
61
 
62
- // @public
62
+ // @internal
63
63
  export class LocalDocumentService implements IDocumentService {
64
64
  constructor(resolvedUrl: IResolvedUrl, localDeltaConnectionServer: ILocalDeltaConnectionServer, tokenProvider: ITokenProvider, tenantId: string, documentId: string, documentDeltaConnectionsMap: Map<string, LocalDocumentDeltaConnection>, policies?: IDocumentServicePolicies, innerDocumentService?: IDocumentService | undefined, logger?: ITelemetryBaseLogger | undefined);
65
65
  connectToDeltaStorage(): Promise<IDocumentDeltaStorageService>;
@@ -73,7 +73,7 @@ export class LocalDocumentService implements IDocumentService {
73
73
  readonly resolvedUrl: IResolvedUrl;
74
74
  }
75
75
 
76
- // @public
76
+ // @alpha
77
77
  export class LocalDocumentServiceFactory implements IDocumentServiceFactory {
78
78
  constructor(localDeltaConnectionServer: ILocalDeltaConnectionServer, policies?: IDocumentServicePolicies | undefined, innerDocumentService?: IDocumentService | undefined);
79
79
  // (undocumented)
@@ -83,7 +83,7 @@ export class LocalDocumentServiceFactory implements IDocumentServiceFactory {
83
83
  nackClient(clientId: string, code?: number, type?: NackErrorType, message?: any): void;
84
84
  }
85
85
 
86
- // @public (undocumented)
86
+ // @internal (undocumented)
87
87
  export class LocalDocumentStorageService implements IDocumentStorageService {
88
88
  constructor(id: string, manager: GitManager, policies: IDocumentStorageServicePolicies, localDeltaConnectionServer?: ILocalDeltaConnectionServer | undefined, resolvedUrl?: IResolvedUrl | undefined);
89
89
  // (undocumented)
@@ -101,12 +101,12 @@ export class LocalDocumentStorageService implements IDocumentStorageService {
101
101
  // (undocumented)
102
102
  readBlob(blobId: string): Promise<ArrayBufferLike>;
103
103
  // (undocumented)
104
- get repositoryUrl(): string;
104
+ readonly repositoryUrl: string;
105
105
  // (undocumented)
106
106
  uploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string>;
107
107
  }
108
108
 
109
- // @public
109
+ // @alpha
110
110
  export class LocalResolver implements IUrlResolver {
111
111
  constructor();
112
112
  // (undocumented)
@@ -116,7 +116,7 @@ export class LocalResolver implements IUrlResolver {
116
116
  resolve(request: IRequest): Promise<IResolvedUrl>;
117
117
  }
118
118
 
119
- // @public
119
+ // @internal
120
120
  export class LocalSessionStorageDbFactory implements ITestDbFactory {
121
121
  // (undocumented)
122
122
  connect(): Promise<IDb>;
@@ -0,0 +1,108 @@
1
+ import { DocumentDeltaConnection } from '@fluidframework/driver-base';
2
+ import { GitManager } from '@fluidframework/server-services-client';
3
+ import { IClient } from '@fluidframework/protocol-definitions';
4
+ import { ICreateBlobResponse } from '@fluidframework/protocol-definitions';
5
+ import { IDatabaseManager } from '@fluidframework/server-services-core';
6
+ import { IDb } from '@fluidframework/server-services-core';
7
+ import { IDocumentDeltaConnection } 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 { IDocumentServicePolicies } from '@fluidframework/driver-definitions';
13
+ import { IDocumentStorageService } from '@fluidframework/driver-definitions';
14
+ import { IDocumentStorageServicePolicies } from '@fluidframework/driver-definitions';
15
+ import { ILocalDeltaConnectionServer } from '@fluidframework/server-local-server';
16
+ import { IRequest } from '@fluidframework/core-interfaces';
17
+ import { IResolvedUrl } from '@fluidframework/driver-definitions';
18
+ import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
19
+ import { ISnapshotTreeEx } from '@fluidframework/protocol-definitions';
20
+ import { IStream } from '@fluidframework/driver-definitions';
21
+ import { ISummaryContext } from '@fluidframework/driver-definitions';
22
+ import { ISummaryHandle } from '@fluidframework/protocol-definitions';
23
+ import { ISummaryTree } from '@fluidframework/protocol-definitions';
24
+ import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
25
+ import { ITestDbFactory } from '@fluidframework/server-test-utils';
26
+ import { ITokenProvider } from '@fluidframework/routerlicious-driver';
27
+ import { IUrlResolver } from '@fluidframework/driver-definitions';
28
+ import { IVersion } from '@fluidframework/protocol-definitions';
29
+ import { IWebSocketServer } from '@fluidframework/server-services-core';
30
+ import { NackErrorType } from '@fluidframework/protocol-definitions';
31
+ import type { Socket } from 'socket.io-client';
32
+
33
+ /* Excluded from this release type: createLocalDocumentService */
34
+
35
+ /**
36
+ * @alpha
37
+ */
38
+ export declare function createLocalResolverCreateNewRequest(documentId: string): IRequest;
39
+
40
+ /* Excluded from this release type: DocumentDeltaConnection */
41
+
42
+ /* Excluded from this release type: LocalDeltaStorageService */
43
+
44
+ /* Excluded from this release type: LocalDocumentDeltaConnection */
45
+
46
+ /* Excluded from this release type: LocalDocumentService */
47
+
48
+ /**
49
+ * Implementation of document service factory for local use.
50
+ * @alpha
51
+ */
52
+ export declare class LocalDocumentServiceFactory implements IDocumentServiceFactory {
53
+ private readonly localDeltaConnectionServer;
54
+ private readonly policies?;
55
+ private readonly innerDocumentService?;
56
+ private readonly documentDeltaConnectionsMap;
57
+ /**
58
+ * @param localDeltaConnectionServer - delta connection server for ops
59
+ */
60
+ constructor(localDeltaConnectionServer: ILocalDeltaConnectionServer, policies?: IDocumentServicePolicies | undefined, innerDocumentService?: IDocumentService | undefined);
61
+ createContainer(createNewSummary: ISummaryTree | undefined, resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
62
+ /**
63
+ * Creates and returns a document service for testing using the given resolved
64
+ * URL for the tenant ID, document ID, and token.
65
+ * @param resolvedUrl - resolved URL of document
66
+ */
67
+ createDocumentService(resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
68
+ /**
69
+ * Gets the document delta connection for the clientId and asks it to disconnect the client.
70
+ * @param clientId - The ID of the client to be disconnected.
71
+ * @param disconnectReason - The reason of the disconnection.
72
+ */
73
+ disconnectClient(clientId: string, disconnectReason: string): void;
74
+ /**
75
+ * Gets the document delta connection for the clientId and asks it to nack the client.
76
+ * @param clientId - The ID of the client to be Nack'd.
77
+ * @param code - An error code number that represents the error. It will be a valid HTTP error code.
78
+ * @param type - Type of the Nack.
79
+ * @param message - A message about the nack for debugging/logging/telemetry purposes.
80
+ */
81
+ nackClient(clientId: string, code?: number, type?: NackErrorType, message?: any): void;
82
+ }
83
+
84
+ /* Excluded from this release type: LocalDocumentStorageService */
85
+
86
+ /**
87
+ * Resolves URLs by providing fake URLs which succeed with the other
88
+ * related local classes.
89
+ * @alpha
90
+ */
91
+ export declare class LocalResolver implements IUrlResolver {
92
+ private readonly tenantId;
93
+ private readonly tokenKey;
94
+ constructor();
95
+ /**
96
+ * Resolves URL requests by providing fake URLs with an actually generated
97
+ * token from constant test strings. The root of the URL is fake, but the
98
+ * remaining relative URL can still be parsed.
99
+ * @param request - request to handle
100
+ */
101
+ resolve(request: IRequest): Promise<IResolvedUrl>;
102
+ getAbsoluteUrl(resolvedUrl: IResolvedUrl, relativeUrl: string): Promise<string>;
103
+ createCreateNewRequest(documentId: string): IRequest;
104
+ }
105
+
106
+ /* Excluded from this release type: LocalSessionStorageDbFactory */
107
+
108
+ export { }
@@ -0,0 +1,81 @@
1
+ import { DocumentDeltaConnection } from '@fluidframework/driver-base';
2
+ import { GitManager } from '@fluidframework/server-services-client';
3
+ import { IClient } from '@fluidframework/protocol-definitions';
4
+ import { ICreateBlobResponse } from '@fluidframework/protocol-definitions';
5
+ import { IDatabaseManager } from '@fluidframework/server-services-core';
6
+ import { IDb } from '@fluidframework/server-services-core';
7
+ import { IDocumentDeltaConnection } 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 { IDocumentServicePolicies } from '@fluidframework/driver-definitions';
13
+ import { IDocumentStorageService } from '@fluidframework/driver-definitions';
14
+ import { IDocumentStorageServicePolicies } from '@fluidframework/driver-definitions';
15
+ import { ILocalDeltaConnectionServer } from '@fluidframework/server-local-server';
16
+ import { IRequest } from '@fluidframework/core-interfaces';
17
+ import { IResolvedUrl } from '@fluidframework/driver-definitions';
18
+ import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
19
+ import { ISnapshotTreeEx } from '@fluidframework/protocol-definitions';
20
+ import { IStream } from '@fluidframework/driver-definitions';
21
+ import { ISummaryContext } from '@fluidframework/driver-definitions';
22
+ import { ISummaryHandle } from '@fluidframework/protocol-definitions';
23
+ import { ISummaryTree } from '@fluidframework/protocol-definitions';
24
+ import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
25
+ import { ITestDbFactory } from '@fluidframework/server-test-utils';
26
+ import { ITokenProvider } from '@fluidframework/routerlicious-driver';
27
+ import { IUrlResolver } from '@fluidframework/driver-definitions';
28
+ import { IVersion } from '@fluidframework/protocol-definitions';
29
+ import { IWebSocketServer } from '@fluidframework/server-services-core';
30
+ import { NackErrorType } from '@fluidframework/protocol-definitions';
31
+ import type { Socket } from 'socket.io-client';
32
+
33
+ /* Excluded from this release type: createLocalDocumentService */
34
+
35
+ /* Excluded from this release type: createLocalResolverCreateNewRequest */
36
+
37
+ /* Excluded from this release type: DocumentDeltaConnection */
38
+
39
+ /* Excluded from this release type: IDocumentDeltaConnection */
40
+
41
+ /* Excluded from this release type: IDocumentDeltaStorageService */
42
+
43
+ /* Excluded from this release type: IDocumentService */
44
+
45
+ /* Excluded from this release type: IDocumentServiceFactory */
46
+
47
+ /* Excluded from this release type: IDocumentServicePolicies */
48
+
49
+ /* Excluded from this release type: IDocumentStorageService */
50
+
51
+ /* Excluded from this release type: IDocumentStorageServicePolicies */
52
+
53
+ /* Excluded from this release type: IRequest */
54
+
55
+ /* Excluded from this release type: IResolvedUrl */
56
+
57
+ /* Excluded from this release type: IStream */
58
+
59
+ /* Excluded from this release type: ISummaryContext */
60
+
61
+ /* Excluded from this release type: ITelemetryBaseLogger */
62
+
63
+ /* Excluded from this release type: ITokenProvider */
64
+
65
+ /* Excluded from this release type: IUrlResolver */
66
+
67
+ /* Excluded from this release type: LocalDeltaStorageService */
68
+
69
+ /* Excluded from this release type: LocalDocumentDeltaConnection */
70
+
71
+ /* Excluded from this release type: LocalDocumentService */
72
+
73
+ /* Excluded from this release type: LocalDocumentServiceFactory */
74
+
75
+ /* Excluded from this release type: LocalDocumentStorageService */
76
+
77
+ /* Excluded from this release type: LocalResolver */
78
+
79
+ /* Excluded from this release type: LocalSessionStorageDbFactory */
80
+
81
+ export { }
@@ -0,0 +1,81 @@
1
+ import { DocumentDeltaConnection } from '@fluidframework/driver-base';
2
+ import { GitManager } from '@fluidframework/server-services-client';
3
+ import { IClient } from '@fluidframework/protocol-definitions';
4
+ import { ICreateBlobResponse } from '@fluidframework/protocol-definitions';
5
+ import { IDatabaseManager } from '@fluidframework/server-services-core';
6
+ import { IDb } from '@fluidframework/server-services-core';
7
+ import { IDocumentDeltaConnection } 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 { IDocumentServicePolicies } from '@fluidframework/driver-definitions';
13
+ import { IDocumentStorageService } from '@fluidframework/driver-definitions';
14
+ import { IDocumentStorageServicePolicies } from '@fluidframework/driver-definitions';
15
+ import { ILocalDeltaConnectionServer } from '@fluidframework/server-local-server';
16
+ import { IRequest } from '@fluidframework/core-interfaces';
17
+ import { IResolvedUrl } from '@fluidframework/driver-definitions';
18
+ import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
19
+ import { ISnapshotTreeEx } from '@fluidframework/protocol-definitions';
20
+ import { IStream } from '@fluidframework/driver-definitions';
21
+ import { ISummaryContext } from '@fluidframework/driver-definitions';
22
+ import { ISummaryHandle } from '@fluidframework/protocol-definitions';
23
+ import { ISummaryTree } from '@fluidframework/protocol-definitions';
24
+ import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
25
+ import { ITestDbFactory } from '@fluidframework/server-test-utils';
26
+ import { ITokenProvider } from '@fluidframework/routerlicious-driver';
27
+ import { IUrlResolver } from '@fluidframework/driver-definitions';
28
+ import { IVersion } from '@fluidframework/protocol-definitions';
29
+ import { IWebSocketServer } from '@fluidframework/server-services-core';
30
+ import { NackErrorType } from '@fluidframework/protocol-definitions';
31
+ import type { Socket } from 'socket.io-client';
32
+
33
+ /* Excluded from this release type: createLocalDocumentService */
34
+
35
+ /* Excluded from this release type: createLocalResolverCreateNewRequest */
36
+
37
+ /* Excluded from this release type: DocumentDeltaConnection */
38
+
39
+ /* Excluded from this release type: IDocumentDeltaConnection */
40
+
41
+ /* Excluded from this release type: IDocumentDeltaStorageService */
42
+
43
+ /* Excluded from this release type: IDocumentService */
44
+
45
+ /* Excluded from this release type: IDocumentServiceFactory */
46
+
47
+ /* Excluded from this release type: IDocumentServicePolicies */
48
+
49
+ /* Excluded from this release type: IDocumentStorageService */
50
+
51
+ /* Excluded from this release type: IDocumentStorageServicePolicies */
52
+
53
+ /* Excluded from this release type: IRequest */
54
+
55
+ /* Excluded from this release type: IResolvedUrl */
56
+
57
+ /* Excluded from this release type: IStream */
58
+
59
+ /* Excluded from this release type: ISummaryContext */
60
+
61
+ /* Excluded from this release type: ITelemetryBaseLogger */
62
+
63
+ /* Excluded from this release type: ITokenProvider */
64
+
65
+ /* Excluded from this release type: IUrlResolver */
66
+
67
+ /* Excluded from this release type: LocalDeltaStorageService */
68
+
69
+ /* Excluded from this release type: LocalDocumentDeltaConnection */
70
+
71
+ /* Excluded from this release type: LocalDocumentService */
72
+
73
+ /* Excluded from this release type: LocalDocumentServiceFactory */
74
+
75
+ /* Excluded from this release type: LocalDocumentStorageService */
76
+
77
+ /* Excluded from this release type: LocalResolver */
78
+
79
+ /* Excluded from this release type: LocalSessionStorageDbFactory */
80
+
81
+ export { }
@@ -0,0 +1,224 @@
1
+ import { DocumentDeltaConnection } from '@fluidframework/driver-base';
2
+ import { GitManager } from '@fluidframework/server-services-client';
3
+ import { IClient } from '@fluidframework/protocol-definitions';
4
+ import { ICreateBlobResponse } from '@fluidframework/protocol-definitions';
5
+ import { IDatabaseManager } from '@fluidframework/server-services-core';
6
+ import { IDb } from '@fluidframework/server-services-core';
7
+ import { IDocumentDeltaConnection } 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 { IDocumentServicePolicies } from '@fluidframework/driver-definitions';
13
+ import { IDocumentStorageService } from '@fluidframework/driver-definitions';
14
+ import { IDocumentStorageServicePolicies } from '@fluidframework/driver-definitions';
15
+ import { ILocalDeltaConnectionServer } from '@fluidframework/server-local-server';
16
+ import { IRequest } from '@fluidframework/core-interfaces';
17
+ import { IResolvedUrl } from '@fluidframework/driver-definitions';
18
+ import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
19
+ import { ISnapshotTreeEx } from '@fluidframework/protocol-definitions';
20
+ import { IStream } from '@fluidframework/driver-definitions';
21
+ import { ISummaryContext } from '@fluidframework/driver-definitions';
22
+ import { ISummaryHandle } from '@fluidframework/protocol-definitions';
23
+ import { ISummaryTree } from '@fluidframework/protocol-definitions';
24
+ import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
25
+ import { ITestDbFactory } from '@fluidframework/server-test-utils';
26
+ import { ITokenProvider } from '@fluidframework/routerlicious-driver';
27
+ import { IUrlResolver } from '@fluidframework/driver-definitions';
28
+ import { IVersion } from '@fluidframework/protocol-definitions';
29
+ import { IWebSocketServer } from '@fluidframework/server-services-core';
30
+ import { NackErrorType } from '@fluidframework/protocol-definitions';
31
+ import type { Socket } from 'socket.io-client';
32
+
33
+ /**
34
+ * Creates and returns a document service for local use.
35
+ * @param localDeltaConnectionServer - delta connection server for ops
36
+ * @param tokenProvider - token provider with a single token
37
+ * @param tenantId - ID of tenant
38
+ * @param documentId - ID of document
39
+ * @internal
40
+ */
41
+ export declare function createLocalDocumentService(resolvedUrl: IResolvedUrl, localDeltaConnectionServer: ILocalDeltaConnectionServer, tokenProvider: ITokenProvider, tenantId: string, documentId: string, documentDeltaConnectionsMap: Map<string, LocalDocumentDeltaConnection>, policies?: IDocumentServicePolicies, innerDocumentService?: IDocumentService, logger?: ITelemetryBaseLogger): IDocumentService;
42
+
43
+ /**
44
+ * @alpha
45
+ */
46
+ export declare function createLocalResolverCreateNewRequest(documentId: string): IRequest;
47
+
48
+ /**
49
+ * Provides access to the underlying delta storage on the server for local driver.
50
+ * @internal
51
+ */
52
+ export declare class LocalDeltaStorageService implements IDocumentDeltaStorageService {
53
+ private readonly tenantId;
54
+ private readonly id;
55
+ private readonly databaseManager;
56
+ constructor(tenantId: string, id: string, databaseManager: IDatabaseManager);
57
+ fetchMessages(from: number, to: number | undefined, abortSignal?: AbortSignal, cachedOnly?: boolean): IStream<ISequencedDocumentMessage[]>;
58
+ private getCore;
59
+ }
60
+
61
+ /**
62
+ * Represents a connection to a stream of delta updates
63
+ * @internal
64
+ */
65
+ export declare class LocalDocumentDeltaConnection extends DocumentDeltaConnection {
66
+ /**
67
+ * Create a LocalDocumentDeltaConnection
68
+ * Handle initial messages, contents or signals if they were in queue
69
+ *
70
+ * @param tenantId - the ID of the tenant
71
+ * @param id - document ID
72
+ * @param token - authorization token for storage service
73
+ * @param client - information about the client
74
+ * @param webSocketServer - web socket server to create connection
75
+ */
76
+ static create(tenantId: string, id: string, token: string, client: IClient, webSocketServer: IWebSocketServer, timeoutMs?: number, logger?: ITelemetryBaseLogger): Promise<LocalDocumentDeltaConnection>;
77
+ constructor(socket: Socket, documentId: string, logger?: ITelemetryBaseLogger);
78
+ /**
79
+ * Submits a new delta operation to the server
80
+ */
81
+ submit(messages: IDocumentMessage[]): void;
82
+ /**
83
+ * Submits a new signal to the server
84
+ */
85
+ submitSignal(message: any): void;
86
+ /**
87
+ * Send a "disconnect" message on the socket.
88
+ * @param disconnectReason - The reason of the disconnection.
89
+ */
90
+ disconnectClient(disconnectReason: string): void;
91
+ /**
92
+ * * Sends a "nack" message on the socket.
93
+ * @param code - An error code number that represents the error. It will be a valid HTTP error code.
94
+ * @param type - Type of the Nack.
95
+ * @param message - A message about the nack for debugging/logging/telemetry purposes.
96
+ */
97
+ nackClient(code: number | undefined, type: NackErrorType | undefined, message: any): void;
98
+ }
99
+
100
+ /**
101
+ * Basic implementation of a document service for local use.
102
+ * @internal
103
+ */
104
+ export declare class LocalDocumentService implements IDocumentService {
105
+ readonly resolvedUrl: IResolvedUrl;
106
+ private readonly localDeltaConnectionServer;
107
+ private readonly tokenProvider;
108
+ private readonly tenantId;
109
+ private readonly documentId;
110
+ private readonly documentDeltaConnectionsMap;
111
+ readonly policies: IDocumentServicePolicies;
112
+ private readonly innerDocumentService?;
113
+ private readonly logger?;
114
+ /**
115
+ * @param localDeltaConnectionServer - delta connection server for ops
116
+ * @param tokenProvider - token provider
117
+ * @param tenantId - ID of tenant
118
+ * @param documentId - ID of document
119
+ */
120
+ constructor(resolvedUrl: IResolvedUrl, localDeltaConnectionServer: ILocalDeltaConnectionServer, tokenProvider: ITokenProvider, tenantId: string, documentId: string, documentDeltaConnectionsMap: Map<string, LocalDocumentDeltaConnection>, policies?: IDocumentServicePolicies, innerDocumentService?: IDocumentService | undefined, logger?: ITelemetryBaseLogger | undefined);
121
+ dispose(): void;
122
+ /**
123
+ * Creates and returns a document storage service for local use.
124
+ */
125
+ connectToStorage(): Promise<IDocumentStorageService>;
126
+ /**
127
+ * Creates and returns a delta storage service for local use.
128
+ */
129
+ connectToDeltaStorage(): Promise<IDocumentDeltaStorageService>;
130
+ /**
131
+ * Creates and returns a delta stream for local use.
132
+ * @param client - client data
133
+ */
134
+ connectToDeltaStream(client: IClient): Promise<IDocumentDeltaConnection>;
135
+ }
136
+
137
+ /**
138
+ * Implementation of document service factory for local use.
139
+ * @alpha
140
+ */
141
+ export declare class LocalDocumentServiceFactory implements IDocumentServiceFactory {
142
+ private readonly localDeltaConnectionServer;
143
+ private readonly policies?;
144
+ private readonly innerDocumentService?;
145
+ private readonly documentDeltaConnectionsMap;
146
+ /**
147
+ * @param localDeltaConnectionServer - delta connection server for ops
148
+ */
149
+ constructor(localDeltaConnectionServer: ILocalDeltaConnectionServer, policies?: IDocumentServicePolicies | undefined, innerDocumentService?: IDocumentService | undefined);
150
+ createContainer(createNewSummary: ISummaryTree | undefined, resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
151
+ /**
152
+ * Creates and returns a document service for testing using the given resolved
153
+ * URL for the tenant ID, document ID, and token.
154
+ * @param resolvedUrl - resolved URL of document
155
+ */
156
+ createDocumentService(resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
157
+ /**
158
+ * Gets the document delta connection for the clientId and asks it to disconnect the client.
159
+ * @param clientId - The ID of the client to be disconnected.
160
+ * @param disconnectReason - The reason of the disconnection.
161
+ */
162
+ disconnectClient(clientId: string, disconnectReason: string): void;
163
+ /**
164
+ * Gets the document delta connection for the clientId and asks it to nack the client.
165
+ * @param clientId - The ID of the client to be Nack'd.
166
+ * @param code - An error code number that represents the error. It will be a valid HTTP error code.
167
+ * @param type - Type of the Nack.
168
+ * @param message - A message about the nack for debugging/logging/telemetry purposes.
169
+ */
170
+ nackClient(clientId: string, code?: number, type?: NackErrorType, message?: any): void;
171
+ }
172
+
173
+ /**
174
+ * @internal
175
+ */
176
+ export declare class LocalDocumentStorageService implements IDocumentStorageService {
177
+ private readonly id;
178
+ private readonly manager;
179
+ readonly policies: IDocumentStorageServicePolicies;
180
+ private readonly localDeltaConnectionServer?;
181
+ private readonly resolvedUrl?;
182
+ protected readonly blobsShaCache: Map<string, string>;
183
+ private readonly summaryTreeUploadManager;
184
+ readonly repositoryUrl: string;
185
+ constructor(id: string, manager: GitManager, policies: IDocumentStorageServicePolicies, localDeltaConnectionServer?: ILocalDeltaConnectionServer | undefined, resolvedUrl?: IResolvedUrl | undefined);
186
+ getVersions(versionId: string | null, count: number): Promise<IVersion[]>;
187
+ getSnapshotTree(version?: IVersion): Promise<ISnapshotTreeEx | null>;
188
+ readBlob(blobId: string): Promise<ArrayBufferLike>;
189
+ uploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string>;
190
+ createBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse>;
191
+ downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree>;
192
+ private getPreviousFullSnapshot;
193
+ }
194
+
195
+ /**
196
+ * Resolves URLs by providing fake URLs which succeed with the other
197
+ * related local classes.
198
+ * @alpha
199
+ */
200
+ export declare class LocalResolver implements IUrlResolver {
201
+ private readonly tenantId;
202
+ private readonly tokenKey;
203
+ constructor();
204
+ /**
205
+ * Resolves URL requests by providing fake URLs with an actually generated
206
+ * token from constant test strings. The root of the URL is fake, but the
207
+ * remaining relative URL can still be parsed.
208
+ * @param request - request to handle
209
+ */
210
+ resolve(request: IRequest): Promise<IResolvedUrl>;
211
+ getAbsoluteUrl(resolvedUrl: IResolvedUrl, relativeUrl: string): Promise<string>;
212
+ createCreateNewRequest(documentId: string): IRequest;
213
+ }
214
+
215
+ /**
216
+ * A database factory for testing that stores data in the browsers session storage
217
+ * @internal
218
+ */
219
+ export declare class LocalSessionStorageDbFactory implements ITestDbFactory {
220
+ readonly testDatabase: IDb;
221
+ connect(): Promise<IDb>;
222
+ }
223
+
224
+ export { }
@@ -8,6 +8,7 @@ exports.LocalDeltaStorageService = void 0;
8
8
  const driver_utils_1 = require("@fluidframework/driver-utils");
9
9
  /**
10
10
  * Provides access to the underlying delta storage on the server for local driver.
11
+ * @internal
11
12
  */
12
13
  class LocalDeltaStorageService {
13
14
  constructor(tenantId, id, databaseManager) {
@@ -1 +1 @@
1
- {"version":3,"file":"localDeltaStorageService.cjs","sourceRoot":"","sources":["../src/localDeltaStorageService.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH,+DAAkE;AAElE;;GAEG;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,iCAAkB,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\";\nimport { ISequencedDocumentMessage } from \"@fluidframework/protocol-definitions\";\nimport { IDatabaseManager } from \"@fluidframework/server-services-core\";\nimport { streamFromMessages } from \"@fluidframework/driver-utils\";\n\n/**\n * Provides access to the underlying delta storage on the server for local driver.\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"]}
1
+ {"version":3,"file":"localDeltaStorageService.cjs","sourceRoot":"","sources":["../src/localDeltaStorageService.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH,+DAAkE;AAElE;;;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,iCAAkB,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\";\nimport { ISequencedDocumentMessage } from \"@fluidframework/protocol-definitions\";\nimport { IDatabaseManager } from \"@fluidframework/server-services-core\";\nimport { streamFromMessages } from \"@fluidframework/driver-utils\";\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"]}
@@ -7,6 +7,7 @@ import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions"
7
7
  import { IDatabaseManager } from "@fluidframework/server-services-core";
8
8
  /**
9
9
  * Provides access to the underlying delta storage on the server for local driver.
10
+ * @internal
10
11
  */
11
12
  export declare class LocalDeltaStorageService implements IDocumentDeltaStorageService {
12
13
  private readonly tenantId;