@fluidframework/local-driver 2.0.0-dev.7.4.0.215930 → 2.0.0-dev.7.4.0.216897

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