@fluidframework/routerlicious-driver 1.4.0-115997 → 2.0.0-dev-rc.1.0.0.224419
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/.eslintrc.js +10 -12
- package/.mocharc.js +12 -0
- package/CHANGELOG.md +156 -0
- package/README.md +39 -1
- package/api-extractor-lint.json +4 -0
- package/api-extractor.json +2 -2
- package/api-report/routerlicious-driver.api.md +108 -0
- package/dist/cache.cjs +30 -0
- package/dist/cache.cjs.map +1 -0
- package/dist/cache.d.ts +7 -0
- package/dist/cache.d.ts.map +1 -1
- package/dist/{definitions.js → contracts.cjs} +1 -1
- package/dist/contracts.cjs.map +1 -0
- package/dist/contracts.d.ts +42 -0
- package/dist/contracts.d.ts.map +1 -0
- package/dist/{createNewUtils.js → createNewUtils.cjs} +7 -5
- package/dist/createNewUtils.cjs.map +1 -0
- package/dist/createNewUtils.d.ts +1 -1
- package/dist/createNewUtils.d.ts.map +1 -1
- package/dist/{defaultTokenProvider.js → defaultTokenProvider.cjs} +2 -1
- package/dist/defaultTokenProvider.cjs.map +1 -0
- package/dist/defaultTokenProvider.d.ts +1 -0
- package/dist/defaultTokenProvider.d.ts.map +1 -1
- package/dist/definitions.cjs +7 -0
- package/dist/definitions.cjs.map +1 -0
- package/dist/definitions.d.ts.map +1 -1
- package/dist/deltaStorageService.cjs +122 -0
- package/dist/deltaStorageService.cjs.map +1 -0
- package/dist/deltaStorageService.d.ts +7 -6
- package/dist/deltaStorageService.d.ts.map +1 -1
- package/dist/{documentDeltaConnection.js → documentDeltaConnection.cjs} +8 -13
- package/dist/documentDeltaConnection.cjs.map +1 -0
- package/dist/documentDeltaConnection.d.ts +3 -4
- package/dist/documentDeltaConnection.d.ts.map +1 -1
- package/dist/{documentService.js → documentService.cjs} +61 -64
- package/dist/documentService.cjs.map +1 -0
- package/dist/documentService.d.ts +12 -4
- package/dist/documentService.d.ts.map +1 -1
- package/dist/{documentServiceFactory.js → documentServiceFactory.cjs} +87 -33
- package/dist/documentServiceFactory.cjs.map +1 -0
- package/dist/documentServiceFactory.d.ts +5 -3
- package/dist/documentServiceFactory.d.ts.map +1 -1
- package/dist/{documentStorageService.js → documentStorageService.cjs} +18 -16
- package/dist/documentStorageService.cjs.map +1 -0
- package/dist/documentStorageService.d.ts +4 -3
- package/dist/documentStorageService.d.ts.map +1 -1
- package/dist/errorUtils.cjs +87 -0
- package/dist/errorUtils.cjs.map +1 -0
- package/dist/errorUtils.d.ts +56 -10
- package/dist/errorUtils.d.ts.map +1 -1
- package/dist/gitManager.cjs +46 -0
- package/dist/gitManager.cjs.map +1 -0
- package/dist/gitManager.d.ts +27 -0
- package/dist/gitManager.d.ts.map +1 -0
- package/dist/historian.cjs +72 -0
- package/dist/historian.cjs.map +1 -0
- package/dist/historian.d.ts +34 -0
- package/dist/historian.d.ts.map +1 -0
- package/dist/index.cjs +19 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +5 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/mapWithExpiration.cjs +105 -0
- package/dist/mapWithExpiration.cjs.map +1 -0
- package/dist/mapWithExpiration.d.ts +34 -0
- package/dist/mapWithExpiration.d.ts.map +1 -0
- package/dist/{nullBlobStorageService.js → nullBlobStorageService.cjs} +5 -5
- package/dist/nullBlobStorageService.cjs.map +1 -0
- package/dist/nullBlobStorageService.d.ts.map +1 -1
- package/dist/{packageVersion.js → packageVersion.cjs} +2 -2
- package/dist/packageVersion.cjs.map +1 -0
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/{policies.js → policies.cjs} +1 -1
- package/dist/policies.cjs.map +1 -0
- package/dist/policies.d.ts +22 -9
- package/dist/policies.d.ts.map +1 -1
- package/dist/r11sSnapshotParser.cjs +73 -0
- package/dist/r11sSnapshotParser.cjs.map +1 -0
- package/dist/r11sSnapshotParser.d.ts +14 -0
- package/dist/r11sSnapshotParser.d.ts.map +1 -0
- package/dist/restWrapper.cjs +249 -0
- package/dist/restWrapper.cjs.map +1 -0
- package/dist/restWrapper.d.ts +32 -12
- package/dist/restWrapper.d.ts.map +1 -1
- package/dist/restWrapperBase.cjs +89 -0
- package/dist/restWrapperBase.cjs.map +1 -0
- package/dist/restWrapperBase.d.ts +26 -0
- package/dist/restWrapperBase.d.ts.map +1 -0
- package/dist/retriableGitManager.cjs +40 -0
- package/dist/retriableGitManager.cjs.map +1 -0
- package/dist/retriableGitManager.d.ts +13 -23
- package/dist/retriableGitManager.d.ts.map +1 -1
- package/dist/routerlicious-driver-alpha.d.ts +92 -0
- package/dist/routerlicious-driver-beta.d.ts +98 -0
- package/dist/routerlicious-driver-public.d.ts +98 -0
- package/dist/routerlicious-driver-untrimmed.d.ts +261 -0
- package/dist/{shreddedSummaryDocumentStorageService.js → shreddedSummaryDocumentStorageService.cjs} +41 -34
- package/dist/shreddedSummaryDocumentStorageService.cjs.map +1 -0
- package/dist/shreddedSummaryDocumentStorageService.d.ts +6 -5
- package/dist/shreddedSummaryDocumentStorageService.d.ts.map +1 -1
- package/dist/storageContracts.cjs +7 -0
- package/dist/storageContracts.cjs.map +1 -0
- package/dist/storageContracts.d.ts +45 -0
- package/dist/storageContracts.d.ts.map +1 -0
- package/dist/summaryTreeUploadManager.cjs +110 -0
- package/dist/summaryTreeUploadManager.cjs.map +1 -0
- package/dist/summaryTreeUploadManager.d.ts +23 -0
- package/dist/summaryTreeUploadManager.d.ts.map +1 -0
- package/dist/{tokens.js → tokens.cjs} +1 -1
- package/dist/tokens.cjs.map +1 -0
- package/dist/tokens.d.ts +34 -5
- package/dist/tokens.d.ts.map +1 -1
- package/dist/treeUtils.cjs +107 -0
- package/dist/treeUtils.cjs.map +1 -0
- package/dist/treeUtils.d.ts +58 -0
- package/dist/treeUtils.d.ts.map +1 -0
- package/dist/tsdoc-metadata.json +11 -0
- package/dist/{urlUtils.js → urlUtils.cjs} +21 -25
- package/dist/urlUtils.cjs.map +1 -0
- package/dist/urlUtils.d.ts +2 -2
- package/dist/urlUtils.d.ts.map +1 -1
- package/dist/wholeSummaryDocumentStorageService.cjs +253 -0
- package/dist/wholeSummaryDocumentStorageService.cjs.map +1 -0
- package/dist/wholeSummaryDocumentStorageService.d.ts +10 -8
- package/dist/wholeSummaryDocumentStorageService.d.ts.map +1 -1
- package/dist/wholeSummaryUploadManager.cjs +37 -0
- package/dist/wholeSummaryUploadManager.cjs.map +1 -0
- package/dist/wholeSummaryUploadManager.d.ts +16 -0
- package/dist/wholeSummaryUploadManager.d.ts.map +1 -0
- package/lib/{cache.d.ts → cache.d.mts} +7 -0
- package/lib/cache.d.mts.map +1 -0
- package/lib/cache.mjs +25 -0
- package/lib/cache.mjs.map +1 -0
- package/lib/contracts.d.mts +42 -0
- package/lib/contracts.d.mts.map +1 -0
- package/lib/{definitions.js → contracts.mjs} +1 -1
- package/lib/contracts.mjs.map +1 -0
- package/lib/{createNewUtils.d.ts → createNewUtils.d.mts} +1 -1
- package/lib/{createNewUtils.d.ts.map → createNewUtils.d.mts.map} +1 -1
- package/lib/{createNewUtils.js → createNewUtils.mjs} +7 -5
- package/lib/createNewUtils.mjs.map +1 -0
- package/lib/{defaultTokenProvider.d.ts → defaultTokenProvider.d.mts} +2 -1
- package/lib/defaultTokenProvider.d.mts.map +1 -0
- package/lib/{defaultTokenProvider.js → defaultTokenProvider.mjs} +2 -1
- package/lib/defaultTokenProvider.mjs.map +1 -0
- package/lib/definitions.d.mts.map +1 -0
- package/lib/definitions.mjs +6 -0
- package/{dist/definitions.js.map → lib/definitions.mjs.map} +1 -1
- package/lib/{deltaStorageService.d.ts → deltaStorageService.d.mts} +8 -7
- package/lib/deltaStorageService.d.mts.map +1 -0
- package/lib/deltaStorageService.mjs +117 -0
- package/lib/deltaStorageService.mjs.map +1 -0
- package/lib/{documentDeltaConnection.d.ts → documentDeltaConnection.d.mts} +3 -4
- package/lib/documentDeltaConnection.d.mts.map +1 -0
- package/lib/{documentDeltaConnection.js → documentDeltaConnection.mjs} +8 -13
- package/lib/documentDeltaConnection.mjs.map +1 -0
- package/lib/{documentService.d.ts → documentService.d.mts} +16 -8
- package/lib/documentService.d.mts.map +1 -0
- package/lib/{documentService.js → documentService.mjs} +60 -44
- package/lib/documentService.mjs.map +1 -0
- package/lib/{documentServiceFactory.d.ts → documentServiceFactory.d.mts} +7 -5
- package/lib/documentServiceFactory.d.mts.map +1 -0
- package/lib/{documentServiceFactory.js → documentServiceFactory.mjs} +88 -34
- package/lib/documentServiceFactory.mjs.map +1 -0
- package/lib/{documentStorageService.d.ts → documentStorageService.d.mts} +7 -6
- package/lib/documentStorageService.d.mts.map +1 -0
- package/lib/{documentStorageService.js → documentStorageService.mjs} +19 -17
- package/lib/documentStorageService.mjs.map +1 -0
- package/lib/errorUtils.d.mts +93 -0
- package/lib/errorUtils.d.mts.map +1 -0
- package/lib/errorUtils.mjs +81 -0
- package/lib/errorUtils.mjs.map +1 -0
- package/lib/gitManager.d.mts +27 -0
- package/lib/gitManager.d.mts.map +1 -0
- package/lib/gitManager.mjs +42 -0
- package/lib/gitManager.mjs.map +1 -0
- package/lib/historian.d.mts +34 -0
- package/lib/historian.d.mts.map +1 -0
- package/lib/historian.mjs +67 -0
- package/lib/historian.mjs.map +1 -0
- package/lib/index.d.mts +10 -0
- package/lib/index.d.mts.map +1 -0
- package/lib/index.mjs +8 -0
- package/lib/index.mjs.map +1 -0
- package/lib/mapWithExpiration.d.mts +34 -0
- package/lib/mapWithExpiration.d.mts.map +1 -0
- package/lib/mapWithExpiration.mjs +101 -0
- package/lib/mapWithExpiration.mjs.map +1 -0
- package/lib/nullBlobStorageService.d.mts.map +1 -0
- package/lib/{nullBlobStorageService.js → nullBlobStorageService.mjs} +5 -5
- package/lib/nullBlobStorageService.mjs.map +1 -0
- package/lib/{packageVersion.d.ts → packageVersion.d.mts} +1 -1
- package/lib/{packageVersion.d.ts.map → packageVersion.d.mts.map} +1 -1
- package/lib/{packageVersion.js → packageVersion.mjs} +2 -2
- package/lib/packageVersion.mjs.map +1 -0
- package/lib/{policies.d.ts → policies.d.mts} +22 -9
- package/lib/policies.d.mts.map +1 -0
- package/lib/{policies.js → policies.mjs} +1 -1
- package/lib/policies.mjs.map +1 -0
- package/lib/r11sSnapshotParser.d.mts +14 -0
- package/lib/r11sSnapshotParser.d.mts.map +1 -0
- package/lib/r11sSnapshotParser.mjs +69 -0
- package/lib/r11sSnapshotParser.mjs.map +1 -0
- package/lib/restWrapper.d.mts +53 -0
- package/lib/restWrapper.d.mts.map +1 -0
- package/lib/restWrapper.mjs +236 -0
- package/lib/restWrapper.mjs.map +1 -0
- package/lib/restWrapperBase.d.mts +26 -0
- package/lib/restWrapperBase.d.mts.map +1 -0
- package/lib/restWrapperBase.mjs +84 -0
- package/lib/restWrapperBase.mjs.map +1 -0
- package/lib/retriableGitManager.d.mts +24 -0
- package/lib/retriableGitManager.d.mts.map +1 -0
- package/lib/retriableGitManager.mjs +36 -0
- package/lib/retriableGitManager.mjs.map +1 -0
- package/lib/routerlicious-driver-alpha.d.mts +92 -0
- package/lib/routerlicious-driver-beta.d.mts +98 -0
- package/lib/routerlicious-driver-public.d.mts +98 -0
- package/lib/routerlicious-driver-untrimmed.d.mts +261 -0
- package/lib/{shreddedSummaryDocumentStorageService.d.ts → shreddedSummaryDocumentStorageService.d.mts} +9 -8
- package/lib/shreddedSummaryDocumentStorageService.d.mts.map +1 -0
- package/lib/{shreddedSummaryDocumentStorageService.js → shreddedSummaryDocumentStorageService.mjs} +41 -34
- package/lib/shreddedSummaryDocumentStorageService.mjs.map +1 -0
- package/lib/storageContracts.d.mts +45 -0
- package/lib/storageContracts.d.mts.map +1 -0
- package/lib/storageContracts.mjs +6 -0
- package/lib/storageContracts.mjs.map +1 -0
- package/lib/summaryTreeUploadManager.d.mts +23 -0
- package/lib/summaryTreeUploadManager.d.mts.map +1 -0
- package/lib/summaryTreeUploadManager.mjs +106 -0
- package/lib/summaryTreeUploadManager.mjs.map +1 -0
- package/lib/{tokens.d.ts → tokens.d.mts} +34 -5
- package/lib/tokens.d.mts.map +1 -0
- package/lib/{tokens.js → tokens.mjs} +1 -1
- package/lib/tokens.mjs.map +1 -0
- package/lib/treeUtils.d.mts +58 -0
- package/lib/treeUtils.d.mts.map +1 -0
- package/lib/treeUtils.mjs +100 -0
- package/lib/treeUtils.mjs.map +1 -0
- package/lib/{urlUtils.d.ts → urlUtils.d.mts} +2 -2
- package/lib/urlUtils.d.mts.map +1 -0
- package/lib/urlUtils.mjs +38 -0
- package/lib/urlUtils.mjs.map +1 -0
- package/lib/{wholeSummaryDocumentStorageService.d.ts → wholeSummaryDocumentStorageService.d.mts} +12 -10
- package/lib/wholeSummaryDocumentStorageService.d.mts.map +1 -0
- package/lib/wholeSummaryDocumentStorageService.mjs +249 -0
- package/lib/wholeSummaryDocumentStorageService.mjs.map +1 -0
- package/lib/wholeSummaryUploadManager.d.mts +16 -0
- package/lib/wholeSummaryUploadManager.d.mts.map +1 -0
- package/lib/wholeSummaryUploadManager.mjs +33 -0
- package/lib/wholeSummaryUploadManager.mjs.map +1 -0
- package/package.json +104 -68
- package/prettier.config.cjs +8 -0
- package/src/cache.ts +25 -9
- package/src/contracts.ts +60 -0
- package/src/createNewUtils.ts +26 -24
- package/src/defaultTokenProvider.ts +14 -15
- package/src/definitions.ts +2 -2
- package/src/deltaStorageService.ts +145 -91
- package/src/documentDeltaConnection.ts +54 -52
- package/src/documentService.ts +272 -242
- package/src/documentServiceFactory.ts +338 -237
- package/src/documentStorageService.ts +92 -84
- package/src/errorUtils.ts +117 -79
- package/src/gitManager.ts +67 -0
- package/src/historian.ts +121 -0
- package/src/index.ts +15 -8
- package/src/mapWithExpiration.ts +124 -0
- package/src/nullBlobStorageService.ts +24 -21
- package/src/packageVersion.ts +1 -1
- package/src/policies.ts +51 -38
- package/src/r11sSnapshotParser.ts +82 -0
- package/src/restWrapper.ts +400 -216
- package/src/restWrapperBase.ts +146 -0
- package/src/retriableGitManager.ts +76 -153
- package/src/shreddedSummaryDocumentStorageService.ts +214 -195
- package/src/storageContracts.ts +63 -0
- package/src/summaryTreeUploadManager.ts +155 -0
- package/src/tokens.ts +74 -39
- package/src/treeUtils.ts +138 -0
- package/src/urlUtils.ts +27 -28
- package/src/wholeSummaryDocumentStorageService.ts +352 -252
- package/src/wholeSummaryUploadManager.ts +64 -0
- package/tsc-multi.test.json +4 -0
- package/tsconfig.json +10 -13
- package/dist/cache.js +0 -20
- package/dist/cache.js.map +0 -1
- package/dist/createNewUtils.js.map +0 -1
- package/dist/defaultTokenProvider.js.map +0 -1
- package/dist/deltaStorageService.js +0 -82
- package/dist/deltaStorageService.js.map +0 -1
- package/dist/documentDeltaConnection.js.map +0 -1
- package/dist/documentService.js.map +0 -1
- package/dist/documentServiceFactory.js.map +0 -1
- package/dist/documentStorageService.js.map +0 -1
- package/dist/errorUtils.js +0 -56
- package/dist/errorUtils.js.map +0 -1
- package/dist/index.js +0 -25
- package/dist/index.js.map +0 -1
- package/dist/nullBlobStorageService.js.map +0 -1
- package/dist/packageVersion.js.map +0 -1
- package/dist/policies.js.map +0 -1
- package/dist/restWrapper.js +0 -153
- package/dist/restWrapper.js.map +0 -1
- package/dist/retriableGitManager.js +0 -76
- package/dist/retriableGitManager.js.map +0 -1
- package/dist/shreddedSummaryDocumentStorageService.js.map +0 -1
- package/dist/tokens.js.map +0 -1
- package/dist/urlUtils.js.map +0 -1
- package/dist/wholeSummaryDocumentStorageService.js +0 -191
- package/dist/wholeSummaryDocumentStorageService.js.map +0 -1
- package/lib/cache.d.ts.map +0 -1
- package/lib/cache.js +0 -16
- package/lib/cache.js.map +0 -1
- package/lib/createNewUtils.js.map +0 -1
- package/lib/defaultTokenProvider.d.ts.map +0 -1
- package/lib/defaultTokenProvider.js.map +0 -1
- package/lib/definitions.d.ts.map +0 -1
- package/lib/definitions.js.map +0 -1
- package/lib/deltaStorageService.d.ts.map +0 -1
- package/lib/deltaStorageService.js +0 -77
- package/lib/deltaStorageService.js.map +0 -1
- package/lib/documentDeltaConnection.d.ts.map +0 -1
- package/lib/documentDeltaConnection.js.map +0 -1
- package/lib/documentService.d.ts.map +0 -1
- package/lib/documentService.js.map +0 -1
- package/lib/documentServiceFactory.d.ts.map +0 -1
- package/lib/documentServiceFactory.js.map +0 -1
- package/lib/documentStorageService.d.ts.map +0 -1
- package/lib/documentStorageService.js.map +0 -1
- package/lib/errorUtils.d.ts +0 -47
- package/lib/errorUtils.d.ts.map +0 -1
- package/lib/errorUtils.js +0 -50
- package/lib/errorUtils.js.map +0 -1
- package/lib/index.d.ts +0 -13
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -13
- package/lib/index.js.map +0 -1
- package/lib/nullBlobStorageService.d.ts.map +0 -1
- package/lib/nullBlobStorageService.js.map +0 -1
- package/lib/packageVersion.js.map +0 -1
- package/lib/policies.d.ts.map +0 -1
- package/lib/policies.js.map +0 -1
- package/lib/restWrapper.d.ts +0 -33
- package/lib/restWrapper.d.ts.map +0 -1
- package/lib/restWrapper.js +0 -144
- package/lib/restWrapper.js.map +0 -1
- package/lib/retriableGitManager.d.ts +0 -34
- package/lib/retriableGitManager.d.ts.map +0 -1
- package/lib/retriableGitManager.js +0 -72
- package/lib/retriableGitManager.js.map +0 -1
- package/lib/shreddedSummaryDocumentStorageService.d.ts.map +0 -1
- package/lib/shreddedSummaryDocumentStorageService.js.map +0 -1
- package/lib/tokens.d.ts.map +0 -1
- package/lib/tokens.js.map +0 -1
- package/lib/urlUtils.d.ts.map +0 -1
- package/lib/urlUtils.js +0 -42
- package/lib/urlUtils.js.map +0 -1
- package/lib/wholeSummaryDocumentStorageService.d.ts.map +0 -1
- package/lib/wholeSummaryDocumentStorageService.js +0 -187
- package/lib/wholeSummaryDocumentStorageService.js.map +0 -1
- package/tsconfig.esnext.json +0 -7
- /package/lib/{definitions.d.ts → definitions.d.mts} +0 -0
- /package/lib/{nullBlobStorageService.d.ts → nullBlobStorageService.d.mts} +0 -0
|
@@ -3,102 +3,110 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import
|
|
6
|
+
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
|
|
7
7
|
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
IDocumentStorageService,
|
|
9
|
+
IDocumentStorageServicePolicies,
|
|
10
|
+
LoaderCachingPolicy,
|
|
11
11
|
} from "@fluidframework/driver-definitions";
|
|
12
|
+
import { ISnapshotTree, IVersion } from "@fluidframework/protocol-definitions";
|
|
12
13
|
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} from "@fluidframework/
|
|
16
|
-
import {
|
|
17
|
-
GitManager,
|
|
18
|
-
} from "@fluidframework/server-services-client";
|
|
19
|
-
import { DocumentStorageServiceProxy, PrefetchDocumentStorageService } from "@fluidframework/driver-utils";
|
|
14
|
+
DocumentStorageServiceProxy,
|
|
15
|
+
PrefetchDocumentStorageService,
|
|
16
|
+
} from "@fluidframework/driver-utils";
|
|
20
17
|
import { IRouterliciousDriverPolicies } from "./policies";
|
|
21
18
|
import { ICache } from "./cache";
|
|
22
19
|
import { WholeSummaryDocumentStorageService } from "./wholeSummaryDocumentStorageService";
|
|
23
20
|
import { ShreddedSummaryDocumentStorageService } from "./shreddedSummaryDocumentStorageService";
|
|
21
|
+
import { GitManager } from "./gitManager";
|
|
24
22
|
import { ISnapshotTreeVersion } from "./definitions";
|
|
23
|
+
import { INormalizedWholeSnapshot } from "./contracts";
|
|
25
24
|
|
|
26
25
|
export class DocumentStorageService extends DocumentStorageServiceProxy {
|
|
27
|
-
|
|
26
|
+
private _logTailSha: string | undefined = undefined;
|
|
28
27
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
public get logTailSha(): string | undefined {
|
|
29
|
+
return this._logTailSha;
|
|
30
|
+
}
|
|
32
31
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
32
|
+
private static loadInternalDocumentStorageService(
|
|
33
|
+
id: string,
|
|
34
|
+
manager: GitManager,
|
|
35
|
+
logger: ITelemetryLoggerExt,
|
|
36
|
+
policies: IDocumentStorageServicePolicies,
|
|
37
|
+
driverPolicies?: IRouterliciousDriverPolicies,
|
|
38
|
+
blobCache?: ICache<ArrayBufferLike>,
|
|
39
|
+
snapshotTreeCache?: ICache<INormalizedWholeSnapshot>,
|
|
40
|
+
shreddedSummaryTreeCache?: ICache<ISnapshotTreeVersion>,
|
|
41
|
+
noCacheGitManager?: GitManager,
|
|
42
|
+
getStorageManager?: (disableCache?: boolean) => Promise<GitManager>,
|
|
43
|
+
): IDocumentStorageService {
|
|
44
|
+
const storageService = driverPolicies?.enableWholeSummaryUpload
|
|
45
|
+
? new WholeSummaryDocumentStorageService(
|
|
46
|
+
id,
|
|
47
|
+
manager,
|
|
48
|
+
logger,
|
|
49
|
+
policies,
|
|
50
|
+
driverPolicies,
|
|
51
|
+
blobCache,
|
|
52
|
+
snapshotTreeCache,
|
|
53
|
+
noCacheGitManager,
|
|
54
|
+
getStorageManager,
|
|
55
|
+
)
|
|
56
|
+
: new ShreddedSummaryDocumentStorageService(
|
|
57
|
+
id,
|
|
58
|
+
manager,
|
|
59
|
+
logger,
|
|
60
|
+
policies,
|
|
61
|
+
driverPolicies,
|
|
62
|
+
blobCache,
|
|
63
|
+
shreddedSummaryTreeCache,
|
|
64
|
+
getStorageManager,
|
|
65
|
+
);
|
|
66
|
+
// TODO: worth prefetching latest summary making version + snapshot call with WholeSummary storage?
|
|
67
|
+
if (
|
|
68
|
+
!driverPolicies?.enableWholeSummaryUpload &&
|
|
69
|
+
policies.caching === LoaderCachingPolicy.Prefetch
|
|
70
|
+
) {
|
|
71
|
+
return new PrefetchDocumentStorageService(storageService);
|
|
72
|
+
}
|
|
73
|
+
return storageService;
|
|
74
|
+
}
|
|
72
75
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
76
|
+
constructor(
|
|
77
|
+
public readonly id: string,
|
|
78
|
+
public manager: GitManager,
|
|
79
|
+
logger: ITelemetryLoggerExt,
|
|
80
|
+
policies: IDocumentStorageServicePolicies,
|
|
81
|
+
driverPolicies?: IRouterliciousDriverPolicies,
|
|
82
|
+
blobCache?: ICache<ArrayBufferLike>,
|
|
83
|
+
snapshotTreeCache?: ICache<INormalizedWholeSnapshot>,
|
|
84
|
+
shreddedSummaryTreeCache?: ICache<ISnapshotTreeVersion>,
|
|
85
|
+
public noCacheGitManager?: GitManager,
|
|
86
|
+
getStorageManager?: (disableCache?: boolean) => Promise<GitManager>,
|
|
87
|
+
) {
|
|
88
|
+
super(
|
|
89
|
+
DocumentStorageService.loadInternalDocumentStorageService(
|
|
90
|
+
id,
|
|
91
|
+
manager,
|
|
92
|
+
logger,
|
|
93
|
+
policies,
|
|
94
|
+
driverPolicies,
|
|
95
|
+
blobCache,
|
|
96
|
+
snapshotTreeCache,
|
|
97
|
+
shreddedSummaryTreeCache,
|
|
98
|
+
noCacheGitManager,
|
|
99
|
+
getStorageManager,
|
|
100
|
+
),
|
|
101
|
+
);
|
|
102
|
+
}
|
|
96
103
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
+
public async getSnapshotTree(version?: IVersion): Promise<ISnapshotTree | null> {
|
|
105
|
+
const tree = await this.internalStorageService.getSnapshotTree(version);
|
|
106
|
+
if (tree !== null) {
|
|
107
|
+
this._logTailSha =
|
|
108
|
+
".logTail" in tree.trees ? tree.trees[".logTail"].blobs.logTail : undefined;
|
|
109
|
+
}
|
|
110
|
+
return tree;
|
|
111
|
+
}
|
|
104
112
|
}
|
package/src/errorUtils.ts
CHANGED
|
@@ -3,17 +3,57 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { DriverError } from "@fluidframework/driver-definitions";
|
|
7
6
|
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
DriverError,
|
|
8
|
+
IDriverErrorBase,
|
|
9
|
+
DriverErrorTypes,
|
|
10
|
+
} from "@fluidframework/driver-definitions";
|
|
11
|
+
import {
|
|
12
|
+
NonRetryableError,
|
|
13
|
+
GenericNetworkError,
|
|
14
|
+
createGenericNetworkError,
|
|
15
|
+
AuthorizationError,
|
|
12
16
|
} from "@fluidframework/driver-utils";
|
|
17
|
+
import { IFluidErrorBase } from "@fluidframework/telemetry-utils";
|
|
13
18
|
import { pkgVersion as driverVersion } from "./packageVersion";
|
|
14
19
|
|
|
15
|
-
|
|
16
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Routerlicious Error types
|
|
22
|
+
* Different error types that may be thrown by the routerlicious driver
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
export const RouterliciousErrorTypes = {
|
|
26
|
+
// Inherit base driver error types
|
|
27
|
+
...DriverErrorTypes,
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* SSL Certificate Error.
|
|
31
|
+
*/
|
|
32
|
+
sslCertError: "sslCertError",
|
|
33
|
+
} as const;
|
|
34
|
+
/**
|
|
35
|
+
* @internal
|
|
36
|
+
*/
|
|
37
|
+
export type RouterliciousErrorTypes =
|
|
38
|
+
(typeof RouterliciousErrorTypes)[keyof typeof RouterliciousErrorTypes];
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Routerlicious Error types
|
|
42
|
+
* Different error types that may be thrown by the routerlicious driver
|
|
43
|
+
*
|
|
44
|
+
* @deprecated Use {@link (RouterliciousErrorTypes:variable)} instead.
|
|
45
|
+
* @internal
|
|
46
|
+
*/
|
|
47
|
+
export enum RouterliciousErrorType {
|
|
48
|
+
/**
|
|
49
|
+
* File not found, or file deleted during session
|
|
50
|
+
*/
|
|
51
|
+
fileNotFoundOrAccessDeniedError = "fileNotFoundOrAccessDeniedError",
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* SSL Certificate Error.
|
|
55
|
+
*/
|
|
56
|
+
sslCertError = "sslCertError",
|
|
17
57
|
}
|
|
18
58
|
|
|
19
59
|
/**
|
|
@@ -21,96 +61,94 @@ export enum R11sErrorType {
|
|
|
21
61
|
* Intended to be compatible with output from {@link NetworkError.toJSON}
|
|
22
62
|
*/
|
|
23
63
|
export interface IR11sSocketError {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
64
|
+
/**
|
|
65
|
+
* An error code number for the error that occurred.
|
|
66
|
+
* It will be a valid HTTP status code.
|
|
67
|
+
*/
|
|
68
|
+
code: number;
|
|
29
69
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
70
|
+
/**
|
|
71
|
+
* A message about the error that occurred for debugging / logging purposes.
|
|
72
|
+
* This should not be displayed to the user directly.
|
|
73
|
+
*/
|
|
74
|
+
message: string;
|
|
35
75
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
76
|
+
/**
|
|
77
|
+
* Optional Retry-After time in seconds.
|
|
78
|
+
* The client should wait this many seconds before retrying its request.
|
|
79
|
+
*/
|
|
80
|
+
retryAfter?: number;
|
|
41
81
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
82
|
+
/**
|
|
83
|
+
* Optional Retry-After time in milliseconds.
|
|
84
|
+
* The client should wait this many milliseconds before retrying its request.
|
|
85
|
+
*/
|
|
86
|
+
retryAfterMs?: number;
|
|
47
87
|
}
|
|
48
88
|
|
|
49
|
-
export interface IR11sError {
|
|
50
|
-
|
|
51
|
-
readonly message: string;
|
|
52
|
-
canRetry: boolean;
|
|
89
|
+
export interface IR11sError extends Omit<IDriverErrorBase, "errorType"> {
|
|
90
|
+
readonly errorType: RouterliciousErrorType;
|
|
53
91
|
}
|
|
54
92
|
|
|
55
93
|
export type R11sError = DriverError | IR11sError;
|
|
56
94
|
|
|
57
95
|
export function createR11sNetworkError(
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
): R11sError {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
96
|
+
errorMessage: string,
|
|
97
|
+
statusCode: number,
|
|
98
|
+
retryAfterMs?: number,
|
|
99
|
+
): IFluidErrorBase & R11sError {
|
|
100
|
+
let error: IFluidErrorBase & R11sError;
|
|
101
|
+
const props = { statusCode, driverVersion };
|
|
102
|
+
switch (statusCode) {
|
|
103
|
+
case 401:
|
|
104
|
+
// The first 401 is manually retried in RouterliciousRestWrapper with a refreshed token,
|
|
105
|
+
// so we treat repeat 401s the same as 403.
|
|
106
|
+
case 403:
|
|
107
|
+
error = new AuthorizationError(errorMessage, undefined, undefined, props);
|
|
108
|
+
break;
|
|
109
|
+
case 404:
|
|
110
|
+
const errorType = RouterliciousErrorType.fileNotFoundOrAccessDeniedError;
|
|
111
|
+
error = new NonRetryableError(errorMessage, errorType, props);
|
|
112
|
+
break;
|
|
113
|
+
case 429:
|
|
114
|
+
error = createGenericNetworkError(
|
|
115
|
+
errorMessage,
|
|
116
|
+
{ canRetry: true, retryAfterMs },
|
|
117
|
+
props,
|
|
118
|
+
);
|
|
119
|
+
break;
|
|
120
|
+
case 500:
|
|
121
|
+
case 502:
|
|
122
|
+
error = new GenericNetworkError(errorMessage, true, props);
|
|
123
|
+
break;
|
|
124
|
+
default:
|
|
125
|
+
const retryInfo = { canRetry: retryAfterMs !== undefined, retryAfterMs };
|
|
126
|
+
error = createGenericNetworkError(errorMessage, retryInfo, props);
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
error.addTelemetryProperties({ endpointReached: true });
|
|
130
|
+
return error;
|
|
89
131
|
}
|
|
90
132
|
|
|
91
133
|
export function throwR11sNetworkError(
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
134
|
+
errorMessage: string,
|
|
135
|
+
statusCode: number,
|
|
136
|
+
retryAfterMs?: number,
|
|
95
137
|
): never {
|
|
96
|
-
|
|
97
|
-
errorMessage,
|
|
98
|
-
statusCode,
|
|
99
|
-
retryAfterMs);
|
|
138
|
+
const networkError = createR11sNetworkError(errorMessage, statusCode, retryAfterMs);
|
|
100
139
|
|
|
101
|
-
|
|
102
|
-
|
|
140
|
+
// eslint-disable-next-line @typescript-eslint/no-throw-literal
|
|
141
|
+
throw networkError;
|
|
103
142
|
}
|
|
104
143
|
|
|
105
144
|
/**
|
|
106
145
|
* Returns network error based on error object from R11s socket (IR11sSocketError)
|
|
107
146
|
*/
|
|
108
|
-
export function errorObjectFromSocketError(
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
);
|
|
147
|
+
export function errorObjectFromSocketError(
|
|
148
|
+
socketError: IR11sSocketError,
|
|
149
|
+
handler: string,
|
|
150
|
+
): R11sError {
|
|
151
|
+
// pre-0.58 error message prefix: R11sSocketError
|
|
152
|
+
const message = `R11s socket error (${handler}): ${socketError.message}`;
|
|
153
|
+
return createR11sNetworkError(message, socketError.code, socketError.retryAfterMs);
|
|
116
154
|
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as resources from "@fluidframework/gitresources";
|
|
7
|
+
import {
|
|
8
|
+
IWholeSummaryPayload,
|
|
9
|
+
IWriteSummaryResponse,
|
|
10
|
+
} from "@fluidframework/server-services-client";
|
|
11
|
+
import { IGitManager, IHistorian } from "./storageContracts";
|
|
12
|
+
import { IR11sResponse } from "./restWrapper";
|
|
13
|
+
import { IWholeFlatSnapshot } from "./contracts";
|
|
14
|
+
|
|
15
|
+
export class GitManager implements IGitManager {
|
|
16
|
+
constructor(private readonly historian: IHistorian) {}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Reads the object with the given ID. We defer to the client implementation to do the actual read.
|
|
20
|
+
*/
|
|
21
|
+
public async getCommits(
|
|
22
|
+
sha: string,
|
|
23
|
+
count: number,
|
|
24
|
+
): Promise<IR11sResponse<resources.ICommitDetails[]>> {
|
|
25
|
+
return this.historian.getCommits(sha, count);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Reads the object with the given ID. We defer to the client implementation to do the actual read.
|
|
30
|
+
*/
|
|
31
|
+
public async getTree(root: string, recursive = true): Promise<IR11sResponse<resources.ITree>> {
|
|
32
|
+
return this.historian.getTree(root, recursive);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
public async getBlob(sha: string): Promise<IR11sResponse<resources.IBlob>> {
|
|
36
|
+
return this.historian.getBlob(sha);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
public async createBlob(
|
|
40
|
+
content: string,
|
|
41
|
+
encoding: "utf-8" | "base64",
|
|
42
|
+
): Promise<IR11sResponse<resources.ICreateBlobResponse>> {
|
|
43
|
+
const blob: resources.ICreateBlobParams = {
|
|
44
|
+
content,
|
|
45
|
+
encoding,
|
|
46
|
+
};
|
|
47
|
+
return this.historian.createBlob(blob);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
public async createGitTree(
|
|
51
|
+
params: resources.ICreateTreeParams,
|
|
52
|
+
): Promise<IR11sResponse<resources.ITree>> {
|
|
53
|
+
const treeP = this.historian.createTree(params);
|
|
54
|
+
return treeP;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
public async createSummary(
|
|
58
|
+
summary: IWholeSummaryPayload,
|
|
59
|
+
initial: boolean = false,
|
|
60
|
+
): Promise<IR11sResponse<IWriteSummaryResponse>> {
|
|
61
|
+
return this.historian.createSummary(summary, initial);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
public async getSnapshot(sha: string): Promise<IR11sResponse<IWholeFlatSnapshot>> {
|
|
65
|
+
return this.historian.getSnapshot(sha);
|
|
66
|
+
}
|
|
67
|
+
}
|
package/src/historian.ts
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { fromUtf8ToBase64 } from "@fluid-internal/client-utils";
|
|
7
|
+
import * as git from "@fluidframework/gitresources";
|
|
8
|
+
import {
|
|
9
|
+
IWholeSummaryPayload,
|
|
10
|
+
IWriteSummaryResponse,
|
|
11
|
+
} from "@fluidframework/server-services-client";
|
|
12
|
+
import { QueryStringType, RestWrapper } from "./restWrapperBase";
|
|
13
|
+
import { IR11sResponse } from "./restWrapper";
|
|
14
|
+
import { IHistorian } from "./storageContracts";
|
|
15
|
+
import { IWholeFlatSnapshot } from "./contracts";
|
|
16
|
+
|
|
17
|
+
export interface ICredentials {
|
|
18
|
+
user: string;
|
|
19
|
+
password: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const getAuthorizationTokenFromCredentials = (credentials: ICredentials): string =>
|
|
23
|
+
`Basic ${fromUtf8ToBase64(`${credentials.user}:${credentials.password}`)}`;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Implementation of the IHistorian interface that calls out to a REST interface
|
|
27
|
+
*/
|
|
28
|
+
export class Historian implements IHistorian {
|
|
29
|
+
private readonly defaultQueryString: QueryStringType = {};
|
|
30
|
+
private readonly cacheBust: boolean;
|
|
31
|
+
|
|
32
|
+
constructor(
|
|
33
|
+
private readonly historianApi: boolean,
|
|
34
|
+
disableCache: boolean,
|
|
35
|
+
private readonly restWrapper: RestWrapper,
|
|
36
|
+
) {
|
|
37
|
+
if (disableCache && this.historianApi) {
|
|
38
|
+
this.defaultQueryString.disableCache = disableCache;
|
|
39
|
+
this.cacheBust = false;
|
|
40
|
+
} else {
|
|
41
|
+
this.cacheBust = disableCache;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
public async getBlob(sha: string): Promise<IR11sResponse<git.IBlob>> {
|
|
46
|
+
return this.restWrapper.get<git.IBlob>(
|
|
47
|
+
`/git/blobs/${encodeURIComponent(sha)}`,
|
|
48
|
+
this.getQueryString(),
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
public async createBlob(
|
|
53
|
+
blob: git.ICreateBlobParams,
|
|
54
|
+
): Promise<IR11sResponse<git.ICreateBlobResponse>> {
|
|
55
|
+
return this.restWrapper.post<git.ICreateBlobResponse>(
|
|
56
|
+
`/git/blobs`,
|
|
57
|
+
blob,
|
|
58
|
+
this.getQueryString(),
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
public async getCommits(
|
|
63
|
+
sha: string,
|
|
64
|
+
count: number,
|
|
65
|
+
): Promise<IR11sResponse<git.ICommitDetails[]>> {
|
|
66
|
+
return this.restWrapper
|
|
67
|
+
.get<git.ICommitDetails[]>(`/commits`, this.getQueryString({ count, sha }))
|
|
68
|
+
.catch(async (error) =>
|
|
69
|
+
error.statusCode === 400 || error.statusCode === 404
|
|
70
|
+
? {
|
|
71
|
+
content: [],
|
|
72
|
+
headers: new Map(),
|
|
73
|
+
propsToLog: {},
|
|
74
|
+
requestUrl: "",
|
|
75
|
+
}
|
|
76
|
+
: Promise.reject<IR11sResponse<git.ICommitDetails[]>>(error),
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
public async createTree(tree: git.ICreateTreeParams): Promise<IR11sResponse<git.ITree>> {
|
|
81
|
+
return this.restWrapper.post<git.ITree>(`/git/trees`, tree, this.getQueryString());
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
public async getTree(sha: string, recursive: boolean): Promise<IR11sResponse<git.ITree>> {
|
|
85
|
+
return this.restWrapper.get<git.ITree>(
|
|
86
|
+
`/git/trees/${encodeURIComponent(sha)}`,
|
|
87
|
+
this.getQueryString({ recursive: recursive ? 1 : 0 }),
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
public async createSummary(
|
|
91
|
+
summary: IWholeSummaryPayload,
|
|
92
|
+
initial?: boolean,
|
|
93
|
+
): Promise<IR11sResponse<IWriteSummaryResponse>> {
|
|
94
|
+
return this.restWrapper.post<IWriteSummaryResponse>(
|
|
95
|
+
`/git/summaries`,
|
|
96
|
+
summary,
|
|
97
|
+
this.getQueryString(initial !== undefined ? { initial } : undefined),
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
public async getSnapshot(sha: string): Promise<IR11sResponse<IWholeFlatSnapshot>> {
|
|
102
|
+
return this.restWrapper.get<IWholeFlatSnapshot>(
|
|
103
|
+
`/git/summaries/${sha}`,
|
|
104
|
+
this.getQueryString(),
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
private getQueryString(queryString?: QueryStringType): QueryStringType {
|
|
109
|
+
if (this.cacheBust) {
|
|
110
|
+
return {
|
|
111
|
+
cacheBust: Date.now(),
|
|
112
|
+
...this.defaultQueryString,
|
|
113
|
+
...queryString,
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
return {
|
|
117
|
+
...this.defaultQueryString,
|
|
118
|
+
...queryString,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -3,11 +3,18 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
// Tokens
|
|
7
|
+
export { DefaultTokenProvider } from "./defaultTokenProvider";
|
|
8
|
+
export { ITokenProvider, ITokenResponse, ITokenService } from "./tokens";
|
|
9
|
+
|
|
10
|
+
// Errors
|
|
11
|
+
export { RouterliciousErrorType, RouterliciousErrorTypes } from "./errorUtils";
|
|
12
|
+
|
|
13
|
+
// Factory
|
|
14
|
+
export {
|
|
15
|
+
DocumentPostCreateError,
|
|
16
|
+
RouterliciousDocumentServiceFactory,
|
|
17
|
+
} from "./documentServiceFactory";
|
|
18
|
+
|
|
19
|
+
// Configuration
|
|
20
|
+
export { IRouterliciousDriverPolicies } from "./policies";
|