@fluidframework/routerlicious-driver 2.0.0-rc.4.0.6 → 2.0.0-rc.5.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 (184) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/api-extractor/api-extractor-lint-beta.cjs.json +5 -0
  3. package/api-extractor/api-extractor-lint-beta.esm.json +5 -0
  4. package/api-extractor/api-extractor-lint-bundle.json +5 -0
  5. package/api-extractor/api-extractor-lint-legacy.cjs.json +5 -0
  6. package/api-extractor/api-extractor-lint-legacy.esm.json +5 -0
  7. package/api-extractor/api-extractor-lint-public.cjs.json +5 -0
  8. package/api-extractor/api-extractor-lint-public.esm.json +5 -0
  9. package/api-extractor.json +1 -1
  10. package/api-report/routerlicious-driver.alpha.api.md +36 -0
  11. package/api-report/routerlicious-driver.beta.api.md +30 -0
  12. package/api-report/routerlicious-driver.public.api.md +30 -0
  13. package/biome.jsonc +4 -0
  14. package/dist/contracts.d.ts +1 -1
  15. package/dist/contracts.d.ts.map +1 -1
  16. package/dist/contracts.js.map +1 -1
  17. package/dist/createNewUtils.d.ts +1 -1
  18. package/dist/createNewUtils.d.ts.map +1 -1
  19. package/dist/createNewUtils.js +4 -4
  20. package/dist/createNewUtils.js.map +1 -1
  21. package/dist/definitions.d.ts +1 -1
  22. package/dist/definitions.d.ts.map +1 -1
  23. package/dist/definitions.js.map +1 -1
  24. package/dist/deltaStorageService.d.ts +1 -2
  25. package/dist/deltaStorageService.d.ts.map +1 -1
  26. package/dist/deltaStorageService.js +1 -1
  27. package/dist/deltaStorageService.js.map +1 -1
  28. package/dist/documentDeltaConnection.d.ts +1 -1
  29. package/dist/documentDeltaConnection.d.ts.map +1 -1
  30. package/dist/documentDeltaConnection.js +1 -1
  31. package/dist/documentDeltaConnection.js.map +1 -1
  32. package/dist/documentService.d.ts +10 -8
  33. package/dist/documentService.d.ts.map +1 -1
  34. package/dist/documentService.js +13 -0
  35. package/dist/documentService.js.map +1 -1
  36. package/dist/documentServiceFactory.d.ts +1 -1
  37. package/dist/documentServiceFactory.d.ts.map +1 -1
  38. package/dist/documentServiceFactory.js.map +1 -1
  39. package/dist/documentStorageService.d.ts +1 -2
  40. package/dist/documentStorageService.d.ts.map +1 -1
  41. package/dist/documentStorageService.js.map +1 -1
  42. package/dist/errorUtils.d.ts.map +1 -1
  43. package/dist/errorUtils.js.map +1 -1
  44. package/dist/gitManager.d.ts +6 -6
  45. package/dist/gitManager.d.ts.map +1 -1
  46. package/dist/gitManager.js.map +1 -1
  47. package/dist/historian.d.ts +6 -6
  48. package/dist/historian.d.ts.map +1 -1
  49. package/dist/historian.js.map +1 -1
  50. package/dist/mapWithExpiration.js.map +1 -1
  51. package/dist/nullBlobStorageService.d.ts +7 -7
  52. package/dist/nullBlobStorageService.d.ts.map +1 -1
  53. package/dist/nullBlobStorageService.js.map +1 -1
  54. package/dist/packageVersion.d.ts +1 -1
  55. package/dist/packageVersion.js +1 -1
  56. package/dist/packageVersion.js.map +1 -1
  57. package/dist/r11sSnapshotParser.js.map +1 -1
  58. package/dist/restWrapper.js +6 -2
  59. package/dist/restWrapper.js.map +1 -1
  60. package/dist/restWrapperBase.js.map +1 -1
  61. package/dist/retriableGitManager.d.ts +6 -6
  62. package/dist/retriableGitManager.d.ts.map +1 -1
  63. package/dist/retriableGitManager.js.map +1 -1
  64. package/dist/shreddedSummaryDocumentStorageService.d.ts +2 -2
  65. package/dist/shreddedSummaryDocumentStorageService.d.ts.map +1 -1
  66. package/dist/shreddedSummaryDocumentStorageService.js +9 -9
  67. package/dist/shreddedSummaryDocumentStorageService.js.map +1 -1
  68. package/dist/storageContracts.d.ts +13 -13
  69. package/dist/storageContracts.d.ts.map +1 -1
  70. package/dist/storageContracts.js.map +1 -1
  71. package/dist/summaryTreeUploadManager.d.ts +2 -1
  72. package/dist/summaryTreeUploadManager.d.ts.map +1 -1
  73. package/dist/summaryTreeUploadManager.js +10 -10
  74. package/dist/summaryTreeUploadManager.js.map +1 -1
  75. package/dist/tokens.d.ts +1 -1
  76. package/dist/tokens.d.ts.map +1 -1
  77. package/dist/tokens.js.map +1 -1
  78. package/dist/treeUtils.d.ts +2 -1
  79. package/dist/treeUtils.d.ts.map +1 -1
  80. package/dist/treeUtils.js +5 -5
  81. package/dist/treeUtils.js.map +1 -1
  82. package/dist/wholeSummaryDocumentStorageService.d.ts +2 -2
  83. package/dist/wholeSummaryDocumentStorageService.d.ts.map +1 -1
  84. package/dist/wholeSummaryDocumentStorageService.js.map +1 -1
  85. package/dist/wholeSummaryUploadManager.js.map +1 -1
  86. package/lib/contracts.d.ts +1 -1
  87. package/lib/contracts.d.ts.map +1 -1
  88. package/lib/contracts.js.map +1 -1
  89. package/lib/createNewUtils.d.ts +1 -1
  90. package/lib/createNewUtils.d.ts.map +1 -1
  91. package/lib/createNewUtils.js +1 -1
  92. package/lib/createNewUtils.js.map +1 -1
  93. package/lib/definitions.d.ts +1 -1
  94. package/lib/definitions.d.ts.map +1 -1
  95. package/lib/definitions.js.map +1 -1
  96. package/lib/deltaStorageService.d.ts +1 -2
  97. package/lib/deltaStorageService.d.ts.map +1 -1
  98. package/lib/deltaStorageService.js +2 -2
  99. package/lib/deltaStorageService.js.map +1 -1
  100. package/lib/documentDeltaConnection.d.ts +1 -1
  101. package/lib/documentDeltaConnection.d.ts.map +1 -1
  102. package/lib/documentDeltaConnection.js +1 -1
  103. package/lib/documentDeltaConnection.js.map +1 -1
  104. package/lib/documentService.d.ts +10 -8
  105. package/lib/documentService.d.ts.map +1 -1
  106. package/lib/documentService.js +13 -0
  107. package/lib/documentService.js.map +1 -1
  108. package/lib/documentServiceFactory.d.ts +1 -1
  109. package/lib/documentServiceFactory.d.ts.map +1 -1
  110. package/lib/documentServiceFactory.js.map +1 -1
  111. package/lib/documentStorageService.d.ts +1 -2
  112. package/lib/documentStorageService.d.ts.map +1 -1
  113. package/lib/documentStorageService.js.map +1 -1
  114. package/lib/errorUtils.d.ts.map +1 -1
  115. package/lib/errorUtils.js.map +1 -1
  116. package/lib/gitManager.d.ts +6 -6
  117. package/lib/gitManager.d.ts.map +1 -1
  118. package/lib/gitManager.js.map +1 -1
  119. package/lib/historian.d.ts +6 -6
  120. package/lib/historian.d.ts.map +1 -1
  121. package/lib/historian.js.map +1 -1
  122. package/lib/mapWithExpiration.js.map +1 -1
  123. package/lib/nullBlobStorageService.d.ts +7 -7
  124. package/lib/nullBlobStorageService.d.ts.map +1 -1
  125. package/lib/nullBlobStorageService.js.map +1 -1
  126. package/lib/packageVersion.d.ts +1 -1
  127. package/lib/packageVersion.js +1 -1
  128. package/lib/packageVersion.js.map +1 -1
  129. package/lib/r11sSnapshotParser.js.map +1 -1
  130. package/lib/restWrapper.js +6 -2
  131. package/lib/restWrapper.js.map +1 -1
  132. package/lib/restWrapperBase.js.map +1 -1
  133. package/lib/retriableGitManager.d.ts +6 -6
  134. package/lib/retriableGitManager.d.ts.map +1 -1
  135. package/lib/retriableGitManager.js.map +1 -1
  136. package/lib/shreddedSummaryDocumentStorageService.d.ts +2 -2
  137. package/lib/shreddedSummaryDocumentStorageService.d.ts.map +1 -1
  138. package/lib/shreddedSummaryDocumentStorageService.js +1 -1
  139. package/lib/shreddedSummaryDocumentStorageService.js.map +1 -1
  140. package/lib/storageContracts.d.ts +13 -13
  141. package/lib/storageContracts.d.ts.map +1 -1
  142. package/lib/storageContracts.js.map +1 -1
  143. package/lib/summaryTreeUploadManager.d.ts +2 -1
  144. package/lib/summaryTreeUploadManager.d.ts.map +1 -1
  145. package/lib/summaryTreeUploadManager.js +2 -2
  146. package/lib/summaryTreeUploadManager.js.map +1 -1
  147. package/lib/tokens.d.ts +1 -1
  148. package/lib/tokens.d.ts.map +1 -1
  149. package/lib/tokens.js.map +1 -1
  150. package/lib/treeUtils.d.ts +2 -1
  151. package/lib/treeUtils.d.ts.map +1 -1
  152. package/lib/treeUtils.js +1 -1
  153. package/lib/treeUtils.js.map +1 -1
  154. package/lib/tsdoc-metadata.json +1 -1
  155. package/lib/wholeSummaryDocumentStorageService.d.ts +2 -2
  156. package/lib/wholeSummaryDocumentStorageService.d.ts.map +1 -1
  157. package/lib/wholeSummaryDocumentStorageService.js.map +1 -1
  158. package/lib/wholeSummaryUploadManager.js.map +1 -1
  159. package/package.json +30 -22
  160. package/src/contracts.ts +1 -1
  161. package/src/createNewUtils.ts +1 -1
  162. package/src/definitions.ts +1 -1
  163. package/src/deltaStorageService.ts +11 -7
  164. package/src/documentDeltaConnection.ts +2 -1
  165. package/src/documentService.ts +37 -13
  166. package/src/documentServiceFactory.ts +1 -1
  167. package/src/documentStorageService.ts +4 -3
  168. package/src/errorUtils.ts +1 -5
  169. package/src/gitManager.ts +14 -9
  170. package/src/historian.ts +21 -14
  171. package/src/nullBlobStorageService.ts +9 -6
  172. package/src/packageVersion.ts +1 -1
  173. package/src/r11sSnapshotParser.ts +1 -1
  174. package/src/restWrapper.ts +7 -7
  175. package/src/retriableGitManager.ts +12 -6
  176. package/src/shreddedSummaryDocumentStorageService.ts +5 -8
  177. package/src/storageContracts.ts +23 -13
  178. package/src/summaryTreeUploadManager.ts +5 -9
  179. package/src/tokens.ts +1 -1
  180. package/src/treeUtils.ts +2 -6
  181. package/src/wholeSummaryDocumentStorageService.ts +2 -5
  182. package/tsconfig.json +2 -0
  183. package/tsdoc.json +4 -0
  184. package/api-report/routerlicious-driver.api.md +0 -105
@@ -5,13 +5,22 @@
5
5
 
6
6
  import { TypedEventEmitter } from "@fluid-internal/client-utils";
7
7
  import { assert } from "@fluidframework/core-utils/internal";
8
- import * as api from "@fluidframework/driver-definitions/internal";
8
+ import { IClient } from "@fluidframework/driver-definitions";
9
+ import {
10
+ IDocumentServiceEvents,
11
+ IDocumentServicePolicies,
12
+ IDocumentDeltaConnection,
13
+ IDocumentDeltaStorageService,
14
+ IDocumentService,
15
+ IDocumentStorageService,
16
+ IDocumentStorageServicePolicies,
17
+ IResolvedUrl,
18
+ } from "@fluidframework/driver-definitions/internal";
9
19
  import {
10
20
  NetworkErrorBasic,
11
21
  RateLimiter,
12
22
  canRetryOnError,
13
23
  } from "@fluidframework/driver-utils/internal";
14
- import { IClient } from "@fluidframework/protocol-definitions";
15
24
  import {
16
25
  ITelemetryLoggerExt,
17
26
  PerformanceEvent,
@@ -52,9 +61,9 @@ const RediscoverAfterTimeSinceDiscoveryMs = 5 * 60000; // 5 minute
52
61
  * clients.
53
62
  */
54
63
  export class DocumentService
55
- extends TypedEventEmitter<api.IDocumentServiceEvents>
64
+ extends TypedEventEmitter<IDocumentServiceEvents>
56
65
  // eslint-disable-next-line import/namespace
57
- implements api.IDocumentService
66
+ implements IDocumentService
58
67
  {
59
68
  private lastDiscoveredAt: number = Date.now();
60
69
  private discoverP: Promise<void> | undefined;
@@ -62,12 +71,14 @@ export class DocumentService
62
71
  private storageManager: GitManager | undefined;
63
72
  private noCacheStorageManager: GitManager | undefined;
64
73
 
74
+ private _policies: IDocumentServicePolicies | undefined;
75
+
65
76
  public get resolvedUrl() {
66
77
  return this._resolvedUrl;
67
78
  }
68
79
 
69
80
  constructor(
70
- private _resolvedUrl: api.IResolvedUrl,
81
+ private _resolvedUrl: IResolvedUrl,
71
82
  protected ordererUrl: string,
72
83
  private deltaStorageUrl: string,
73
84
  private deltaStreamUrl: string,
@@ -77,12 +88,12 @@ export class DocumentService
77
88
  protected tenantId: string,
78
89
  protected documentId: string,
79
90
  protected ordererRestWrapper: RouterliciousOrdererRestWrapper,
80
- private readonly documentStorageServicePolicies: api.IDocumentStorageServicePolicies,
91
+ private readonly documentStorageServicePolicies: IDocumentStorageServicePolicies,
81
92
  private readonly driverPolicies: IRouterliciousDriverPolicies,
82
93
  private readonly blobCache: ICache<ArrayBufferLike>,
83
94
  private readonly wholeSnapshotTreeCache: ICache<INormalizedWholeSnapshot>,
84
95
  private readonly shreddedSummaryTreeCache: ICache<ISnapshotTreeVersion>,
85
- private readonly discoverFluidResolvedUrl: () => Promise<api.IResolvedUrl>,
96
+ private readonly discoverFluidResolvedUrl: () => Promise<IResolvedUrl>,
86
97
  private storageRestWrapper: RouterliciousStorageRestWrapper,
87
98
  private readonly storageTokenFetcher: TokenFetcher,
88
99
  private readonly ordererTokenFetcher: TokenFetcher,
@@ -92,6 +103,10 @@ export class DocumentService
92
103
 
93
104
  private documentStorageService: DocumentStorageService | undefined;
94
105
 
106
+ public get policies(): IDocumentServicePolicies | undefined {
107
+ return this._policies;
108
+ }
109
+
95
110
  public dispose() {}
96
111
 
97
112
  /**
@@ -99,7 +114,7 @@ export class DocumentService
99
114
  *
100
115
  * @returns returns the document storage service for routerlicious driver.
101
116
  */
102
- public async connectToStorage(): Promise<api.IDocumentStorageService> {
117
+ public async connectToStorage(): Promise<IDocumentStorageService> {
103
118
  if (this.documentStorageService !== undefined) {
104
119
  return this.documentStorageService;
105
120
  }
@@ -162,7 +177,7 @@ export class DocumentService
162
177
  *
163
178
  * @returns returns the document delta storage service for routerlicious driver.
164
179
  */
165
- public async connectToDeltaStorage(): Promise<api.IDocumentDeltaStorageService> {
180
+ public async connectToDeltaStorage(): Promise<IDocumentDeltaStorageService> {
166
181
  await this.connectToStorage();
167
182
  assert(!!this.documentStorageService, 0x0b1 /* "Storage service not initialized" */);
168
183
 
@@ -171,9 +186,7 @@ export class DocumentService
171
186
 
172
187
  if (shouldUpdateDiscoveredSessionInfo) {
173
188
  await this.refreshDiscovery();
174
- const rateLimiter = new RateLimiter(
175
- this.driverPolicies.maxConcurrentOrdererRequests,
176
- );
189
+ const rateLimiter = new RateLimiter(this.driverPolicies.maxConcurrentOrdererRequests);
177
190
  this.ordererRestWrapper = RouterliciousOrdererRestWrapper.load(
178
191
  this.ordererTokenFetcher,
179
192
  this.logger,
@@ -205,7 +218,7 @@ export class DocumentService
205
218
  *
206
219
  * @returns returns the document delta stream service for routerlicious driver.
207
220
  */
208
- public async connectToDeltaStream(client: IClient): Promise<api.IDocumentDeltaConnection> {
221
+ public async connectToDeltaStream(client: IClient): Promise<IDocumentDeltaConnection> {
209
222
  const connect = async (refreshToken?: boolean) => {
210
223
  let ordererToken = await this.ordererRestWrapper.getToken();
211
224
  if (this.shouldUpdateDiscoveredSessionInfo()) {
@@ -273,6 +286,17 @@ export class DocumentService
273
286
  // Retry with new token on authorization error; otherwise, allow container layer to handle.
274
287
  try {
275
288
  const connection = await connect();
289
+ // Enable single-commit summaries via driver policy based on the enable_single_commit_summary flag which maybe provided by the service during connection.
290
+ // summarizeProtocolTree flag is used by the loader layer to attach protocol tree along with the summary required in the single-commit summaries.
291
+ const shouldSummarizeProtocolTree = (connection as R11sDocumentDeltaConnection).details
292
+ ?.supportedFeatures?.enable_single_commit_summary
293
+ ? true
294
+ : false;
295
+ this._policies = {
296
+ ...this._policies,
297
+ summarizeProtocolTree: shouldSummarizeProtocolTree,
298
+ };
299
+
276
300
  return connection;
277
301
  } catch (error: any) {
278
302
  if (error?.statusCode === 401) {
@@ -6,6 +6,7 @@
6
6
  import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
7
7
  import { assert } from "@fluidframework/core-utils/internal";
8
8
  import { getW3CData } from "@fluidframework/driver-base/internal";
9
+ import { ISummaryTree } from "@fluidframework/driver-definitions";
9
10
  import {
10
11
  FiveDaysMs,
11
12
  IDocumentService,
@@ -20,7 +21,6 @@ import {
20
21
  getQuorumValuesFromProtocolSummary,
21
22
  isCombinedAppAndProtocolSummary,
22
23
  } from "@fluidframework/driver-utils/internal";
23
- import { ISummaryTree } from "@fluidframework/protocol-definitions";
24
24
  import {
25
25
  ISession,
26
26
  convertSummaryTreeToWholeSummaryTree,
@@ -7,12 +7,13 @@ import {
7
7
  IDocumentStorageService,
8
8
  IDocumentStorageServicePolicies,
9
9
  LoaderCachingPolicy,
10
+ ISnapshotTree,
11
+ IVersion,
10
12
  } from "@fluidframework/driver-definitions/internal";
11
13
  import {
12
14
  DocumentStorageServiceProxy,
13
15
  PrefetchDocumentStorageService,
14
16
  } from "@fluidframework/driver-utils/internal";
15
- import { ISnapshotTree, IVersion } from "@fluidframework/protocol-definitions";
16
17
  import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
17
18
 
18
19
  import { ICache } from "./cache.js";
@@ -53,7 +54,7 @@ export class DocumentStorageService extends DocumentStorageServiceProxy {
53
54
  snapshotTreeCache,
54
55
  noCacheGitManager,
55
56
  getStorageManager,
56
- )
57
+ )
57
58
  : new ShreddedSummaryDocumentStorageService(
58
59
  id,
59
60
  manager,
@@ -63,7 +64,7 @@ export class DocumentStorageService extends DocumentStorageServiceProxy {
63
64
  blobCache,
64
65
  shreddedSummaryTreeCache,
65
66
  getStorageManager,
66
- );
67
+ );
67
68
  // TODO: worth prefetching latest summary making version + snapshot call with WholeSummary storage?
68
69
  if (
69
70
  !driverPolicies?.enableWholeSummaryUpload &&
package/src/errorUtils.ts CHANGED
@@ -93,11 +93,7 @@ export function createR11sNetworkError(
93
93
  error = new NonRetryableError(errorMessage, errorType, props);
94
94
  break;
95
95
  case 429:
96
- error = createGenericNetworkError(
97
- errorMessage,
98
- { canRetry: true, retryAfterMs },
99
- props,
100
- );
96
+ error = createGenericNetworkError(errorMessage, { canRetry: true, retryAfterMs }, props);
101
97
  break;
102
98
  case 500:
103
99
  case 502:
package/src/gitManager.ts CHANGED
@@ -3,7 +3,14 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import * as resources from "@fluidframework/gitresources";
6
+ import type {
7
+ IGitBlob,
8
+ IGitCommitDetails,
9
+ IGitCreateBlobParams,
10
+ IGitCreateBlobResponse,
11
+ IGitCreateTreeParams,
12
+ IGitTree,
13
+ } from "@fluidframework/driver-definitions/internal";
7
14
  import {
8
15
  IWholeSummaryPayload,
9
16
  IWriteSummaryResponse,
@@ -22,35 +29,33 @@ export class GitManager implements IGitManager {
22
29
  public async getCommits(
23
30
  sha: string,
24
31
  count: number,
25
- ): Promise<IR11sResponse<resources.ICommitDetails[]>> {
32
+ ): Promise<IR11sResponse<IGitCommitDetails[]>> {
26
33
  return this.historian.getCommits(sha, count);
27
34
  }
28
35
 
29
36
  /**
30
37
  * Reads the object with the given ID. We defer to the client implementation to do the actual read.
31
38
  */
32
- public async getTree(root: string, recursive = true): Promise<IR11sResponse<resources.ITree>> {
39
+ public async getTree(root: string, recursive = true): Promise<IR11sResponse<IGitTree>> {
33
40
  return this.historian.getTree(root, recursive);
34
41
  }
35
42
 
36
- public async getBlob(sha: string): Promise<IR11sResponse<resources.IBlob>> {
43
+ public async getBlob(sha: string): Promise<IR11sResponse<IGitBlob>> {
37
44
  return this.historian.getBlob(sha);
38
45
  }
39
46
 
40
47
  public async createBlob(
41
48
  content: string,
42
49
  encoding: "utf-8" | "base64",
43
- ): Promise<IR11sResponse<resources.ICreateBlobResponse>> {
44
- const blob: resources.ICreateBlobParams = {
50
+ ): Promise<IR11sResponse<IGitCreateBlobResponse>> {
51
+ const blob: IGitCreateBlobParams = {
45
52
  content,
46
53
  encoding,
47
54
  };
48
55
  return this.historian.createBlob(blob);
49
56
  }
50
57
 
51
- public async createGitTree(
52
- params: resources.ICreateTreeParams,
53
- ): Promise<IR11sResponse<resources.ITree>> {
58
+ public async createGitTree(params: IGitCreateTreeParams): Promise<IR11sResponse<IGitTree>> {
54
59
  const treeP = this.historian.createTree(params);
55
60
  return treeP;
56
61
  }
package/src/historian.ts CHANGED
@@ -4,7 +4,14 @@
4
4
  */
5
5
 
6
6
  import { fromUtf8ToBase64 } from "@fluid-internal/client-utils";
7
- import * as git from "@fluidframework/gitresources";
7
+ import type {
8
+ IGitBlob,
9
+ IGitCommitDetails,
10
+ IGitCreateBlobParams,
11
+ IGitCreateBlobResponse,
12
+ IGitCreateTreeParams,
13
+ IGitTree,
14
+ } from "@fluidframework/driver-definitions/internal";
8
15
  import {
9
16
  IWholeSummaryPayload,
10
17
  IWriteSummaryResponse,
@@ -43,17 +50,17 @@ export class Historian implements IHistorian {
43
50
  }
44
51
  }
45
52
 
46
- public async getBlob(sha: string): Promise<IR11sResponse<git.IBlob>> {
47
- return this.restWrapper.get<git.IBlob>(
53
+ public async getBlob(sha: string): Promise<IR11sResponse<IGitBlob>> {
54
+ return this.restWrapper.get<IGitBlob>(
48
55
  `/git/blobs/${encodeURIComponent(sha)}`,
49
56
  this.getQueryString(),
50
57
  );
51
58
  }
52
59
 
53
60
  public async createBlob(
54
- blob: git.ICreateBlobParams,
55
- ): Promise<IR11sResponse<git.ICreateBlobResponse>> {
56
- return this.restWrapper.post<git.ICreateBlobResponse>(
61
+ blob: IGitCreateBlobParams,
62
+ ): Promise<IR11sResponse<IGitCreateBlobResponse>> {
63
+ return this.restWrapper.post<IGitCreateBlobResponse>(
57
64
  `/git/blobs`,
58
65
  blob,
59
66
  this.getQueryString(),
@@ -63,9 +70,9 @@ export class Historian implements IHistorian {
63
70
  public async getCommits(
64
71
  sha: string,
65
72
  count: number,
66
- ): Promise<IR11sResponse<git.ICommitDetails[]>> {
73
+ ): Promise<IR11sResponse<IGitCommitDetails[]>> {
67
74
  return this.restWrapper
68
- .get<git.ICommitDetails[]>(`/commits`, this.getQueryString({ count, sha }))
75
+ .get<IGitCommitDetails[]>(`/commits`, this.getQueryString({ count, sha }))
69
76
  .catch(async (error) =>
70
77
  error.statusCode === 400 || error.statusCode === 404
71
78
  ? {
@@ -73,17 +80,17 @@ export class Historian implements IHistorian {
73
80
  headers: new Map(),
74
81
  propsToLog: {},
75
82
  requestUrl: "",
76
- }
77
- : Promise.reject<IR11sResponse<git.ICommitDetails[]>>(error),
83
+ }
84
+ : Promise.reject<IR11sResponse<IGitCommitDetails[]>>(error),
78
85
  );
79
86
  }
80
87
 
81
- public async createTree(tree: git.ICreateTreeParams): Promise<IR11sResponse<git.ITree>> {
82
- return this.restWrapper.post<git.ITree>(`/git/trees`, tree, this.getQueryString());
88
+ public async createTree(tree: IGitCreateTreeParams): Promise<IR11sResponse<IGitTree>> {
89
+ return this.restWrapper.post<IGitTree>(`/git/trees`, tree, this.getQueryString());
83
90
  }
84
91
 
85
- public async getTree(sha: string, recursive: boolean): Promise<IR11sResponse<git.ITree>> {
86
- return this.restWrapper.get<git.ITree>(
92
+ public async getTree(sha: string, recursive: boolean): Promise<IR11sResponse<IGitTree>> {
93
+ return this.restWrapper.get<IGitTree>(
87
94
  `/git/trees/${encodeURIComponent(sha)}`,
88
95
  this.getQueryString({ recursive: recursive ? 1 : 0 }),
89
96
  );
@@ -3,37 +3,40 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
+ import { ISummaryTree, ISummaryHandle } from "@fluidframework/driver-definitions";
6
7
  import {
7
8
  IDocumentStorageService,
8
9
  ISummaryContext,
10
+ IVersion,
11
+ ISnapshotTree,
12
+ ICreateBlobResponse,
9
13
  } from "@fluidframework/driver-definitions/internal";
10
- import * as api from "@fluidframework/protocol-definitions";
11
14
 
12
15
  /**
13
16
  * Document access to underlying storage. It is default implementation of a storage service.
14
17
  * Does not read/write anything.
15
18
  */
16
19
  export class NullBlobStorageService implements IDocumentStorageService {
17
- public async getSnapshotTree(version?: api.IVersion): Promise<api.ISnapshotTree | null> {
20
+ public async getSnapshotTree(version?: IVersion): Promise<ISnapshotTree | null> {
18
21
  return version ? Promise.reject(new Error("Invalid operation")) : null;
19
22
  }
20
23
 
21
- public async getVersions(versionId: string | null, count: number): Promise<api.IVersion[]> {
24
+ public async getVersions(versionId: string | null, count: number): Promise<IVersion[]> {
22
25
  return [];
23
26
  }
24
27
 
25
28
  public async uploadSummaryWithContext(
26
- summary: api.ISummaryTree,
29
+ summary: ISummaryTree,
27
30
  context: ISummaryContext,
28
31
  ): Promise<string> {
29
32
  throw new Error("Invalid operation");
30
33
  }
31
34
 
32
- public async downloadSummary(handle: api.ISummaryHandle): Promise<api.ISummaryTree> {
35
+ public async downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree> {
33
36
  throw new Error("Invalid operation");
34
37
  }
35
38
 
36
- public async createBlob(file: ArrayBufferLike): Promise<api.ICreateBlobResponse> {
39
+ public async createBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse> {
37
40
  throw new Error("Null blob storage can not create blob");
38
41
  }
39
42
  public async readBlob(blobId: string): Promise<ArrayBufferLike> {
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/routerlicious-driver";
9
- export const pkgVersion = "2.0.0-rc.4.0.6";
9
+ export const pkgVersion = "2.0.0-rc.5.0.0";
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  import { stringToBuffer } from "@fluid-internal/client-utils";
7
- import { ISnapshotTree } from "@fluidframework/protocol-definitions";
7
+ import { ISnapshotTree } from "@fluidframework/driver-definitions/internal";
8
8
 
9
9
  import {
10
10
  INormalizedWholeSnapshot,
@@ -155,12 +155,10 @@ export class RouterliciousRestWrapper extends RestWrapper {
155
155
  const err = errorMessage.includes("failed, reason: self signed certificate")
156
156
  ? new NonRetryableError(errorMessage, RouterliciousErrorTypes.sslCertError, {
157
157
  driverVersion,
158
- })
159
- : new GenericNetworkError(
160
- errorMessage,
161
- errorMessage.startsWith("NetworkError"),
162
- { driverVersion },
163
- );
158
+ })
159
+ : new GenericNetworkError(errorMessage, errorMessage.startsWith("NetworkError"), {
160
+ driverVersion,
161
+ });
164
162
  throw err;
165
163
  });
166
164
  return {
@@ -177,7 +175,9 @@ export class RouterliciousRestWrapper extends RestWrapper {
177
175
 
178
176
  const bodySize = text.length;
179
177
  start = performance.now();
180
- const responseBody: any = response.headers.get("content-type")?.includes("application/json")
178
+ const responseBody: any = response.headers
179
+ .get("content-type")
180
+ ?.includes("application/json")
181
181
  ? JSON.parse(text)
182
182
  : text;
183
183
  const parseTime = performance.now() - start;
@@ -3,8 +3,14 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
+ import type {
7
+ IGitCommitDetails,
8
+ IGitBlob,
9
+ IGitCreateBlobResponse,
10
+ IGitCreateTreeParams,
11
+ IGitTree,
12
+ } from "@fluidframework/driver-definitions/internal";
6
13
  import { runWithRetry } from "@fluidframework/driver-utils/internal";
7
- import type * as git from "@fluidframework/gitresources";
8
14
  import {
9
15
  IWholeSummaryPayload,
10
16
  IWriteSummaryResponse,
@@ -24,21 +30,21 @@ export class RetriableGitManager implements IGitManager {
24
30
  public async getCommits(
25
31
  sha: string,
26
32
  count: number,
27
- ): Promise<IR11sResponse<git.ICommitDetails[]>> {
33
+ ): Promise<IR11sResponse<IGitCommitDetails[]>> {
28
34
  return this.runWithRetry(
29
35
  async () => this.internalGitManager.getCommits(sha, count),
30
36
  "gitManager_getCommits",
31
37
  );
32
38
  }
33
39
 
34
- public async getTree(root: string, recursive: boolean): Promise<IR11sResponse<git.ITree>> {
40
+ public async getTree(root: string, recursive: boolean): Promise<IR11sResponse<IGitTree>> {
35
41
  return this.runWithRetry(
36
42
  async () => this.internalGitManager.getTree(root, recursive),
37
43
  "gitManager_getTree",
38
44
  );
39
45
  }
40
46
 
41
- public async getBlob(sha: string): Promise<IR11sResponse<git.IBlob>> {
47
+ public async getBlob(sha: string): Promise<IR11sResponse<IGitBlob>> {
42
48
  return this.runWithRetry(
43
49
  async () => this.internalGitManager.getBlob(sha),
44
50
  "gitManager_getBlob",
@@ -48,14 +54,14 @@ export class RetriableGitManager implements IGitManager {
48
54
  public async createBlob(
49
55
  content: string,
50
56
  encoding: string,
51
- ): Promise<IR11sResponse<git.ICreateBlobResponse>> {
57
+ ): Promise<IR11sResponse<IGitCreateBlobResponse>> {
52
58
  return this.runWithRetry(
53
59
  async () => this.internalGitManager.createBlob(content, encoding),
54
60
  "gitManager_createBlob",
55
61
  );
56
62
  }
57
63
 
58
- public async createGitTree(params: git.ICreateTreeParams): Promise<IR11sResponse<git.ITree>> {
64
+ public async createGitTree(params: IGitCreateTreeParams): Promise<IR11sResponse<IGitTree>> {
59
65
  return this.runWithRetry(
60
66
  async () => this.internalGitManager.createGitTree(params),
61
67
  "gitManager_createGitTree",
@@ -4,19 +4,16 @@
4
4
  */
5
5
 
6
6
  import { Uint8ArrayToString, stringToBuffer } from "@fluid-internal/client-utils";
7
+ import { ISummaryHandle, ISummaryTree } from "@fluidframework/driver-definitions";
7
8
  import {
8
9
  IDocumentStorageService,
9
10
  IDocumentStorageServicePolicies,
10
11
  ISummaryContext,
11
- } from "@fluidframework/driver-definitions/internal";
12
- import { buildGitTreeHierarchy } from "@fluidframework/protocol-base";
13
- import {
14
12
  ICreateBlobResponse,
15
13
  ISnapshotTreeEx,
16
- ISummaryHandle,
17
- ISummaryTree,
18
14
  IVersion,
19
- } from "@fluidframework/protocol-definitions";
15
+ } from "@fluidframework/driver-definitions/internal";
16
+ import { buildGitTreeHierarchy } from "@fluidframework/driver-utils/internal";
20
17
  import {
21
18
  ITelemetryLoggerExt,
22
19
  MonitoringContext,
@@ -125,7 +122,7 @@ export class ShreddedSummaryDocumentStorageService implements IDocumentStorageSe
125
122
  },
126
123
  async (event) => {
127
124
  const manager = await this.getStorageManager();
128
- const response = (await manager.getTree(requestVersion!.treeId)).content;
125
+ const response = (await manager.getTree(requestVersion.treeId)).content;
129
126
  event.end({
130
127
  size: response.tree.length,
131
128
  });
@@ -226,7 +223,7 @@ export class ShreddedSummaryDocumentStorageService implements IDocumentStorageSe
226
223
  // Clear the cache as the getSnapshotTree call will fill the cache.
227
224
  this.blobsShaCache.clear();
228
225
  return this.getSnapshotTree(versions[0]);
229
- })
226
+ })
230
227
  : undefined;
231
228
  }
232
229
 
@@ -3,8 +3,15 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import * as git from "@fluidframework/gitresources";
7
- import * as api from "@fluidframework/protocol-definitions";
6
+ import { ISummaryTree } from "@fluidframework/driver-definitions";
7
+ import type {
8
+ IGitBlob,
9
+ IGitCommitDetails,
10
+ IGitCreateBlobParams,
11
+ IGitCreateBlobResponse,
12
+ IGitCreateTreeParams,
13
+ IGitTree,
14
+ } from "@fluidframework/driver-definitions/internal";
8
15
  import {
9
16
  IWholeSummaryPayload,
10
17
  IWholeSummaryPayloadType,
@@ -18,11 +25,11 @@ import { IR11sResponse } from "./restWrapper.js";
18
25
  * Interface to a generic Git provider
19
26
  */
20
27
  export interface IHistorian {
21
- getBlob(sha: string): Promise<IR11sResponse<git.IBlob>>;
22
- createBlob(blob: git.ICreateBlobParams): Promise<IR11sResponse<git.ICreateBlobResponse>>;
23
- getCommits(sha: string, count: number): Promise<IR11sResponse<git.ICommitDetails[]>>;
24
- createTree(tree: git.ICreateTreeParams): Promise<IR11sResponse<git.ITree>>;
25
- getTree(sha: string, recursive: boolean): Promise<IR11sResponse<git.ITree>>;
28
+ getBlob(sha: string): Promise<IR11sResponse<IGitBlob>>;
29
+ createBlob(blob: IGitCreateBlobParams): Promise<IR11sResponse<IGitCreateBlobResponse>>;
30
+ getCommits(sha: string, count: number): Promise<IR11sResponse<IGitCommitDetails[]>>;
31
+ createTree(tree: IGitCreateTreeParams): Promise<IR11sResponse<IGitTree>>;
32
+ getTree(sha: string, recursive: boolean): Promise<IR11sResponse<IGitTree>>;
26
33
  createSummary(
27
34
  summary: IWholeSummaryPayload,
28
35
  initial?: boolean,
@@ -31,11 +38,14 @@ export interface IHistorian {
31
38
  }
32
39
 
33
40
  export interface IGitManager {
34
- getCommits(sha: string, count: number): Promise<IR11sResponse<git.ICommitDetails[]>>;
35
- getTree(root: string, recursive: boolean): Promise<IR11sResponse<git.ITree>>;
36
- getBlob(sha: string): Promise<IR11sResponse<git.IBlob>>;
37
- createBlob(content: string, encoding: string): Promise<IR11sResponse<git.ICreateBlobResponse>>;
38
- createGitTree(params: git.ICreateTreeParams): Promise<IR11sResponse<git.ITree>>;
41
+ getCommits(sha: string, count: number): Promise<IR11sResponse<IGitCommitDetails[]>>;
42
+ getTree(root: string, recursive: boolean): Promise<IR11sResponse<IGitTree>>;
43
+ getBlob(sha: string): Promise<IR11sResponse<IGitBlob>>;
44
+ createBlob(
45
+ content: string,
46
+ encoding: string,
47
+ ): Promise<IR11sResponse<IGitCreateBlobResponse>>;
48
+ createGitTree(params: IGitCreateTreeParams): Promise<IR11sResponse<IGitTree>>;
39
49
  createSummary(
40
50
  summary: IWholeSummaryPayload,
41
51
  initial?: boolean,
@@ -56,7 +66,7 @@ export interface ISummaryUploadManager {
56
66
  * @returns Id of created tree as a string.
57
67
  */
58
68
  writeSummaryTree(
59
- summaryTree: api.ISummaryTree,
69
+ summaryTree: ISummaryTree,
60
70
  parentHandle: string,
61
71
  summaryType: IWholeSummaryPayloadType,
62
72
  sequenceNumber?: number,
@@ -5,14 +5,10 @@
5
5
 
6
6
  import { IsoBuffer, Uint8ArrayToString, gitHashFile } from "@fluid-internal/client-utils";
7
7
  import { assert, unreachableCase } from "@fluidframework/core-utils/internal";
8
- import { ICreateTreeEntry } from "@fluidframework/gitresources";
9
- import { getGitMode, getGitType } from "@fluidframework/protocol-base";
10
- import {
11
- ISnapshotTreeEx,
12
- ISummaryTree,
13
- SummaryObject,
14
- SummaryType,
15
- } from "@fluidframework/protocol-definitions";
8
+ import { ISummaryTree, SummaryObject, SummaryType } from "@fluidframework/driver-definitions";
9
+ import type { IGitCreateTreeEntry } from "@fluidframework/driver-definitions/internal";
10
+ import { ISnapshotTreeEx } from "@fluidframework/driver-definitions/internal";
11
+ import { getGitMode, getGitType } from "@fluidframework/driver-utils/internal";
16
12
  import { IWholeSummaryPayloadType } from "@fluidframework/server-services-client";
17
13
 
18
14
  import { IGitManager, ISummaryUploadManager } from "./storageContracts.js";
@@ -48,7 +44,7 @@ export class SummaryTreeUploadManager implements ISummaryUploadManager {
48
44
  Object.keys(summaryTree.tree).map(async (key) => {
49
45
  const entry = summaryTree.tree[key];
50
46
  const pathHandle = await this.writeSummaryTreeObject(entry, previousFullSnapshot);
51
- const treeEntry: ICreateTreeEntry = {
47
+ const treeEntry: IGitCreateTreeEntry = {
52
48
  mode: getGitMode(entry),
53
49
  path: encodeURIComponent(key),
54
50
  sha: pathHandle,
package/src/tokens.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { ITokenClaims } from "@fluidframework/protocol-definitions";
6
+ import { ITokenClaims } from "@fluidframework/driver-definitions/internal";
7
7
 
8
8
  /**
9
9
  * Abstracts the discovery of claims contained within a token.
package/src/treeUtils.ts CHANGED
@@ -5,12 +5,8 @@
5
5
 
6
6
  import { IsoBuffer } from "@fluid-internal/client-utils";
7
7
  import { assert } from "@fluidframework/core-utils/internal";
8
- import {
9
- ISnapshotTree,
10
- ISummaryTree,
11
- SummaryObject,
12
- SummaryType,
13
- } from "@fluidframework/protocol-definitions";
8
+ import { ISummaryTree, SummaryObject, SummaryType } from "@fluidframework/driver-definitions";
9
+ import { ISnapshotTree } from "@fluidframework/driver-definitions/internal";
14
10
 
15
11
  import { INormalizedWholeSnapshot } from "./contracts.js";
16
12
 
@@ -6,18 +6,15 @@
6
6
  import { Uint8ArrayToString, performance, stringToBuffer } from "@fluid-internal/client-utils";
7
7
  import { assert } from "@fluidframework/core-utils/internal";
8
8
  import { getW3CData, promiseRaceWithWinner } from "@fluidframework/driver-base/internal";
9
+ import { ISummaryHandle, ISummaryTree } from "@fluidframework/driver-definitions";
9
10
  import {
10
11
  IDocumentStorageService,
11
12
  IDocumentStorageServicePolicies,
12
13
  ISummaryContext,
13
- } from "@fluidframework/driver-definitions/internal";
14
- import {
15
14
  ICreateBlobResponse,
16
15
  ISnapshotTree,
17
- ISummaryHandle,
18
- ISummaryTree,
19
16
  IVersion,
20
- } from "@fluidframework/protocol-definitions";
17
+ } from "@fluidframework/driver-definitions/internal";
21
18
  import {
22
19
  ITelemetryLoggerExt,
23
20
  MonitoringContext,