@fluidframework/routerlicious-driver 2.91.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.
- package/CHANGELOG.md +4 -0
- package/dist/cache.js +1 -1
- package/dist/cache.js.map +1 -1
- package/dist/contracts.d.ts +1 -1
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js.map +1 -1
- package/dist/createNewUtils.d.ts +1 -1
- package/dist/createNewUtils.d.ts.map +1 -1
- package/dist/createNewUtils.js.map +1 -1
- package/dist/defaultTokenProvider.d.ts +1 -1
- package/dist/defaultTokenProvider.d.ts.map +1 -1
- package/dist/defaultTokenProvider.js.map +1 -1
- package/dist/definitions.d.ts +1 -1
- package/dist/definitions.d.ts.map +1 -1
- package/dist/definitions.js.map +1 -1
- package/dist/deltaStorageService.d.ts +4 -4
- package/dist/deltaStorageService.d.ts.map +1 -1
- package/dist/deltaStorageService.js +1 -1
- package/dist/deltaStorageService.js.map +1 -1
- package/dist/documentDeltaConnection.d.ts +4 -4
- package/dist/documentDeltaConnection.d.ts.map +1 -1
- package/dist/documentDeltaConnection.js.map +1 -1
- package/dist/documentService.d.ts +10 -9
- package/dist/documentService.d.ts.map +1 -1
- package/dist/documentService.js.map +1 -1
- package/dist/documentServiceFactory.d.ts +6 -6
- package/dist/documentServiceFactory.d.ts.map +1 -1
- package/dist/documentServiceFactory.js.map +1 -1
- package/dist/documentStorageService.d.ts +7 -7
- package/dist/documentStorageService.d.ts.map +1 -1
- package/dist/documentStorageService.js.map +1 -1
- package/dist/errorUtils.d.ts +3 -2
- package/dist/errorUtils.d.ts.map +1 -1
- package/dist/errorUtils.js +13 -7
- package/dist/errorUtils.js.map +1 -1
- package/dist/gitManager.d.ts +4 -4
- package/dist/gitManager.d.ts.map +1 -1
- package/dist/gitManager.js.map +1 -1
- package/dist/historian.d.ts +5 -5
- package/dist/historian.d.ts.map +1 -1
- package/dist/historian.js +1 -1
- package/dist/historian.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +1 -1
- package/dist/mapWithExpiration.js +2 -2
- package/dist/mapWithExpiration.js.map +1 -1
- package/dist/nullBlobStorageService.d.ts +2 -2
- package/dist/nullBlobStorageService.d.ts.map +1 -1
- package/dist/nullBlobStorageService.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/public.d.ts +1 -1
- package/dist/r11sSnapshotParser.d.ts +1 -1
- package/dist/r11sSnapshotParser.d.ts.map +1 -1
- package/dist/r11sSnapshotParser.js +2 -2
- package/dist/r11sSnapshotParser.js.map +1 -1
- package/dist/restWrapper.d.ts +4 -4
- package/dist/restWrapper.d.ts.map +1 -1
- package/dist/restWrapper.js +10 -11
- package/dist/restWrapper.js.map +1 -1
- package/dist/restWrapperBase.d.ts +1 -1
- package/dist/restWrapperBase.d.ts.map +1 -1
- package/dist/restWrapperBase.js.map +1 -1
- package/dist/retriableGitManager.d.ts +5 -5
- package/dist/retriableGitManager.d.ts.map +1 -1
- package/dist/retriableGitManager.js.map +1 -1
- package/dist/sessionInfoManager.d.ts +4 -4
- package/dist/sessionInfoManager.d.ts.map +1 -1
- package/dist/sessionInfoManager.js.map +1 -1
- package/dist/shreddedSummaryDocumentStorageService.d.ts +7 -7
- package/dist/shreddedSummaryDocumentStorageService.d.ts.map +1 -1
- package/dist/shreddedSummaryDocumentStorageService.js.map +1 -1
- package/dist/socketModule.js +1 -1
- package/dist/socketModule.js.map +1 -1
- package/dist/storageContracts.d.ts +4 -4
- package/dist/storageContracts.d.ts.map +1 -1
- package/dist/storageContracts.js.map +1 -1
- package/dist/summaryTreeUploadManager.d.ts +4 -4
- package/dist/summaryTreeUploadManager.d.ts.map +1 -1
- package/dist/summaryTreeUploadManager.js +6 -4
- package/dist/summaryTreeUploadManager.js.map +1 -1
- package/dist/tokens.d.ts +1 -1
- package/dist/tokens.d.ts.map +1 -1
- package/dist/tokens.js.map +1 -1
- package/dist/treeUtils.d.ts +4 -3
- package/dist/treeUtils.d.ts.map +1 -1
- package/dist/treeUtils.js.map +1 -1
- package/dist/urlUtils.d.ts +2 -2
- package/dist/urlUtils.d.ts.map +1 -1
- package/dist/urlUtils.js +1 -1
- package/dist/urlUtils.js.map +1 -1
- package/dist/wholeSummaryDocumentStorageService.d.ts +7 -7
- package/dist/wholeSummaryDocumentStorageService.d.ts.map +1 -1
- package/dist/wholeSummaryDocumentStorageService.js +5 -5
- package/dist/wholeSummaryDocumentStorageService.js.map +1 -1
- package/dist/wholeSummaryUploadManager.d.ts +2 -2
- package/dist/wholeSummaryUploadManager.d.ts.map +1 -1
- package/dist/wholeSummaryUploadManager.js.map +1 -1
- package/eslint.config.mts +18 -5
- package/internal.d.ts +1 -1
- package/legacy.d.ts +1 -1
- package/lib/cache.js +1 -1
- package/lib/cache.js.map +1 -1
- package/lib/contracts.d.ts +1 -1
- package/lib/contracts.d.ts.map +1 -1
- package/lib/contracts.js.map +1 -1
- package/lib/createNewUtils.d.ts +1 -1
- package/lib/createNewUtils.d.ts.map +1 -1
- package/lib/createNewUtils.js.map +1 -1
- package/lib/defaultTokenProvider.d.ts +1 -1
- package/lib/defaultTokenProvider.d.ts.map +1 -1
- package/lib/defaultTokenProvider.js.map +1 -1
- package/lib/definitions.d.ts +1 -1
- package/lib/definitions.d.ts.map +1 -1
- package/lib/definitions.js.map +1 -1
- package/lib/deltaStorageService.d.ts +4 -4
- package/lib/deltaStorageService.d.ts.map +1 -1
- package/lib/deltaStorageService.js +2 -2
- package/lib/deltaStorageService.js.map +1 -1
- package/lib/documentDeltaConnection.d.ts +4 -4
- package/lib/documentDeltaConnection.d.ts.map +1 -1
- package/lib/documentDeltaConnection.js +1 -1
- package/lib/documentDeltaConnection.js.map +1 -1
- package/lib/documentService.d.ts +10 -9
- package/lib/documentService.d.ts.map +1 -1
- package/lib/documentService.js +1 -1
- package/lib/documentService.js.map +1 -1
- package/lib/documentServiceFactory.d.ts +6 -6
- package/lib/documentServiceFactory.d.ts.map +1 -1
- package/lib/documentServiceFactory.js +2 -2
- package/lib/documentServiceFactory.js.map +1 -1
- package/lib/documentStorageService.d.ts +7 -7
- package/lib/documentStorageService.d.ts.map +1 -1
- package/lib/documentStorageService.js +1 -1
- package/lib/documentStorageService.js.map +1 -1
- package/lib/errorUtils.d.ts +3 -2
- package/lib/errorUtils.d.ts.map +1 -1
- package/lib/errorUtils.js +14 -8
- package/lib/errorUtils.js.map +1 -1
- package/lib/gitManager.d.ts +4 -4
- package/lib/gitManager.d.ts.map +1 -1
- package/lib/gitManager.js.map +1 -1
- package/lib/historian.d.ts +5 -5
- package/lib/historian.d.ts.map +1 -1
- package/lib/historian.js +1 -1
- package/lib/historian.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/legacy.d.ts +1 -1
- package/lib/mapWithExpiration.js +2 -2
- package/lib/mapWithExpiration.js.map +1 -1
- package/lib/nullBlobStorageService.d.ts +2 -2
- package/lib/nullBlobStorageService.d.ts.map +1 -1
- package/lib/nullBlobStorageService.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/public.d.ts +1 -1
- package/lib/r11sSnapshotParser.d.ts +1 -1
- package/lib/r11sSnapshotParser.d.ts.map +1 -1
- package/lib/r11sSnapshotParser.js +2 -2
- package/lib/r11sSnapshotParser.js.map +1 -1
- package/lib/restWrapper.d.ts +4 -4
- package/lib/restWrapper.d.ts.map +1 -1
- package/lib/restWrapper.js +11 -12
- package/lib/restWrapper.js.map +1 -1
- package/lib/restWrapperBase.d.ts +1 -1
- package/lib/restWrapperBase.d.ts.map +1 -1
- package/lib/restWrapperBase.js.map +1 -1
- package/lib/retriableGitManager.d.ts +5 -5
- package/lib/retriableGitManager.d.ts.map +1 -1
- package/lib/retriableGitManager.js.map +1 -1
- package/lib/sessionInfoManager.d.ts +4 -4
- package/lib/sessionInfoManager.d.ts.map +1 -1
- package/lib/sessionInfoManager.js +1 -1
- package/lib/sessionInfoManager.js.map +1 -1
- package/lib/shreddedSummaryDocumentStorageService.d.ts +7 -7
- package/lib/shreddedSummaryDocumentStorageService.d.ts.map +1 -1
- package/lib/shreddedSummaryDocumentStorageService.js.map +1 -1
- package/lib/socketModule.js +1 -1
- package/lib/socketModule.js.map +1 -1
- package/lib/storageContracts.d.ts +4 -4
- package/lib/storageContracts.d.ts.map +1 -1
- package/lib/storageContracts.js.map +1 -1
- package/lib/summaryTreeUploadManager.d.ts +4 -4
- package/lib/summaryTreeUploadManager.d.ts.map +1 -1
- package/lib/summaryTreeUploadManager.js +6 -4
- package/lib/summaryTreeUploadManager.js.map +1 -1
- package/lib/tokens.d.ts +1 -1
- package/lib/tokens.d.ts.map +1 -1
- package/lib/tokens.js.map +1 -1
- package/lib/treeUtils.d.ts +4 -3
- package/lib/treeUtils.d.ts.map +1 -1
- package/lib/treeUtils.js.map +1 -1
- package/lib/urlUtils.d.ts +2 -2
- package/lib/urlUtils.d.ts.map +1 -1
- package/lib/urlUtils.js +1 -1
- package/lib/urlUtils.js.map +1 -1
- package/lib/wholeSummaryDocumentStorageService.d.ts +7 -7
- package/lib/wholeSummaryDocumentStorageService.d.ts.map +1 -1
- package/lib/wholeSummaryDocumentStorageService.js +5 -5
- package/lib/wholeSummaryDocumentStorageService.js.map +1 -1
- package/lib/wholeSummaryUploadManager.d.ts +2 -2
- package/lib/wholeSummaryUploadManager.d.ts.map +1 -1
- package/lib/wholeSummaryUploadManager.js +1 -1
- package/lib/wholeSummaryUploadManager.js.map +1 -1
- package/package.json +15 -18
- package/src/cache.ts +1 -1
- package/src/contracts.ts +1 -1
- package/src/createNewUtils.ts +2 -1
- package/src/defaultTokenProvider.ts +1 -1
- package/src/definitions.ts +1 -1
- package/src/deltaStorageService.ts +7 -9
- package/src/documentDeltaConnection.ts +6 -10
- package/src/documentService.ts +11 -14
- package/src/documentServiceFactory.ts +12 -13
- package/src/documentStorageService.ts +8 -8
- package/src/errorUtils.ts +17 -10
- package/src/gitManager.ts +4 -4
- package/src/historian.ts +6 -6
- package/src/index.ts +2 -2
- package/src/mapWithExpiration.ts +2 -2
- package/src/nullBlobStorageService.ts +2 -2
- package/src/packageVersion.ts +1 -1
- package/src/r11sSnapshotParser.ts +4 -4
- package/src/restWrapper.ts +15 -22
- package/src/restWrapperBase.ts +1 -1
- package/src/retriableGitManager.ts +5 -5
- package/src/sessionInfoManager.ts +6 -8
- package/src/shreddedSummaryDocumentStorageService.ts +11 -8
- package/src/socketModule.ts +1 -1
- package/src/storageContracts.ts +4 -4
- package/src/summaryTreeUploadManager.ts +14 -9
- package/src/tokens.ts +1 -1
- package/src/treeUtils.ts +4 -3
- package/src/urlUtils.ts +3 -3
- package/src/wholeSummaryDocumentStorageService.ts +17 -14
- 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
|
-
|
|
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
|
|
package/src/documentService.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
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
|
|
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
|
-
|
|
120
|
+
}
|
|
121
|
+
case 404: {
|
|
120
122
|
const errorType = RouterliciousErrorTypes.fileNotFoundOrAccessDeniedError;
|
|
121
123
|
error = new NonRetryableError(errorMessage, errorType, props);
|
|
122
124
|
break;
|
|
123
|
-
|
|
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
|
-
|
|
134
|
+
}
|
|
135
|
+
case 503: {
|
|
131
136
|
if (internalErrorCode === R11sServiceClusterDrainingErrorCode) {
|
|
132
137
|
error = new ClusterDrainingError(
|
|
133
138
|
errorMessage,
|
|
134
|
-
retryAfterMs
|
|
139
|
+
retryAfterMs === undefined ? 660 : retryAfterMs / 1000,
|
|
135
140
|
props,
|
|
136
141
|
);
|
|
137
142
|
break;
|
|
138
143
|
}
|
|
139
|
-
|
|
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
|
|
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";
|
package/src/mapWithExpiration.ts
CHANGED
|
@@ -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,
|
|
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 =
|
|
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,
|
package/src/packageVersion.ts
CHANGED
|
@@ -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
|
|
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;
|
package/src/restWrapper.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
|
44
|
-
?
|
|
45
|
-
:
|
|
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
|
-
|
|
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
|
|
280
|
-
?
|
|
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,
|
package/src/restWrapperBase.ts
CHANGED
|
@@ -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
|
-
|
|
12
|
-
|
|
13
|
-
} from "
|
|
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
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
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";
|
package/src/socketModule.ts
CHANGED
package/src/storageContracts.ts
CHANGED
|
@@ -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
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
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.
|