@fluidframework/routerlicious-driver 2.90.0 → 2.92.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 (242) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/cache.js +1 -1
  3. package/dist/cache.js.map +1 -1
  4. package/dist/contracts.d.ts +1 -1
  5. package/dist/contracts.d.ts.map +1 -1
  6. package/dist/contracts.js.map +1 -1
  7. package/dist/createNewUtils.d.ts +1 -1
  8. package/dist/createNewUtils.d.ts.map +1 -1
  9. package/dist/createNewUtils.js.map +1 -1
  10. package/dist/defaultTokenProvider.d.ts +1 -1
  11. package/dist/defaultTokenProvider.d.ts.map +1 -1
  12. package/dist/defaultTokenProvider.js.map +1 -1
  13. package/dist/definitions.d.ts +1 -1
  14. package/dist/definitions.d.ts.map +1 -1
  15. package/dist/definitions.js.map +1 -1
  16. package/dist/deltaStorageService.d.ts +4 -4
  17. package/dist/deltaStorageService.d.ts.map +1 -1
  18. package/dist/deltaStorageService.js +1 -1
  19. package/dist/deltaStorageService.js.map +1 -1
  20. package/dist/documentDeltaConnection.d.ts +4 -4
  21. package/dist/documentDeltaConnection.d.ts.map +1 -1
  22. package/dist/documentDeltaConnection.js.map +1 -1
  23. package/dist/documentService.d.ts +10 -9
  24. package/dist/documentService.d.ts.map +1 -1
  25. package/dist/documentService.js.map +1 -1
  26. package/dist/documentServiceFactory.d.ts +6 -6
  27. package/dist/documentServiceFactory.d.ts.map +1 -1
  28. package/dist/documentServiceFactory.js.map +1 -1
  29. package/dist/documentStorageService.d.ts +7 -7
  30. package/dist/documentStorageService.d.ts.map +1 -1
  31. package/dist/documentStorageService.js.map +1 -1
  32. package/dist/errorUtils.d.ts +3 -2
  33. package/dist/errorUtils.d.ts.map +1 -1
  34. package/dist/errorUtils.js +13 -7
  35. package/dist/errorUtils.js.map +1 -1
  36. package/dist/gitManager.d.ts +4 -4
  37. package/dist/gitManager.d.ts.map +1 -1
  38. package/dist/gitManager.js.map +1 -1
  39. package/dist/historian.d.ts +5 -5
  40. package/dist/historian.d.ts.map +1 -1
  41. package/dist/historian.js +1 -1
  42. package/dist/historian.js.map +1 -1
  43. package/dist/index.d.ts +2 -2
  44. package/dist/index.d.ts.map +1 -1
  45. package/dist/index.js.map +1 -1
  46. package/dist/legacy.d.ts +1 -1
  47. package/dist/mapWithExpiration.js +2 -2
  48. package/dist/mapWithExpiration.js.map +1 -1
  49. package/dist/nullBlobStorageService.d.ts +2 -2
  50. package/dist/nullBlobStorageService.d.ts.map +1 -1
  51. package/dist/nullBlobStorageService.js.map +1 -1
  52. package/dist/packageVersion.d.ts +1 -1
  53. package/dist/packageVersion.js +1 -1
  54. package/dist/packageVersion.js.map +1 -1
  55. package/dist/public.d.ts +1 -1
  56. package/dist/r11sSnapshotParser.d.ts +1 -1
  57. package/dist/r11sSnapshotParser.d.ts.map +1 -1
  58. package/dist/r11sSnapshotParser.js +2 -2
  59. package/dist/r11sSnapshotParser.js.map +1 -1
  60. package/dist/restWrapper.d.ts +4 -4
  61. package/dist/restWrapper.d.ts.map +1 -1
  62. package/dist/restWrapper.js +10 -11
  63. package/dist/restWrapper.js.map +1 -1
  64. package/dist/restWrapperBase.d.ts +1 -1
  65. package/dist/restWrapperBase.d.ts.map +1 -1
  66. package/dist/restWrapperBase.js.map +1 -1
  67. package/dist/retriableGitManager.d.ts +5 -5
  68. package/dist/retriableGitManager.d.ts.map +1 -1
  69. package/dist/retriableGitManager.js.map +1 -1
  70. package/dist/sessionInfoManager.d.ts +4 -4
  71. package/dist/sessionInfoManager.d.ts.map +1 -1
  72. package/dist/sessionInfoManager.js.map +1 -1
  73. package/dist/shreddedSummaryDocumentStorageService.d.ts +7 -7
  74. package/dist/shreddedSummaryDocumentStorageService.d.ts.map +1 -1
  75. package/dist/shreddedSummaryDocumentStorageService.js.map +1 -1
  76. package/dist/socketModule.js +1 -1
  77. package/dist/socketModule.js.map +1 -1
  78. package/dist/storageContracts.d.ts +4 -4
  79. package/dist/storageContracts.d.ts.map +1 -1
  80. package/dist/storageContracts.js.map +1 -1
  81. package/dist/summaryTreeUploadManager.d.ts +4 -4
  82. package/dist/summaryTreeUploadManager.d.ts.map +1 -1
  83. package/dist/summaryTreeUploadManager.js +6 -4
  84. package/dist/summaryTreeUploadManager.js.map +1 -1
  85. package/dist/tokens.d.ts +1 -1
  86. package/dist/tokens.d.ts.map +1 -1
  87. package/dist/tokens.js.map +1 -1
  88. package/dist/treeUtils.d.ts +4 -3
  89. package/dist/treeUtils.d.ts.map +1 -1
  90. package/dist/treeUtils.js.map +1 -1
  91. package/dist/urlUtils.d.ts +2 -2
  92. package/dist/urlUtils.d.ts.map +1 -1
  93. package/dist/urlUtils.js +1 -1
  94. package/dist/urlUtils.js.map +1 -1
  95. package/dist/wholeSummaryDocumentStorageService.d.ts +7 -7
  96. package/dist/wholeSummaryDocumentStorageService.d.ts.map +1 -1
  97. package/dist/wholeSummaryDocumentStorageService.js +5 -5
  98. package/dist/wholeSummaryDocumentStorageService.js.map +1 -1
  99. package/dist/wholeSummaryUploadManager.d.ts +2 -2
  100. package/dist/wholeSummaryUploadManager.d.ts.map +1 -1
  101. package/dist/wholeSummaryUploadManager.js.map +1 -1
  102. package/eslint.config.mts +18 -5
  103. package/internal.d.ts +1 -1
  104. package/legacy.d.ts +1 -1
  105. package/lib/cache.js +1 -1
  106. package/lib/cache.js.map +1 -1
  107. package/lib/contracts.d.ts +1 -1
  108. package/lib/contracts.d.ts.map +1 -1
  109. package/lib/contracts.js.map +1 -1
  110. package/lib/createNewUtils.d.ts +1 -1
  111. package/lib/createNewUtils.d.ts.map +1 -1
  112. package/lib/createNewUtils.js.map +1 -1
  113. package/lib/defaultTokenProvider.d.ts +1 -1
  114. package/lib/defaultTokenProvider.d.ts.map +1 -1
  115. package/lib/defaultTokenProvider.js.map +1 -1
  116. package/lib/definitions.d.ts +1 -1
  117. package/lib/definitions.d.ts.map +1 -1
  118. package/lib/definitions.js.map +1 -1
  119. package/lib/deltaStorageService.d.ts +4 -4
  120. package/lib/deltaStorageService.d.ts.map +1 -1
  121. package/lib/deltaStorageService.js +2 -2
  122. package/lib/deltaStorageService.js.map +1 -1
  123. package/lib/documentDeltaConnection.d.ts +4 -4
  124. package/lib/documentDeltaConnection.d.ts.map +1 -1
  125. package/lib/documentDeltaConnection.js +1 -1
  126. package/lib/documentDeltaConnection.js.map +1 -1
  127. package/lib/documentService.d.ts +10 -9
  128. package/lib/documentService.d.ts.map +1 -1
  129. package/lib/documentService.js +1 -1
  130. package/lib/documentService.js.map +1 -1
  131. package/lib/documentServiceFactory.d.ts +6 -6
  132. package/lib/documentServiceFactory.d.ts.map +1 -1
  133. package/lib/documentServiceFactory.js +2 -2
  134. package/lib/documentServiceFactory.js.map +1 -1
  135. package/lib/documentStorageService.d.ts +7 -7
  136. package/lib/documentStorageService.d.ts.map +1 -1
  137. package/lib/documentStorageService.js +1 -1
  138. package/lib/documentStorageService.js.map +1 -1
  139. package/lib/errorUtils.d.ts +3 -2
  140. package/lib/errorUtils.d.ts.map +1 -1
  141. package/lib/errorUtils.js +14 -8
  142. package/lib/errorUtils.js.map +1 -1
  143. package/lib/gitManager.d.ts +4 -4
  144. package/lib/gitManager.d.ts.map +1 -1
  145. package/lib/gitManager.js.map +1 -1
  146. package/lib/historian.d.ts +5 -5
  147. package/lib/historian.d.ts.map +1 -1
  148. package/lib/historian.js +1 -1
  149. package/lib/historian.js.map +1 -1
  150. package/lib/index.d.ts +2 -2
  151. package/lib/index.d.ts.map +1 -1
  152. package/lib/index.js.map +1 -1
  153. package/lib/legacy.d.ts +1 -1
  154. package/lib/mapWithExpiration.js +2 -2
  155. package/lib/mapWithExpiration.js.map +1 -1
  156. package/lib/nullBlobStorageService.d.ts +2 -2
  157. package/lib/nullBlobStorageService.d.ts.map +1 -1
  158. package/lib/nullBlobStorageService.js.map +1 -1
  159. package/lib/packageVersion.d.ts +1 -1
  160. package/lib/packageVersion.js +1 -1
  161. package/lib/packageVersion.js.map +1 -1
  162. package/lib/public.d.ts +1 -1
  163. package/lib/r11sSnapshotParser.d.ts +1 -1
  164. package/lib/r11sSnapshotParser.d.ts.map +1 -1
  165. package/lib/r11sSnapshotParser.js +2 -2
  166. package/lib/r11sSnapshotParser.js.map +1 -1
  167. package/lib/restWrapper.d.ts +4 -4
  168. package/lib/restWrapper.d.ts.map +1 -1
  169. package/lib/restWrapper.js +11 -12
  170. package/lib/restWrapper.js.map +1 -1
  171. package/lib/restWrapperBase.d.ts +1 -1
  172. package/lib/restWrapperBase.d.ts.map +1 -1
  173. package/lib/restWrapperBase.js.map +1 -1
  174. package/lib/retriableGitManager.d.ts +5 -5
  175. package/lib/retriableGitManager.d.ts.map +1 -1
  176. package/lib/retriableGitManager.js.map +1 -1
  177. package/lib/sessionInfoManager.d.ts +4 -4
  178. package/lib/sessionInfoManager.d.ts.map +1 -1
  179. package/lib/sessionInfoManager.js +1 -1
  180. package/lib/sessionInfoManager.js.map +1 -1
  181. package/lib/shreddedSummaryDocumentStorageService.d.ts +7 -7
  182. package/lib/shreddedSummaryDocumentStorageService.d.ts.map +1 -1
  183. package/lib/shreddedSummaryDocumentStorageService.js.map +1 -1
  184. package/lib/socketModule.js +1 -1
  185. package/lib/socketModule.js.map +1 -1
  186. package/lib/storageContracts.d.ts +4 -4
  187. package/lib/storageContracts.d.ts.map +1 -1
  188. package/lib/storageContracts.js.map +1 -1
  189. package/lib/summaryTreeUploadManager.d.ts +4 -4
  190. package/lib/summaryTreeUploadManager.d.ts.map +1 -1
  191. package/lib/summaryTreeUploadManager.js +6 -4
  192. package/lib/summaryTreeUploadManager.js.map +1 -1
  193. package/lib/tokens.d.ts +1 -1
  194. package/lib/tokens.d.ts.map +1 -1
  195. package/lib/tokens.js.map +1 -1
  196. package/lib/treeUtils.d.ts +4 -3
  197. package/lib/treeUtils.d.ts.map +1 -1
  198. package/lib/treeUtils.js.map +1 -1
  199. package/lib/urlUtils.d.ts +2 -2
  200. package/lib/urlUtils.d.ts.map +1 -1
  201. package/lib/urlUtils.js +1 -1
  202. package/lib/urlUtils.js.map +1 -1
  203. package/lib/wholeSummaryDocumentStorageService.d.ts +7 -7
  204. package/lib/wholeSummaryDocumentStorageService.d.ts.map +1 -1
  205. package/lib/wholeSummaryDocumentStorageService.js +5 -5
  206. package/lib/wholeSummaryDocumentStorageService.js.map +1 -1
  207. package/lib/wholeSummaryUploadManager.d.ts +2 -2
  208. package/lib/wholeSummaryUploadManager.d.ts.map +1 -1
  209. package/lib/wholeSummaryUploadManager.js +1 -1
  210. package/lib/wholeSummaryUploadManager.js.map +1 -1
  211. package/package.json +16 -19
  212. package/src/cache.ts +1 -1
  213. package/src/contracts.ts +1 -1
  214. package/src/createNewUtils.ts +2 -1
  215. package/src/defaultTokenProvider.ts +1 -1
  216. package/src/definitions.ts +1 -1
  217. package/src/deltaStorageService.ts +7 -9
  218. package/src/documentDeltaConnection.ts +6 -10
  219. package/src/documentService.ts +11 -14
  220. package/src/documentServiceFactory.ts +12 -13
  221. package/src/documentStorageService.ts +8 -8
  222. package/src/errorUtils.ts +17 -10
  223. package/src/gitManager.ts +4 -4
  224. package/src/historian.ts +6 -6
  225. package/src/index.ts +2 -2
  226. package/src/mapWithExpiration.ts +2 -2
  227. package/src/nullBlobStorageService.ts +2 -2
  228. package/src/packageVersion.ts +1 -1
  229. package/src/r11sSnapshotParser.ts +4 -4
  230. package/src/restWrapper.ts +15 -22
  231. package/src/restWrapperBase.ts +1 -1
  232. package/src/retriableGitManager.ts +5 -5
  233. package/src/sessionInfoManager.ts +6 -8
  234. package/src/shreddedSummaryDocumentStorageService.ts +11 -8
  235. package/src/socketModule.ts +1 -1
  236. package/src/storageContracts.ts +4 -4
  237. package/src/summaryTreeUploadManager.ts +14 -9
  238. package/src/tokens.ts +1 -1
  239. package/src/treeUtils.ts +4 -3
  240. package/src/urlUtils.ts +3 -3
  241. package/src/wholeSummaryDocumentStorageService.ts +17 -14
  242. package/src/wholeSummaryUploadManager.ts +3 -3
@@ -4,24 +4,20 @@
4
4
  */
5
5
 
6
6
  import { DocumentDeltaConnection } from "@fluidframework/driver-base/internal";
7
- import { IClient } from "@fluidframework/driver-definitions";
8
- import {
7
+ import type { IClient } from "@fluidframework/driver-definitions";
8
+ import type {
9
9
  IDocumentDeltaConnection,
10
10
  IAnyDriverError,
11
11
  IConnect,
12
12
  } from "@fluidframework/driver-definitions/internal";
13
13
  import type { DriverErrorTelemetryProps } from "@fluidframework/driver-utils/internal";
14
- import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
14
+ import type { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
15
15
  import type { Socket } from "socket.io-client";
16
16
 
17
- import {
18
- IR11sSocketError,
19
- errorObjectFromSocketError,
20
- getUrlForTelemetry,
21
- socketIoPath,
22
- } from "./errorUtils.js";
17
+ import type { IR11sSocketError } from "./errorUtils.js";
18
+ import { errorObjectFromSocketError, getUrlForTelemetry, socketIoPath } from "./errorUtils.js";
23
19
  import { pkgVersion as driverVersion } from "./packageVersion.js";
24
- import { SocketIOClientStatic } from "./socketModule.js";
20
+ import type { SocketIOClientStatic } from "./socketModule.js";
25
21
 
26
22
  const protocolVersions = ["^0.4.0", "^0.3.0", "^0.2.0", "^0.1.0"];
27
23
 
@@ -5,8 +5,8 @@
5
5
 
6
6
  import { TypedEventEmitter } from "@fluid-internal/client-utils";
7
7
  import { assert } from "@fluidframework/core-utils/internal";
8
- import { IClient } from "@fluidframework/driver-definitions";
9
- import {
8
+ import type { IClient } from "@fluidframework/driver-definitions";
9
+ import type {
10
10
  IDocumentServiceEvents,
11
11
  IDocumentServicePolicies,
12
12
  IDocumentDeltaConnection,
@@ -21,15 +21,12 @@ import {
21
21
  RateLimiter,
22
22
  canRetryOnError,
23
23
  } from "@fluidframework/driver-utils/internal";
24
- import {
25
- ITelemetryLoggerExt,
26
- PerformanceEvent,
27
- wrapError,
28
- } from "@fluidframework/telemetry-utils/internal";
24
+ import type { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
25
+ import { PerformanceEvent, wrapError } from "@fluidframework/telemetry-utils/internal";
29
26
 
30
- import { ICache } from "./cache.js";
31
- import { INormalizedWholeSnapshot } from "./contracts.js";
32
- import { ISnapshotTreeVersion } from "./definitions.js";
27
+ import type { ICache } from "./cache.js";
28
+ import type { INormalizedWholeSnapshot } from "./contracts.js";
29
+ import type { ISnapshotTreeVersion } from "./definitions.js";
33
30
  import { DeltaStorageService, DocumentDeltaStorageService } from "./deltaStorageService.js";
34
31
  import { R11sDocumentDeltaConnection } from "./documentDeltaConnection.js";
35
32
  import { DocumentStorageService } from "./documentStorageService.js";
@@ -38,16 +35,16 @@ import { GitManager } from "./gitManager.js";
38
35
  import { Historian } from "./historian.js";
39
36
  import { NullBlobStorageService } from "./nullBlobStorageService.js";
40
37
  import { pkgVersion as driverVersion } from "./packageVersion.js";
41
- import { IRouterliciousDriverPolicies } from "./policies.js";
38
+ import type { IRouterliciousDriverPolicies } from "./policies.js";
39
+ import type { TokenFetcher } from "./restWrapper.js";
42
40
  import {
43
41
  RouterliciousOrdererRestWrapper,
44
42
  RouterliciousStorageRestWrapper,
45
- TokenFetcher,
46
43
  } from "./restWrapper.js";
47
- import { RestWrapper } from "./restWrapperBase.js";
44
+ import type { RestWrapper } from "./restWrapperBase.js";
48
45
  import type { IGetSessionInfoResponse } from "./sessionInfoManager.js";
49
46
  import { SocketIOClientStatic } from "./socketModule.js";
50
- import { ITokenProvider } from "./tokens.js";
47
+ import type { ITokenProvider } from "./tokens.js";
51
48
 
52
49
  /**
53
50
  * The DocumentService manages the Socket.IO connection and manages routing requests to connected
@@ -7,35 +7,34 @@ import type {
7
7
  ILayerCompatDetails,
8
8
  IProvideLayerCompatDetails,
9
9
  } from "@fluid-internal/client-utils";
10
- import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
10
+ import type { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
11
11
  import { assert } from "@fluidframework/core-utils/internal";
12
- import { ISummaryTree } from "@fluidframework/driver-definitions";
13
- import {
12
+ import type { ISummaryTree } from "@fluidframework/driver-definitions";
13
+ import type {
14
14
  FiveDaysMs,
15
15
  IDocumentService,
16
16
  IDocumentServiceFactory,
17
17
  IDocumentStorageServicePolicies,
18
18
  IResolvedUrl,
19
- LoaderCachingPolicy,
20
19
  } from "@fluidframework/driver-definitions/internal";
20
+ import { LoaderCachingPolicy } from "@fluidframework/driver-definitions/internal";
21
21
  import {
22
22
  RateLimiter,
23
23
  getDocAttributesFromProtocolSummary,
24
24
  getQuorumValuesFromProtocolSummary,
25
25
  isCombinedAppAndProtocolSummary,
26
26
  } from "@fluidframework/driver-utils/internal";
27
- import {
28
- ISession,
29
- convertSummaryTreeToWholeSummaryTree,
30
- } from "@fluidframework/server-services-client";
27
+ import type { ISession } from "@fluidframework/server-services-client";
28
+ import { convertSummaryTreeToWholeSummaryTree } from "@fluidframework/server-services-client";
31
29
  import { PerformanceEvent, createChildLogger } from "@fluidframework/telemetry-utils/internal";
32
30
 
33
- import { ICache, InMemoryCache, NullCache } from "./cache.js";
34
- import { INormalizedWholeSnapshot } from "./contracts.js";
35
- import { ISnapshotTreeVersion } from "./definitions.js";
31
+ import type { ICache } from "./cache.js";
32
+ import { InMemoryCache, NullCache } from "./cache.js";
33
+ import type { INormalizedWholeSnapshot } from "./contracts.js";
34
+ import type { ISnapshotTreeVersion } from "./definitions.js";
36
35
  import { DocumentService } from "./documentService.js";
37
36
  import { pkgVersion as driverVersion } from "./packageVersion.js";
38
- import { IRouterliciousDriverPolicies } from "./policies.js";
37
+ import type { IRouterliciousDriverPolicies } from "./policies.js";
39
38
  import { r11sDriverCompatDetailsForLoader } from "./r11sLayerCompatState.js";
40
39
  import {
41
40
  RouterliciousOrdererRestWrapper,
@@ -45,7 +44,7 @@ import {
45
44
  } from "./restWrapper.js";
46
45
  import { isRouterliciousResolvedUrl } from "./routerliciousResolvedUrl.js";
47
46
  import { SessionInfoManager } from "./sessionInfoManager.js";
48
- import { ITokenProvider } from "./tokens.js";
47
+ import type { ITokenProvider } from "./tokens.js";
49
48
  import { replaceDocumentIdInPath } from "./urlUtils.js";
50
49
 
51
50
  const maximumSnapshotCacheDurationMs: FiveDaysMs = 432_000_000; // 5 days in ms
@@ -3,24 +3,24 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import {
6
+ import type {
7
7
  IDocumentStorageService,
8
8
  IDocumentStorageServicePolicies,
9
- LoaderCachingPolicy,
10
9
  ISnapshotTree,
11
10
  IVersion,
12
11
  } from "@fluidframework/driver-definitions/internal";
12
+ import { LoaderCachingPolicy } from "@fluidframework/driver-definitions/internal";
13
13
  import {
14
14
  DocumentStorageServiceProxy,
15
15
  PrefetchDocumentStorageService,
16
16
  } from "@fluidframework/driver-utils/internal";
17
- import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
17
+ import type { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
18
18
 
19
- import { ICache } from "./cache.js";
20
- import { INormalizedWholeSnapshot } from "./contracts.js";
21
- import { ISnapshotTreeVersion } from "./definitions.js";
22
- import { GitManager } from "./gitManager.js";
23
- import { IRouterliciousDriverPolicies } from "./policies.js";
19
+ import type { ICache } from "./cache.js";
20
+ import type { INormalizedWholeSnapshot } from "./contracts.js";
21
+ import type { ISnapshotTreeVersion } from "./definitions.js";
22
+ import type { GitManager } from "./gitManager.js";
23
+ import type { IRouterliciousDriverPolicies } from "./policies.js";
24
24
  import { ShreddedSummaryDocumentStorageService } from "./shreddedSummaryDocumentStorageService.js";
25
25
  import { WholeSummaryDocumentStorageService } from "./wholeSummaryDocumentStorageService.js";
26
26
 
package/src/errorUtils.ts CHANGED
@@ -3,11 +3,11 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import {
6
+ import type {
7
7
  DriverError,
8
- DriverErrorTypes,
9
8
  IDriverErrorBase,
10
9
  } from "@fluidframework/driver-definitions/internal";
10
+ import { DriverErrorTypes } from "@fluidframework/driver-definitions/internal";
11
11
  import {
12
12
  AuthorizationError,
13
13
  GenericNetworkError,
@@ -15,7 +15,8 @@ import {
15
15
  createGenericNetworkError,
16
16
  type DriverErrorTelemetryProps,
17
17
  } from "@fluidframework/driver-utils/internal";
18
- import { IFluidErrorBase, LoggingError } from "@fluidframework/telemetry-utils/internal";
18
+ import type { IFluidErrorBase } from "@fluidframework/telemetry-utils/internal";
19
+ import { LoggingError } from "@fluidframework/telemetry-utils/internal";
19
20
 
20
21
  import { R11sServiceClusterDrainingErrorCode } from "./contracts.js";
21
22
  import { pkgVersion as driverVersion } from "./packageVersion.js";
@@ -113,33 +114,39 @@ export function createR11sNetworkError(
113
114
  case 401:
114
115
  // The first 401 is manually retried in RouterliciousRestWrapper with a refreshed token,
115
116
  // so we treat repeat 401s the same as 403.
116
- case 403:
117
+ case 403: {
117
118
  error = new AuthorizationError(errorMessage, undefined, undefined, props);
118
119
  break;
119
- case 404:
120
+ }
121
+ case 404: {
120
122
  const errorType = RouterliciousErrorTypes.fileNotFoundOrAccessDeniedError;
121
123
  error = new NonRetryableError(errorMessage, errorType, props);
122
124
  break;
123
- case 429:
125
+ }
126
+ case 429: {
124
127
  error = createGenericNetworkError(errorMessage, { canRetry: true, retryAfterMs }, props);
125
128
  break;
129
+ }
126
130
  case 500:
127
- case 502:
131
+ case 502: {
128
132
  error = new GenericNetworkError(errorMessage, true, props);
129
133
  break;
130
- case 503:
134
+ }
135
+ case 503: {
131
136
  if (internalErrorCode === R11sServiceClusterDrainingErrorCode) {
132
137
  error = new ClusterDrainingError(
133
138
  errorMessage,
134
- retryAfterMs !== undefined ? retryAfterMs / 1000 : 660,
139
+ retryAfterMs === undefined ? 660 : retryAfterMs / 1000,
135
140
  props,
136
141
  );
137
142
  break;
138
143
  }
139
- default:
144
+ }
145
+ default: {
140
146
  const retryInfo = { canRetry: retryAfterMs !== undefined, retryAfterMs };
141
147
  error = createGenericNetworkError(errorMessage, retryInfo, props);
142
148
  break;
149
+ }
143
150
  }
144
151
  error.addTelemetryProperties({ endpointReached: true });
145
152
  return error;
package/src/gitManager.ts CHANGED
@@ -11,14 +11,14 @@ import type {
11
11
  IGitCreateTreeParams,
12
12
  IGitTree,
13
13
  } from "@fluidframework/driver-definitions/internal";
14
- import {
14
+ import type {
15
15
  IWholeSummaryPayload,
16
16
  IWriteSummaryResponse,
17
17
  } from "@fluidframework/server-services-client";
18
18
 
19
- import { IWholeFlatSnapshot } from "./contracts.js";
20
- import { IR11sResponse } from "./restWrapper.js";
21
- import { IGitManager, IHistorian } from "./storageContracts.js";
19
+ import type { IWholeFlatSnapshot } from "./contracts.js";
20
+ import type { IR11sResponse } from "./restWrapper.js";
21
+ import type { IGitManager, IHistorian } from "./storageContracts.js";
22
22
 
23
23
  export class GitManager implements IGitManager {
24
24
  constructor(private readonly historian: IHistorian) {}
package/src/historian.ts CHANGED
@@ -12,16 +12,16 @@ import type {
12
12
  IGitCreateTreeParams,
13
13
  IGitTree,
14
14
  } from "@fluidframework/driver-definitions/internal";
15
- import {
15
+ import type {
16
16
  IWholeSummaryPayload,
17
17
  IWriteSummaryResponse,
18
18
  } from "@fluidframework/server-services-client";
19
19
 
20
- import { IWholeFlatSnapshot } from "./contracts.js";
20
+ import type { IWholeFlatSnapshot } from "./contracts.js";
21
21
  import type { QueryStringType } from "./queryStringUtils.js";
22
- import { IR11sResponse } from "./restWrapper.js";
23
- import { RestWrapper } from "./restWrapperBase.js";
24
- import { IHistorian } from "./storageContracts.js";
22
+ import type { IR11sResponse } from "./restWrapper.js";
23
+ import type { RestWrapper } from "./restWrapperBase.js";
24
+ import type { IHistorian } from "./storageContracts.js";
25
25
 
26
26
  export interface ICredentials {
27
27
  user: string;
@@ -104,7 +104,7 @@ export class Historian implements IHistorian {
104
104
  return this.restWrapper.post<IWriteSummaryResponse>(
105
105
  `/git/summaries`,
106
106
  summary,
107
- this.getQueryString(initial !== undefined ? { initial } : undefined),
107
+ this.getQueryString(initial === undefined ? undefined : { initial }),
108
108
  );
109
109
  }
110
110
 
package/src/index.ts CHANGED
@@ -8,7 +8,7 @@ export type { IRouterliciousResolvedUrl } from "./routerliciousResolvedUrl.js";
8
8
 
9
9
  // Tokens
10
10
  export { DefaultTokenProvider } from "./defaultTokenProvider.js";
11
- export { ITokenProvider, ITokenResponse, ITokenService } from "./tokens.js";
11
+ export type { ITokenProvider, ITokenResponse, ITokenService } from "./tokens.js";
12
12
 
13
13
  // Errors
14
14
  export { RouterliciousErrorTypes } from "./errorUtils.js";
@@ -21,7 +21,7 @@ export {
21
21
  } from "./documentServiceFactory.js";
22
22
 
23
23
  // Configuration
24
- export { IRouterliciousDriverPolicies } from "./policies.js";
24
+ export type { IRouterliciousDriverPolicies } from "./policies.js";
25
25
 
26
26
  // Layer Compat details
27
27
  export { r11sDriverCompatDetailsForLoader } from "./r11sLayerCompatState.js";
@@ -18,7 +18,7 @@ export class MapWithExpiration<TKey = any, TValue = any> extends Map<TKey, TValu
18
18
  }
19
19
 
20
20
  private refresh(key: TKey): void {
21
- this.lastRefreshedTimes.set(key, new Date().valueOf());
21
+ this.lastRefreshedTimes.set(key, Date.now());
22
22
  }
23
23
 
24
24
  /**
@@ -35,7 +35,7 @@ export class MapWithExpiration<TKey = any, TValue = any> extends Map<TKey, TValu
35
35
  if (refreshTime === undefined) {
36
36
  return undefined;
37
37
  }
38
- const expired = new Date().valueOf() - refreshTime >= this.expiryMs;
38
+ const expired = Date.now() - refreshTime >= this.expiryMs;
39
39
  if (expired && cleanUp) {
40
40
  this.delete(key);
41
41
  }
@@ -3,8 +3,8 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { ISummaryTree, ISummaryHandle } from "@fluidframework/driver-definitions";
7
- import {
6
+ import type { ISummaryTree, ISummaryHandle } from "@fluidframework/driver-definitions";
7
+ import type {
8
8
  IDocumentStorageService,
9
9
  ISummaryContext,
10
10
  IVersion,
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/routerlicious-driver";
9
- export const pkgVersion = "2.90.0";
9
+ export const pkgVersion = "2.92.0";
@@ -4,9 +4,9 @@
4
4
  */
5
5
 
6
6
  import { stringToBuffer } from "@fluid-internal/client-utils";
7
- import { ISnapshotTree } from "@fluidframework/driver-definitions/internal";
7
+ import type { ISnapshotTree } from "@fluidframework/driver-definitions/internal";
8
8
 
9
- import {
9
+ import type {
10
10
  INormalizedWholeSnapshot,
11
11
  IWholeFlatSnapshot,
12
12
  IWholeFlatSnapshotTree,
@@ -71,9 +71,9 @@ export function convertWholeFlatSnapshotToSnapshotTreeAndBlobs(
71
71
  ): INormalizedWholeSnapshot {
72
72
  const blobs = new Map<string, ArrayBuffer>();
73
73
  if (flatSnapshot.blobs) {
74
- flatSnapshot.blobs.forEach((blob) => {
74
+ for (const blob of flatSnapshot.blobs) {
75
75
  blobs.set(blob.id, stringToBuffer(blob.content, blob.encoding ?? "utf-8"));
76
- });
76
+ }
77
77
  }
78
78
  const flatSnapshotTree = flatSnapshot.trees?.[0];
79
79
  const sequenceNumber = flatSnapshotTree?.sequenceNumber;
@@ -4,25 +4,18 @@
4
4
  */
5
5
 
6
6
  import { performanceNow } from "@fluid-internal/client-utils";
7
- import { ITelemetryBaseProperties } from "@fluidframework/core-interfaces";
7
+ import type { ITelemetryBaseProperties } from "@fluidframework/core-interfaces";
8
8
  import { assert } from "@fluidframework/core-utils/internal";
9
- import {
10
- GenericNetworkError,
11
- NonRetryableError,
12
- RateLimiter,
13
- } from "@fluidframework/driver-utils/internal";
9
+ import type { RateLimiter } from "@fluidframework/driver-utils/internal";
10
+ import { GenericNetworkError, NonRetryableError } from "@fluidframework/driver-utils/internal";
14
11
  import {
15
12
  CorrelationIdHeaderName,
16
13
  DriverVersionHeaderName,
17
14
  RestLessClient,
18
15
  getAuthorizationTokenFromCredentials,
19
16
  } from "@fluidframework/server-services-client";
20
- import {
21
- ITelemetryLoggerExt,
22
- PerformanceEvent,
23
- numberFromString,
24
- } from "@fluidframework/telemetry-utils/internal";
25
- import fetch from "cross-fetch";
17
+ import type { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
18
+ import { PerformanceEvent, numberFromString } from "@fluidframework/telemetry-utils/internal";
26
19
  import safeStringify from "json-stringify-safe";
27
20
 
28
21
  import {
@@ -34,15 +27,15 @@ import { pkgVersion as driverVersion } from "./packageVersion.js";
34
27
  import { addOrUpdateQueryParams, type QueryStringType } from "./queryStringUtils.js";
35
28
  import type { RequestConfig, RawRequestHeaders } from "./request.cjs";
36
29
  import { RestWrapper } from "./restWrapperBase.js";
37
- import { ITokenProvider, ITokenResponse } from "./tokens.js";
30
+ import type { ITokenProvider, ITokenResponse } from "./tokens.js";
38
31
 
39
32
  type AuthorizationHeaderGetter = (token: ITokenResponse) => string;
40
33
  export type TokenFetcher = (refresh?: boolean) => Promise<ITokenResponse>;
41
34
 
42
35
  const buildRequestUrl = (requestConfig: RequestConfig): string =>
43
- requestConfig.baseURL !== undefined
44
- ? `${requestConfig.baseURL ?? ""}${requestConfig.url ?? ""}`
45
- : (requestConfig.url ?? "");
36
+ requestConfig.baseURL === undefined
37
+ ? (requestConfig.url ?? "")
38
+ : `${requestConfig.baseURL ?? ""}${requestConfig.url ?? ""}`;
46
39
 
47
40
  const buildRequestInitConfig = (requestConfig: RequestConfig): RequestInit => {
48
41
  const requestInit: RequestInit = {
@@ -103,12 +96,12 @@ export function getPropsToLogFromResponse(headers: {
103
96
  const additionalProps: ITelemetryBaseProperties = {
104
97
  contentsize: numberFromString(headers.get("content-length")),
105
98
  };
106
- headersToLog.forEach((header) => {
99
+ for (const header of headersToLog) {
107
100
  const headerValue = headers.get(header.headerName);
108
101
  if (headerValue !== undefined && headerValue !== null) {
109
102
  additionalProps[header.logName] = headerValue;
110
103
  }
111
- });
104
+ }
112
105
 
113
106
  return additionalProps;
114
107
  }
@@ -276,11 +269,11 @@ class RouterliciousRestWrapper extends RestWrapper {
276
269
  }
277
270
 
278
271
  const responseSummary =
279
- responseBody !== undefined
280
- ? typeof responseBody === "string"
272
+ responseBody === undefined
273
+ ? response.statusText
274
+ : typeof responseBody === "string"
281
275
  ? responseBody
282
- : safeStringify(responseBody)
283
- : response.statusText;
276
+ : safeStringify(responseBody);
284
277
  throwR11sNetworkError(
285
278
  `R11s fetch error: ${responseSummary}`,
286
279
  response.status,
@@ -5,7 +5,7 @@
5
5
 
6
6
  import type { QueryStringType } from "./queryStringUtils.js";
7
7
  import type { RequestConfig, RequestHeaders } from "./request.cjs";
8
- import { IR11sResponse } from "./restWrapper.js";
8
+ import type { IR11sResponse } from "./restWrapper.js";
9
9
 
10
10
  export abstract class RestWrapper {
11
11
  constructor(
@@ -11,15 +11,15 @@ import type {
11
11
  IGitTree,
12
12
  } from "@fluidframework/driver-definitions/internal";
13
13
  import { runWithRetry } from "@fluidframework/driver-utils/internal";
14
- import {
14
+ import type {
15
15
  IWholeSummaryPayload,
16
16
  IWriteSummaryResponse,
17
17
  } from "@fluidframework/server-services-client";
18
- import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
18
+ import type { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
19
19
 
20
- import { IWholeFlatSnapshot } from "./contracts.js";
21
- import { IR11sResponse } from "./restWrapper.js";
22
- import { IGitManager } from "./storageContracts.js";
20
+ import type { IWholeFlatSnapshot } from "./contracts.js";
21
+ import type { IR11sResponse } from "./restWrapper.js";
22
+ import type { IGitManager } from "./storageContracts.js";
23
23
 
24
24
  export class RetriableGitManager implements IGitManager {
25
25
  constructor(
@@ -5,14 +5,12 @@
5
5
 
6
6
  import { assert } from "@fluidframework/core-utils/internal";
7
7
  import { getW3CData } from "@fluidframework/driver-base/internal";
8
- import { IResolvedUrl } from "@fluidframework/driver-definitions/internal";
9
- import { ISession } from "@fluidframework/server-services-client";
10
- import {
11
- PerformanceEvent,
12
- ITelemetryLoggerExt,
13
- } from "@fluidframework/telemetry-utils/internal";
14
-
15
- import { RouterliciousOrdererRestWrapper } from "./restWrapper.js";
8
+ import type { IResolvedUrl } from "@fluidframework/driver-definitions/internal";
9
+ import type { ISession } from "@fluidframework/server-services-client";
10
+ import type { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
11
+ import { PerformanceEvent } from "@fluidframework/telemetry-utils/internal";
12
+
13
+ import type { RouterliciousOrdererRestWrapper } from "./restWrapper.js";
16
14
  import { getDiscoveredFluidResolvedUrl } from "./urlUtils.js";
17
15
 
18
16
  /**
@@ -4,8 +4,8 @@
4
4
  */
5
5
 
6
6
  import { Uint8ArrayToString, stringToBuffer } from "@fluid-internal/client-utils";
7
- import { ISummaryHandle, ISummaryTree } from "@fluidframework/driver-definitions";
8
- import {
7
+ import type { ISummaryHandle, ISummaryTree } from "@fluidframework/driver-definitions";
8
+ import type {
9
9
  IDocumentStorageService,
10
10
  IDocumentStorageServicePolicies,
11
11
  ISummaryContext,
@@ -14,19 +14,22 @@ import {
14
14
  IVersion,
15
15
  } from "@fluidframework/driver-definitions/internal";
16
16
  import { buildGitTreeHierarchy } from "@fluidframework/driver-utils/internal";
17
- import {
17
+ import type {
18
18
  ITelemetryLoggerExt,
19
19
  MonitoringContext,
20
+ } from "@fluidframework/telemetry-utils/internal";
21
+ import {
20
22
  PerformanceEvent,
21
23
  createChildMonitoringContext,
22
24
  } from "@fluidframework/telemetry-utils/internal";
23
25
 
24
- import { ICache, InMemoryCache } from "./cache.js";
25
- import { ISnapshotTreeVersion } from "./definitions.js";
26
- import { GitManager } from "./gitManager.js";
27
- import { IRouterliciousDriverPolicies } from "./policies.js";
26
+ import type { ICache } from "./cache.js";
27
+ import { InMemoryCache } from "./cache.js";
28
+ import type { ISnapshotTreeVersion } from "./definitions.js";
29
+ import type { GitManager } from "./gitManager.js";
30
+ import type { IRouterliciousDriverPolicies } from "./policies.js";
28
31
  import { RetriableGitManager } from "./retriableGitManager.js";
29
- import { ISummaryUploadManager } from "./storageContracts.js";
32
+ import type { ISummaryUploadManager } from "./storageContracts.js";
30
33
  import { SummaryTreeUploadManager } from "./summaryTreeUploadManager.js";
31
34
 
32
35
  const isNode = typeof window === "undefined";
@@ -5,5 +5,5 @@
5
5
 
6
6
  import { io } from "socket.io-client";
7
7
 
8
- // Import is required for side-effects.
8
+ // eslint-disable-next-line unicorn/prefer-export-from -- Import is required for side-effects.
9
9
  export const SocketIOClientStatic = io;
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { ISummaryTree } from "@fluidframework/driver-definitions";
6
+ import type { ISummaryTree } from "@fluidframework/driver-definitions";
7
7
  import type {
8
8
  IGitBlob,
9
9
  IGitCommitDetails,
@@ -12,14 +12,14 @@ import type {
12
12
  IGitCreateTreeParams,
13
13
  IGitTree,
14
14
  } from "@fluidframework/driver-definitions/internal";
15
- import {
15
+ import type {
16
16
  IWholeSummaryPayload,
17
17
  IWholeSummaryPayloadType,
18
18
  IWriteSummaryResponse,
19
19
  } from "@fluidframework/server-services-client";
20
20
 
21
- import { IWholeFlatSnapshot } from "./contracts.js";
22
- import { IR11sResponse } from "./restWrapper.js";
21
+ import type { IWholeFlatSnapshot } from "./contracts.js";
22
+ import type { IR11sResponse } from "./restWrapper.js";
23
23
 
24
24
  /**
25
25
  * Interface to a generic Git provider
@@ -5,13 +5,16 @@
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 { ISummaryTree, SummaryObject, SummaryType } from "@fluidframework/driver-definitions";
9
- import type { IGitCreateTreeEntry } from "@fluidframework/driver-definitions/internal";
10
- import { ISnapshotTreeEx } from "@fluidframework/driver-definitions/internal";
8
+ import type { ISummaryTree, SummaryObject } from "@fluidframework/driver-definitions";
9
+ import { SummaryType } from "@fluidframework/driver-definitions";
10
+ import type {
11
+ IGitCreateTreeEntry,
12
+ ISnapshotTreeEx,
13
+ } from "@fluidframework/driver-definitions/internal";
11
14
  import { getGitMode, getGitType } from "@fluidframework/driver-utils/internal";
12
- import { IWholeSummaryPayloadType } from "@fluidframework/server-services-client";
15
+ import type { IWholeSummaryPayloadType } from "@fluidframework/server-services-client";
13
16
 
14
- import { IGitManager, ISummaryUploadManager } from "./storageContracts.js";
17
+ import type { IGitManager, ISummaryUploadManager } from "./storageContracts.js";
15
18
 
16
19
  /**
17
20
  * Recursively writes summary tree as individual summary blobs.
@@ -67,7 +70,7 @@ export class SummaryTreeUploadManager implements ISummaryUploadManager {
67
70
  }
68
71
  case SummaryType.Handle: {
69
72
  if (previousFullSnapshot === undefined) {
70
- throw Error("Parent summary does not exist to reference by handle.");
73
+ throw new Error("Parent summary does not exist to reference by handle.");
71
74
  }
72
75
  return this.getIdFromPath(object.handleType, object.handle, previousFullSnapshot);
73
76
  }
@@ -78,8 +81,9 @@ export class SummaryTreeUploadManager implements ISummaryUploadManager {
78
81
  return object.id;
79
82
  }
80
83
 
81
- default:
84
+ default: {
82
85
  unreachableCase(object, `Unknown type: ${(object as any).type}`);
86
+ }
83
87
  }
84
88
  }
85
89
 
@@ -142,8 +146,9 @@ export class SummaryTreeUploadManager implements ISummaryUploadManager {
142
146
  );
143
147
  return tryId;
144
148
  }
145
- default:
146
- throw Error(`Unexpected handle summary object type: "${handleType}".`);
149
+ default: {
150
+ throw new Error(`Unexpected handle summary object type: "${handleType}".`);
151
+ }
147
152
  }
148
153
  }
149
154
  return this.getIdFromPathCore(handleType, path.slice(1), previousSnapshot.trees[key]);
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/driver-definitions/internal";
6
+ import type { ITokenClaims } from "@fluidframework/driver-definitions/internal";
7
7
 
8
8
  /**
9
9
  * Abstracts the discovery of claims contained within a token.