@fluidframework/local-driver 2.0.0-rc.2.0.1 → 2.0.0-rc.3.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 (94) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/api-report/local-driver.api.md +16 -16
  3. package/dist/legacy.d.ts +16 -0
  4. package/dist/localCreateDocument.d.ts +1 -1
  5. package/dist/localCreateDocument.d.ts.map +1 -1
  6. package/dist/localCreateDocument.js +4 -4
  7. package/dist/localCreateDocument.js.map +1 -1
  8. package/dist/localDeltaStorageService.d.ts +1 -1
  9. package/dist/localDeltaStorageService.d.ts.map +1 -1
  10. package/dist/localDeltaStorageService.js +2 -2
  11. package/dist/localDeltaStorageService.js.map +1 -1
  12. package/dist/localDocumentDeltaConnection.d.ts +3 -3
  13. package/dist/localDocumentDeltaConnection.d.ts.map +1 -1
  14. package/dist/localDocumentDeltaConnection.js +4 -4
  15. package/dist/localDocumentDeltaConnection.js.map +1 -1
  16. package/dist/localDocumentService.d.ts +2 -2
  17. package/dist/localDocumentService.d.ts.map +1 -1
  18. package/dist/localDocumentService.js +2 -2
  19. package/dist/localDocumentService.js.map +1 -1
  20. package/dist/localDocumentServiceFactory.d.ts +2 -2
  21. package/dist/localDocumentServiceFactory.d.ts.map +1 -1
  22. package/dist/localDocumentServiceFactory.js +3 -3
  23. package/dist/localDocumentServiceFactory.js.map +1 -1
  24. package/dist/localDocumentStorageService.d.ts +3 -3
  25. package/dist/localDocumentStorageService.d.ts.map +1 -1
  26. package/dist/localDocumentStorageService.js +13 -10
  27. package/dist/localDocumentStorageService.js.map +1 -1
  28. package/dist/localResolver.d.ts +1 -1
  29. package/dist/localResolver.d.ts.map +1 -1
  30. package/dist/localResolver.js +4 -4
  31. package/dist/localResolver.js.map +1 -1
  32. package/dist/localSessionStorageDb.d.ts +4 -0
  33. package/dist/localSessionStorageDb.d.ts.map +1 -1
  34. package/dist/localSessionStorageDb.js +2 -2
  35. package/dist/localSessionStorageDb.js.map +1 -1
  36. package/dist/public.d.ts +12 -0
  37. package/internal.d.ts +11 -0
  38. package/legacy.d.ts +11 -0
  39. package/lib/legacy.d.ts +16 -0
  40. package/lib/localCreateDocument.d.ts +1 -1
  41. package/lib/localCreateDocument.d.ts.map +1 -1
  42. package/lib/localCreateDocument.js +1 -1
  43. package/lib/localCreateDocument.js.map +1 -1
  44. package/lib/localDeltaStorageService.d.ts +1 -1
  45. package/lib/localDeltaStorageService.d.ts.map +1 -1
  46. package/lib/localDeltaStorageService.js +1 -1
  47. package/lib/localDeltaStorageService.js.map +1 -1
  48. package/lib/localDocumentDeltaConnection.d.ts +3 -3
  49. package/lib/localDocumentDeltaConnection.d.ts.map +1 -1
  50. package/lib/localDocumentDeltaConnection.js +2 -2
  51. package/lib/localDocumentDeltaConnection.js.map +1 -1
  52. package/lib/localDocumentService.d.ts +2 -2
  53. package/lib/localDocumentService.d.ts.map +1 -1
  54. package/lib/localDocumentService.js +2 -2
  55. package/lib/localDocumentService.js.map +1 -1
  56. package/lib/localDocumentServiceFactory.d.ts +2 -2
  57. package/lib/localDocumentServiceFactory.d.ts.map +1 -1
  58. package/lib/localDocumentServiceFactory.js +2 -2
  59. package/lib/localDocumentServiceFactory.js.map +1 -1
  60. package/lib/localDocumentStorageService.d.ts +3 -3
  61. package/lib/localDocumentStorageService.d.ts.map +1 -1
  62. package/lib/localDocumentStorageService.js +13 -10
  63. package/lib/localDocumentStorageService.js.map +1 -1
  64. package/lib/localResolver.d.ts +1 -1
  65. package/lib/localResolver.d.ts.map +1 -1
  66. package/lib/localResolver.js +2 -2
  67. package/lib/localResolver.js.map +1 -1
  68. package/lib/localSessionStorageDb.d.ts +4 -0
  69. package/lib/localSessionStorageDb.d.ts.map +1 -1
  70. package/lib/localSessionStorageDb.js.map +1 -1
  71. package/lib/public.d.ts +12 -0
  72. package/package.json +32 -53
  73. package/src/localCreateDocument.ts +2 -2
  74. package/src/localDeltaStorageService.ts +2 -2
  75. package/src/localDocumentDeltaConnection.ts +4 -4
  76. package/src/localDocumentService.ts +6 -5
  77. package/src/localDocumentServiceFactory.ts +6 -5
  78. package/src/localDocumentStorageService.ts +22 -15
  79. package/src/localResolver.ts +7 -2
  80. package/src/localSessionStorageDb.ts +1 -0
  81. package/api-extractor-cjs.json +0 -8
  82. package/dist/local-driver-alpha.d.ts +0 -112
  83. package/dist/local-driver-beta.d.ts +0 -85
  84. package/dist/local-driver-public.d.ts +0 -85
  85. package/dist/local-driver-untrimmed.d.ts +0 -253
  86. package/lib/local-driver-alpha.d.ts +0 -112
  87. package/lib/local-driver-beta.d.ts +0 -85
  88. package/lib/local-driver-public.d.ts +0 -85
  89. package/lib/local-driver-untrimmed.d.ts +0 -253
  90. package/lib/test/localResolverTest.spec.js +0 -47
  91. package/lib/test/localResolverTest.spec.js.map +0 -1
  92. package/lib/test/types/validateLocalDriverPrevious.generated.js +0 -26
  93. package/lib/test/types/validateLocalDriverPrevious.generated.js.map +0 -1
  94. /package/{dist → lib}/tsdoc-metadata.json +0 -0
@@ -1,253 +0,0 @@
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 { 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';
16
- import { ILocalDeltaConnectionServer } from '@fluidframework/server-local-server';
17
- import { IRequest } from '@fluidframework/core-interfaces';
18
- import { IResolvedUrl } from '@fluidframework/driver-definitions';
19
- import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
20
- import { ISnapshot } from '@fluidframework/driver-definitions';
21
- import { ISnapshotFetchOptions } from '@fluidframework/driver-definitions';
22
- import { ISnapshotTreeEx } from '@fluidframework/protocol-definitions';
23
- import { IStream } from '@fluidframework/driver-definitions';
24
- import { ISummaryContext } from '@fluidframework/driver-definitions';
25
- import { ISummaryHandle } from '@fluidframework/protocol-definitions';
26
- import { ISummaryTree } from '@fluidframework/protocol-definitions';
27
- import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
28
- import { ITestDbFactory } from '@fluidframework/server-test-utils';
29
- import { ITokenProvider } from '@fluidframework/routerlicious-driver';
30
- import { IUrlResolver } from '@fluidframework/driver-definitions';
31
- import { IVersion } from '@fluidframework/protocol-definitions';
32
- import { IWebSocketServer } from '@fluidframework/server-services-core';
33
- import { NackErrorType } from '@fluidframework/protocol-definitions';
34
- import type { Socket } from 'socket.io-client';
35
- import { TypedEventEmitter } from '@fluid-internal/client-utils';
36
-
37
- /**
38
- * Creates and returns a document service for local use.
39
- * @param localDeltaConnectionServer - delta connection server for ops
40
- * @param tokenProvider - token provider with a single token
41
- * @param tenantId - ID of tenant
42
- * @param documentId - ID of document
43
- * @internal
44
- */
45
- 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;
46
-
47
- /**
48
- * @alpha
49
- */
50
- export declare function createLocalResolverCreateNewRequest(documentId: string): IRequest;
51
-
52
- /**
53
- * Provides access to the underlying delta storage on the server for local driver.
54
- * @internal
55
- */
56
- export declare class LocalDeltaStorageService implements IDocumentDeltaStorageService {
57
- private readonly tenantId;
58
- private readonly id;
59
- private readonly databaseManager;
60
- constructor(tenantId: string, id: string, databaseManager: IDatabaseManager);
61
- fetchMessages(from: number, to: number | undefined, abortSignal?: AbortSignal, cachedOnly?: boolean): IStream<ISequencedDocumentMessage[]>;
62
- private getCore;
63
- }
64
-
65
- /**
66
- * Represents a connection to a stream of delta updates
67
- * @internal
68
- */
69
- export declare class LocalDocumentDeltaConnection extends DocumentDeltaConnection {
70
- /**
71
- * Create a LocalDocumentDeltaConnection
72
- * Handle initial messages, contents or signals if they were in queue
73
- *
74
- * @param tenantId - the ID of the tenant
75
- * @param id - document ID
76
- * @param token - authorization token for storage service
77
- * @param client - information about the client
78
- * @param webSocketServer - web socket server to create connection
79
- */
80
- static create(tenantId: string, id: string, token: string, client: IClient, webSocketServer: IWebSocketServer, timeoutMs?: number, logger?: ITelemetryBaseLogger): Promise<LocalDocumentDeltaConnection>;
81
- constructor(socket: Socket, documentId: string, logger?: ITelemetryBaseLogger);
82
- /**
83
- * Submits a new delta operation to the server
84
- */
85
- submit(messages: IDocumentMessage[]): void;
86
- /**
87
- * Submits a new signal to the server
88
- */
89
- submitSignal(message: any): void;
90
- /**
91
- * Send a "disconnect" message on the socket.
92
- * @param disconnectReason - The reason of the disconnection.
93
- */
94
- disconnectClient(disconnectReason: string): void;
95
- /**
96
- * * Sends a "nack" message on the socket.
97
- * @param code - An error code number that represents the error. It will be a valid HTTP error code.
98
- * @param type - Type of the Nack.
99
- * @param message - A message about the nack for debugging/logging/telemetry purposes.
100
- */
101
- nackClient(code: number | undefined, type: NackErrorType | undefined, message: any): void;
102
- }
103
-
104
- /**
105
- * Basic implementation of a document service for local use.
106
- * @internal
107
- */
108
- export declare class LocalDocumentService extends TypedEventEmitter<IDocumentServiceEvents> implements IDocumentService {
109
- readonly resolvedUrl: IResolvedUrl;
110
- private readonly localDeltaConnectionServer;
111
- private readonly tokenProvider;
112
- private readonly tenantId;
113
- private readonly documentId;
114
- private readonly documentDeltaConnectionsMap;
115
- readonly policies: IDocumentServicePolicies;
116
- private readonly innerDocumentService?;
117
- private readonly logger?;
118
- /**
119
- * @param localDeltaConnectionServer - delta connection server for ops
120
- * @param tokenProvider - token provider
121
- * @param tenantId - ID of tenant
122
- * @param documentId - ID of document
123
- */
124
- constructor(resolvedUrl: IResolvedUrl, localDeltaConnectionServer: ILocalDeltaConnectionServer, tokenProvider: ITokenProvider, tenantId: string, documentId: string, documentDeltaConnectionsMap: Map<string, LocalDocumentDeltaConnection>, policies?: IDocumentServicePolicies, innerDocumentService?: IDocumentService | undefined, logger?: ITelemetryBaseLogger | undefined);
125
- dispose(): void;
126
- /**
127
- * Creates and returns a document storage service for local use.
128
- */
129
- connectToStorage(): Promise<IDocumentStorageService>;
130
- /**
131
- * Creates and returns a delta storage service for local use.
132
- */
133
- connectToDeltaStorage(): Promise<IDocumentDeltaStorageService>;
134
- /**
135
- * Creates and returns a delta stream for local use.
136
- * @param client - client data
137
- */
138
- connectToDeltaStream(client: IClient): Promise<IDocumentDeltaConnection>;
139
- }
140
-
141
- /**
142
- * Implementation of document service factory for local use.
143
- * @alpha
144
- */
145
- export declare class LocalDocumentServiceFactory implements IDocumentServiceFactory {
146
- private readonly localDeltaConnectionServer;
147
- private readonly policies?;
148
- private readonly innerDocumentService?;
149
- private readonly documentDeltaConnectionsMap;
150
- /**
151
- * @param localDeltaConnectionServer - delta connection server for ops
152
- */
153
- constructor(localDeltaConnectionServer: ILocalDeltaConnectionServer, policies?: IDocumentServicePolicies | undefined, innerDocumentService?: IDocumentService | undefined);
154
- createContainer(createNewSummary: ISummaryTree | undefined, resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
155
- /**
156
- * Creates and returns a document service for testing using the given resolved
157
- * URL for the tenant ID, document ID, and token.
158
- * @param resolvedUrl - resolved URL of document
159
- */
160
- createDocumentService(resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
161
- /**
162
- * Gets the document delta connection for the clientId and asks it to disconnect the client.
163
- * @param clientId - The ID of the client to be disconnected.
164
- * @param disconnectReason - The reason of the disconnection.
165
- */
166
- disconnectClient(clientId: string, disconnectReason: string): void;
167
- /**
168
- * Gets the document delta connection for the clientId and asks it to nack the client.
169
- * @param clientId - The ID of the client to be Nack'd.
170
- * @param code - An error code number that represents the error. It will be a valid HTTP error code.
171
- * @param type - Type of the Nack.
172
- * @param message - A message about the nack for debugging/logging/telemetry purposes.
173
- */
174
- nackClient(clientId: string, code?: number, type?: NackErrorType, message?: any): void;
175
- }
176
-
177
- /**
178
- * @internal
179
- */
180
- export declare class LocalDocumentStorageService implements IDocumentStorageService {
181
- private readonly id;
182
- private readonly manager;
183
- readonly policies: IDocumentStorageServicePolicies;
184
- private readonly localDeltaConnectionServer?;
185
- private readonly resolvedUrl?;
186
- protected readonly blobsShaCache: Map<string, string>;
187
- private readonly summaryTreeUploadManager;
188
- constructor(id: string, manager: GitManager, policies: IDocumentStorageServicePolicies, localDeltaConnectionServer?: ILocalDeltaConnectionServer | undefined, resolvedUrl?: IResolvedUrl | undefined);
189
- getVersions(versionId: string | null, count: number): Promise<IVersion[]>;
190
- getSnapshotTree(version?: IVersion): Promise<ISnapshotTreeEx | null>;
191
- getSnapshot(snapshotFetchOptions?: ISnapshotFetchOptions): Promise<ISnapshot>;
192
- /**
193
- * Strips the tree or any subtree of data if it has a groupId.
194
- *
195
- * @param tree - The tree to strip of loading groupIds
196
- * @returns a tree that has trees with groupIds that are empty
197
- */
198
- private stripTreeOfLoadingGroupIds;
199
- /**
200
- * Named differently as the algorithm is a little more involved.
201
- *
202
- * We want to strip the tree if it has a groupId that is not in the loadingGroupIds or if it doesn't have a descendent or ancestor
203
- * that has a groupId that is in the loadingGroupIds.
204
- *
205
- * We keep the tree in the opposite case.
206
- *
207
- * @param tree - the tree to strip of any data that is not in the loadingGroupIds
208
- * @param loadingGroupIds - the set of groupIds that are being loaded
209
- * @param ancestorGroupIdInLoadingGroup - whether the ancestor of the tree has a groupId that is in the loadingGroupIds
210
- * @returns whether or not it or descendant has a groupId that is in the loadingGroupIds
211
- */
212
- private filterTreeByLoadingGroupIds;
213
- private populateBlobContents;
214
- private populateGroupId;
215
- private stripTree;
216
- private readGroupId;
217
- readBlob(blobId: string): Promise<ArrayBufferLike>;
218
- uploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string>;
219
- createBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse>;
220
- downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree>;
221
- private getPreviousFullSnapshot;
222
- }
223
-
224
- /**
225
- * Resolves URLs by providing fake URLs which succeed with the other
226
- * related local classes.
227
- * @alpha
228
- */
229
- export declare class LocalResolver implements IUrlResolver {
230
- private readonly tenantId;
231
- private readonly tokenKey;
232
- constructor();
233
- /**
234
- * Resolves URL requests by providing fake URLs with an actually generated
235
- * token from constant test strings. The root of the URL is fake, but the
236
- * remaining relative URL can still be parsed.
237
- * @param request - request to handle
238
- */
239
- resolve(request: IRequest): Promise<IResolvedUrl>;
240
- getAbsoluteUrl(resolvedUrl: IResolvedUrl, relativeUrl: string): Promise<string>;
241
- createCreateNewRequest(documentId: string): IRequest;
242
- }
243
-
244
- /**
245
- * A database factory for testing that stores data in the browsers session storage
246
- * @internal
247
- */
248
- export declare class LocalSessionStorageDbFactory implements ITestDbFactory {
249
- readonly testDatabase: IDb;
250
- connect(): Promise<IDb>;
251
- }
252
-
253
- export { }
@@ -1,47 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- import { strict as assert } from "assert";
6
- import { DriverHeader } from "@fluidframework/driver-definitions";
7
- import { LocalResolver } from "../localResolver.js";
8
- describe("Local Driver Resolver", () => {
9
- const documentId = "localResolverTest";
10
- let resolver;
11
- describe("CreateNew Flow", () => {
12
- let request;
13
- beforeEach(() => {
14
- resolver = new LocalResolver();
15
- request = resolver.createCreateNewRequest(documentId);
16
- });
17
- it("should successfully create a creatNewRequest", async () => {
18
- assert(!!request.headers?.[DriverHeader.createNew], "Request should contain create new header");
19
- const expectedUrl = `http://localhost:3000/${documentId}`;
20
- assert.equal(request.url, expectedUrl, "The url in createNewRequest should match");
21
- });
22
- it("should successfully resolve a createNewRequest", async () => {
23
- const resolvedUrl = await resolver.resolve(request);
24
- const expectedUrl = `https://localhost:3000/tenantId/${documentId}`;
25
- assert.equal(resolvedUrl.url, expectedUrl, "The resolved url should match");
26
- });
27
- it("should successfully create requestUrl for a data store from resolvedUrl", async () => {
28
- const resolvedUrl = await resolver.resolve(request);
29
- const dataStoreId = "datastore";
30
- const response = await resolver.getAbsoluteUrl(resolvedUrl, dataStoreId);
31
- const expectedUrl = `http://localhost:3000/${documentId}/${dataStoreId}`;
32
- assert.equal(response, expectedUrl, "The requestUrl should match");
33
- });
34
- });
35
- describe("Container Request Resolution", () => {
36
- beforeEach(() => {
37
- resolver = new LocalResolver();
38
- });
39
- it("should successfully resolve request for a container url", async () => {
40
- const url = `http://localhost/${documentId}`;
41
- const resolvedUrl = await resolver.resolve({ url });
42
- const expectedUrl = `https://localhost:3000/tenantId/${documentId}`;
43
- assert.equal(resolvedUrl.url, expectedUrl, "The resolved container url should match");
44
- });
45
- });
46
- });
47
- //# sourceMappingURL=localResolverTest.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"localResolverTest.spec.js","sourceRoot":"","sources":["../../src/test/localResolverTest.spec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAElE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;IACtC,MAAM,UAAU,GAAG,mBAAmB,CAAC;IACvC,IAAI,QAAuB,CAAC;IAE5B,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;QAC/B,IAAI,OAAiB,CAAC;QAEtB,UAAU,CAAC,GAAG,EAAE;YACf,QAAQ,GAAG,IAAI,aAAa,EAAE,CAAC;YAC/B,OAAO,GAAG,QAAQ,CAAC,sBAAsB,CAAC,UAAU,CAAC,CAAC;QACvD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,8CAA8C,EAAE,KAAK,IAAI,EAAE;YAC7D,MAAM,CACL,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,YAAY,CAAC,SAAS,CAAC,EAC3C,0CAA0C,CAC1C,CAAC;YACF,MAAM,WAAW,GAAG,yBAAyB,UAAU,EAAE,CAAC;YAC1D,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,WAAW,EAAE,0CAA0C,CAAC,CAAC;QACpF,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,gDAAgD,EAAE,KAAK,IAAI,EAAE;YAC/D,MAAM,WAAW,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACpD,MAAM,WAAW,GAAG,mCAAmC,UAAU,EAAE,CAAC;YACpE,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE,WAAW,EAAE,+BAA+B,CAAC,CAAC;QAC7E,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,yEAAyE,EAAE,KAAK,IAAI,EAAE;YACxF,MAAM,WAAW,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACpD,MAAM,WAAW,GAAG,WAAW,CAAC;YAChC,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,cAAc,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;YACzE,MAAM,WAAW,GAAG,yBAAyB,UAAU,IAAI,WAAW,EAAE,CAAC;YACzE,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,WAAW,EAAE,6BAA6B,CAAC,CAAC;QACpE,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,8BAA8B,EAAE,GAAG,EAAE;QAC7C,UAAU,CAAC,GAAG,EAAE;YACf,QAAQ,GAAG,IAAI,aAAa,EAAE,CAAC;QAChC,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,yDAAyD,EAAE,KAAK,IAAI,EAAE;YACxE,MAAM,GAAG,GAAG,oBAAoB,UAAU,EAAE,CAAC;YAC7C,MAAM,WAAW,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;YACpD,MAAM,WAAW,GAAG,mCAAmC,UAAU,EAAE,CAAC;YACpE,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE,WAAW,EAAE,yCAAyC,CAAC,CAAC;QACvF,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { strict as assert } from \"assert\";\nimport { DriverHeader } from \"@fluidframework/driver-definitions\";\nimport { IRequest } from \"@fluidframework/core-interfaces\";\nimport { LocalResolver } from \"../localResolver.js\";\n\ndescribe(\"Local Driver Resolver\", () => {\n\tconst documentId = \"localResolverTest\";\n\tlet resolver: LocalResolver;\n\n\tdescribe(\"CreateNew Flow\", () => {\n\t\tlet request: IRequest;\n\n\t\tbeforeEach(() => {\n\t\t\tresolver = new LocalResolver();\n\t\t\trequest = resolver.createCreateNewRequest(documentId);\n\t\t});\n\n\t\tit(\"should successfully create a creatNewRequest\", async () => {\n\t\t\tassert(\n\t\t\t\t!!request.headers?.[DriverHeader.createNew],\n\t\t\t\t\"Request should contain create new header\",\n\t\t\t);\n\t\t\tconst expectedUrl = `http://localhost:3000/${documentId}`;\n\t\t\tassert.equal(request.url, expectedUrl, \"The url in createNewRequest should match\");\n\t\t});\n\n\t\tit(\"should successfully resolve a createNewRequest\", async () => {\n\t\t\tconst resolvedUrl = await resolver.resolve(request);\n\t\t\tconst expectedUrl = `https://localhost:3000/tenantId/${documentId}`;\n\t\t\tassert.equal(resolvedUrl.url, expectedUrl, \"The resolved url should match\");\n\t\t});\n\n\t\tit(\"should successfully create requestUrl for a data store from resolvedUrl\", async () => {\n\t\t\tconst resolvedUrl = await resolver.resolve(request);\n\t\t\tconst dataStoreId = \"datastore\";\n\t\t\tconst response = await resolver.getAbsoluteUrl(resolvedUrl, dataStoreId);\n\t\t\tconst expectedUrl = `http://localhost:3000/${documentId}/${dataStoreId}`;\n\t\t\tassert.equal(response, expectedUrl, \"The requestUrl should match\");\n\t\t});\n\t});\n\n\tdescribe(\"Container Request Resolution\", () => {\n\t\tbeforeEach(() => {\n\t\t\tresolver = new LocalResolver();\n\t\t});\n\n\t\tit(\"should successfully resolve request for a container url\", async () => {\n\t\t\tconst url = `http://localhost/${documentId}`;\n\t\t\tconst resolvedUrl = await resolver.resolve({ url });\n\t\t\tconst expectedUrl = `https://localhost:3000/tenantId/${documentId}`;\n\t\t\tassert.equal(resolvedUrl.url, expectedUrl, \"The resolved container url should match\");\n\t\t});\n\t});\n});\n"]}
@@ -1,26 +0,0 @@
1
- use_current_ClassDeclaration_LocalDeltaStorageService(get_old_ClassDeclaration_LocalDeltaStorageService());
2
- use_old_ClassDeclaration_LocalDeltaStorageService(get_current_ClassDeclaration_LocalDeltaStorageService());
3
- use_current_ClassDeclaration_LocalDocumentDeltaConnection(get_old_ClassDeclaration_LocalDocumentDeltaConnection());
4
- use_old_ClassDeclaration_LocalDocumentDeltaConnection(get_current_ClassDeclaration_LocalDocumentDeltaConnection());
5
- use_current_ClassDeclaration_LocalDocumentService(
6
- // @ts-expect-error compatibility expected to be broken
7
- get_old_ClassDeclaration_LocalDocumentService());
8
- use_old_ClassDeclaration_LocalDocumentService(get_current_ClassDeclaration_LocalDocumentService());
9
- use_current_ClassDeclaration_LocalDocumentServiceFactory(get_old_ClassDeclaration_LocalDocumentServiceFactory());
10
- use_old_ClassDeclaration_LocalDocumentServiceFactory(get_current_ClassDeclaration_LocalDocumentServiceFactory());
11
- use_current_ClassDeclaration_LocalDocumentStorageService(
12
- // @ts-expect-error compatibility expected to be broken
13
- get_old_ClassDeclaration_LocalDocumentStorageService());
14
- use_old_ClassDeclaration_LocalDocumentStorageService(
15
- // @ts-expect-error compatibility expected to be broken
16
- get_current_ClassDeclaration_LocalDocumentStorageService());
17
- use_current_ClassDeclaration_LocalResolver(get_old_ClassDeclaration_LocalResolver());
18
- use_old_ClassDeclaration_LocalResolver(get_current_ClassDeclaration_LocalResolver());
19
- use_current_ClassDeclaration_LocalSessionStorageDbFactory(get_old_ClassDeclaration_LocalSessionStorageDbFactory());
20
- use_old_ClassDeclaration_LocalSessionStorageDbFactory(get_current_ClassDeclaration_LocalSessionStorageDbFactory());
21
- use_current_FunctionDeclaration_createLocalDocumentService(get_old_FunctionDeclaration_createLocalDocumentService());
22
- use_old_FunctionDeclaration_createLocalDocumentService(get_current_FunctionDeclaration_createLocalDocumentService());
23
- use_current_FunctionDeclaration_createLocalResolverCreateNewRequest(get_old_FunctionDeclaration_createLocalResolverCreateNewRequest());
24
- use_old_FunctionDeclaration_createLocalResolverCreateNewRequest(get_current_FunctionDeclaration_createLocalResolverCreateNewRequest());
25
- export {};
26
- //# sourceMappingURL=validateLocalDriverPrevious.generated.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"validateLocalDriverPrevious.generated.js","sourceRoot":"","sources":["../../../src/test/types/validateLocalDriverPrevious.generated.ts"],"names":[],"mappings":"AAgCA,qDAAqD,CACjD,iDAAiD,EAAE,CAAC,CAAC;AAWzD,iDAAiD,CAC7C,qDAAqD,EAAE,CAAC,CAAC;AAW7D,yDAAyD,CACrD,qDAAqD,EAAE,CAAC,CAAC;AAW7D,qDAAqD,CACjD,yDAAyD,EAAE,CAAC,CAAC;AAWjE,iDAAiD;AAC7C,uDAAuD;AACvD,6CAA6C,EAAE,CAAC,CAAC;AAWrD,6CAA6C,CACzC,iDAAiD,EAAE,CAAC,CAAC;AAWzD,wDAAwD,CACpD,oDAAoD,EAAE,CAAC,CAAC;AAW5D,oDAAoD,CAChD,wDAAwD,EAAE,CAAC,CAAC;AAWhE,wDAAwD;AACpD,uDAAuD;AACvD,oDAAoD,EAAE,CAAC,CAAC;AAW5D,oDAAoD;AAChD,uDAAuD;AACvD,wDAAwD,EAAE,CAAC,CAAC;AAWhE,0CAA0C,CACtC,sCAAsC,EAAE,CAAC,CAAC;AAW9C,sCAAsC,CAClC,0CAA0C,EAAE,CAAC,CAAC;AAWlD,yDAAyD,CACrD,qDAAqD,EAAE,CAAC,CAAC;AAW7D,qDAAqD,CACjD,yDAAyD,EAAE,CAAC,CAAC;AAWjE,0DAA0D,CACtD,sDAAsD,EAAE,CAAC,CAAC;AAW9D,sDAAsD,CAClD,0DAA0D,EAAE,CAAC,CAAC;AAWlE,mEAAmE,CAC/D,+DAA+D,EAAE,CAAC,CAAC;AAWvE,+DAA+D,CAC3D,mEAAmE,EAAE,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/*\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.\n * Generated by fluid-type-test-generator in @fluidframework/build-tools.\n */\nimport type * as old from \"@fluidframework/local-driver-previous\";\nimport type * as current from \"../../index.js\";\n\n\n// See 'build-tools/src/type-test-generator/compatibility.ts' for more information.\ntype TypeOnly<T> = T extends number\n\t? number\n\t: T extends string\n\t? string\n\t: T extends boolean | bigint | symbol\n\t? T\n\t: {\n\t\t\t[P in keyof T]: TypeOnly<T[P]>;\n\t };\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_LocalDeltaStorageService\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_LocalDeltaStorageService():\n TypeOnly<old.LocalDeltaStorageService>;\ndeclare function use_current_ClassDeclaration_LocalDeltaStorageService(\n use: TypeOnly<current.LocalDeltaStorageService>): void;\nuse_current_ClassDeclaration_LocalDeltaStorageService(\n get_old_ClassDeclaration_LocalDeltaStorageService());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_LocalDeltaStorageService\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_LocalDeltaStorageService():\n TypeOnly<current.LocalDeltaStorageService>;\ndeclare function use_old_ClassDeclaration_LocalDeltaStorageService(\n use: TypeOnly<old.LocalDeltaStorageService>): void;\nuse_old_ClassDeclaration_LocalDeltaStorageService(\n get_current_ClassDeclaration_LocalDeltaStorageService());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_LocalDocumentDeltaConnection\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_LocalDocumentDeltaConnection():\n TypeOnly<old.LocalDocumentDeltaConnection>;\ndeclare function use_current_ClassDeclaration_LocalDocumentDeltaConnection(\n use: TypeOnly<current.LocalDocumentDeltaConnection>): void;\nuse_current_ClassDeclaration_LocalDocumentDeltaConnection(\n get_old_ClassDeclaration_LocalDocumentDeltaConnection());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_LocalDocumentDeltaConnection\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_LocalDocumentDeltaConnection():\n TypeOnly<current.LocalDocumentDeltaConnection>;\ndeclare function use_old_ClassDeclaration_LocalDocumentDeltaConnection(\n use: TypeOnly<old.LocalDocumentDeltaConnection>): void;\nuse_old_ClassDeclaration_LocalDocumentDeltaConnection(\n get_current_ClassDeclaration_LocalDocumentDeltaConnection());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_LocalDocumentService\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_LocalDocumentService():\n TypeOnly<old.LocalDocumentService>;\ndeclare function use_current_ClassDeclaration_LocalDocumentService(\n use: TypeOnly<current.LocalDocumentService>): void;\nuse_current_ClassDeclaration_LocalDocumentService(\n // @ts-expect-error compatibility expected to be broken\n get_old_ClassDeclaration_LocalDocumentService());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_LocalDocumentService\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_LocalDocumentService():\n TypeOnly<current.LocalDocumentService>;\ndeclare function use_old_ClassDeclaration_LocalDocumentService(\n use: TypeOnly<old.LocalDocumentService>): void;\nuse_old_ClassDeclaration_LocalDocumentService(\n get_current_ClassDeclaration_LocalDocumentService());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_LocalDocumentServiceFactory\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_LocalDocumentServiceFactory():\n TypeOnly<old.LocalDocumentServiceFactory>;\ndeclare function use_current_ClassDeclaration_LocalDocumentServiceFactory(\n use: TypeOnly<current.LocalDocumentServiceFactory>): void;\nuse_current_ClassDeclaration_LocalDocumentServiceFactory(\n get_old_ClassDeclaration_LocalDocumentServiceFactory());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_LocalDocumentServiceFactory\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_LocalDocumentServiceFactory():\n TypeOnly<current.LocalDocumentServiceFactory>;\ndeclare function use_old_ClassDeclaration_LocalDocumentServiceFactory(\n use: TypeOnly<old.LocalDocumentServiceFactory>): void;\nuse_old_ClassDeclaration_LocalDocumentServiceFactory(\n get_current_ClassDeclaration_LocalDocumentServiceFactory());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_LocalDocumentStorageService\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_LocalDocumentStorageService():\n TypeOnly<old.LocalDocumentStorageService>;\ndeclare function use_current_ClassDeclaration_LocalDocumentStorageService(\n use: TypeOnly<current.LocalDocumentStorageService>): void;\nuse_current_ClassDeclaration_LocalDocumentStorageService(\n // @ts-expect-error compatibility expected to be broken\n get_old_ClassDeclaration_LocalDocumentStorageService());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_LocalDocumentStorageService\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_LocalDocumentStorageService():\n TypeOnly<current.LocalDocumentStorageService>;\ndeclare function use_old_ClassDeclaration_LocalDocumentStorageService(\n use: TypeOnly<old.LocalDocumentStorageService>): void;\nuse_old_ClassDeclaration_LocalDocumentStorageService(\n // @ts-expect-error compatibility expected to be broken\n get_current_ClassDeclaration_LocalDocumentStorageService());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_LocalResolver\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_LocalResolver():\n TypeOnly<old.LocalResolver>;\ndeclare function use_current_ClassDeclaration_LocalResolver(\n use: TypeOnly<current.LocalResolver>): void;\nuse_current_ClassDeclaration_LocalResolver(\n get_old_ClassDeclaration_LocalResolver());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_LocalResolver\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_LocalResolver():\n TypeOnly<current.LocalResolver>;\ndeclare function use_old_ClassDeclaration_LocalResolver(\n use: TypeOnly<old.LocalResolver>): void;\nuse_old_ClassDeclaration_LocalResolver(\n get_current_ClassDeclaration_LocalResolver());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_LocalSessionStorageDbFactory\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_LocalSessionStorageDbFactory():\n TypeOnly<old.LocalSessionStorageDbFactory>;\ndeclare function use_current_ClassDeclaration_LocalSessionStorageDbFactory(\n use: TypeOnly<current.LocalSessionStorageDbFactory>): void;\nuse_current_ClassDeclaration_LocalSessionStorageDbFactory(\n get_old_ClassDeclaration_LocalSessionStorageDbFactory());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_LocalSessionStorageDbFactory\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_LocalSessionStorageDbFactory():\n TypeOnly<current.LocalSessionStorageDbFactory>;\ndeclare function use_old_ClassDeclaration_LocalSessionStorageDbFactory(\n use: TypeOnly<old.LocalSessionStorageDbFactory>): void;\nuse_old_ClassDeclaration_LocalSessionStorageDbFactory(\n get_current_ClassDeclaration_LocalSessionStorageDbFactory());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_createLocalDocumentService\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_createLocalDocumentService():\n TypeOnly<typeof old.createLocalDocumentService>;\ndeclare function use_current_FunctionDeclaration_createLocalDocumentService(\n use: TypeOnly<typeof current.createLocalDocumentService>): void;\nuse_current_FunctionDeclaration_createLocalDocumentService(\n get_old_FunctionDeclaration_createLocalDocumentService());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_createLocalDocumentService\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_createLocalDocumentService():\n TypeOnly<typeof current.createLocalDocumentService>;\ndeclare function use_old_FunctionDeclaration_createLocalDocumentService(\n use: TypeOnly<typeof old.createLocalDocumentService>): void;\nuse_old_FunctionDeclaration_createLocalDocumentService(\n get_current_FunctionDeclaration_createLocalDocumentService());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_createLocalResolverCreateNewRequest\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_createLocalResolverCreateNewRequest():\n TypeOnly<typeof old.createLocalResolverCreateNewRequest>;\ndeclare function use_current_FunctionDeclaration_createLocalResolverCreateNewRequest(\n use: TypeOnly<typeof current.createLocalResolverCreateNewRequest>): void;\nuse_current_FunctionDeclaration_createLocalResolverCreateNewRequest(\n get_old_FunctionDeclaration_createLocalResolverCreateNewRequest());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_createLocalResolverCreateNewRequest\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_createLocalResolverCreateNewRequest():\n TypeOnly<typeof current.createLocalResolverCreateNewRequest>;\ndeclare function use_old_FunctionDeclaration_createLocalResolverCreateNewRequest(\n use: TypeOnly<typeof old.createLocalResolverCreateNewRequest>): void;\nuse_old_FunctionDeclaration_createLocalResolverCreateNewRequest(\n get_current_FunctionDeclaration_createLocalResolverCreateNewRequest());\n"]}
File without changes