@fluidframework/routerlicious-driver 2.0.0-dev.5.3.2.178189 → 2.0.0-dev.6.4.0.191258
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 +59 -0
- package/README.md +4 -3
- package/dist/contracts.d.ts +28 -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.js +3 -3
- package/dist/createNewUtils.js.map +1 -1
- package/dist/deltaStorageService.d.ts.map +1 -1
- package/dist/deltaStorageService.js +17 -6
- package/dist/deltaStorageService.js.map +1 -1
- package/dist/documentDeltaConnection.js +1 -1
- package/dist/documentDeltaConnection.js.map +1 -1
- package/dist/documentService.d.ts +3 -3
- package/dist/documentService.d.ts.map +1 -1
- package/dist/documentService.js +4 -4
- package/dist/documentService.js.map +1 -1
- package/dist/documentServiceFactory.d.ts.map +1 -1
- package/dist/documentServiceFactory.js +32 -10
- package/dist/documentServiceFactory.js.map +1 -1
- package/dist/documentStorageService.d.ts +2 -2
- package/dist/documentStorageService.d.ts.map +1 -1
- package/dist/documentStorageService.js +2 -2
- package/dist/documentStorageService.js.map +1 -1
- package/dist/errorUtils.d.ts +38 -6
- package/dist/errorUtils.d.ts.map +1 -1
- package/dist/errorUtils.js +32 -16
- package/dist/errorUtils.js.map +1 -1
- package/dist/gitManager.d.ts +3 -2
- package/dist/gitManager.d.ts.map +1 -1
- package/dist/gitManager.js +2 -2
- package/dist/gitManager.js.map +1 -1
- package/dist/historian.d.ts +3 -2
- package/dist/historian.d.ts.map +1 -1
- package/dist/historian.js +13 -6
- package/dist/historian.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/mapWithExpiration.js +2 -2
- package/dist/mapWithExpiration.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/policies.d.ts +7 -1
- package/dist/policies.d.ts.map +1 -1
- package/dist/policies.js.map +1 -1
- package/dist/r11sSnapshotParser.d.ts +4 -5
- package/dist/r11sSnapshotParser.d.ts.map +1 -1
- package/dist/r11sSnapshotParser.js +13 -15
- package/dist/r11sSnapshotParser.js.map +1 -1
- package/dist/restWrapper.d.ts +3 -3
- package/dist/restWrapper.d.ts.map +1 -1
- package/dist/restWrapper.js +53 -36
- package/dist/restWrapper.js.map +1 -1
- package/dist/restWrapperBase.js +39 -5
- package/dist/restWrapperBase.js.map +1 -1
- package/dist/retriableGitManager.d.ts +3 -2
- package/dist/retriableGitManager.d.ts.map +1 -1
- package/dist/retriableGitManager.js +2 -2
- package/dist/retriableGitManager.js.map +1 -1
- package/dist/shreddedSummaryDocumentStorageService.js +13 -16
- package/dist/shreddedSummaryDocumentStorageService.js.map +1 -1
- package/dist/storageContracts.d.ts +4 -3
- package/dist/storageContracts.d.ts.map +1 -1
- package/dist/storageContracts.js.map +1 -1
- package/dist/summaryTreeUploadManager.d.ts.map +1 -1
- package/dist/summaryTreeUploadManager.js +11 -11
- package/dist/summaryTreeUploadManager.js.map +1 -1
- package/dist/treeUtils.d.ts +2 -2
- package/dist/treeUtils.d.ts.map +1 -1
- package/dist/treeUtils.js +8 -8
- package/dist/treeUtils.js.map +1 -1
- package/dist/wholeSummaryDocumentStorageService.d.ts +2 -2
- package/dist/wholeSummaryDocumentStorageService.d.ts.map +1 -1
- package/dist/wholeSummaryDocumentStorageService.js +27 -22
- package/dist/wholeSummaryDocumentStorageService.js.map +1 -1
- package/dist/wholeSummaryUploadManager.js +1 -2
- package/dist/wholeSummaryUploadManager.js.map +1 -1
- package/lib/contracts.d.ts +28 -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.js +2 -2
- package/lib/createNewUtils.js.map +1 -1
- package/lib/deltaStorageService.d.ts.map +1 -1
- package/lib/deltaStorageService.js +17 -6
- package/lib/deltaStorageService.js.map +1 -1
- package/lib/documentDeltaConnection.js +1 -1
- package/lib/documentDeltaConnection.js.map +1 -1
- package/lib/documentService.d.ts +3 -3
- package/lib/documentService.d.ts.map +1 -1
- package/lib/documentService.js +4 -4
- package/lib/documentService.js.map +1 -1
- package/lib/documentServiceFactory.d.ts.map +1 -1
- package/lib/documentServiceFactory.js +32 -10
- package/lib/documentServiceFactory.js.map +1 -1
- package/lib/documentStorageService.d.ts +2 -2
- package/lib/documentStorageService.d.ts.map +1 -1
- package/lib/documentStorageService.js +2 -2
- package/lib/documentStorageService.js.map +1 -1
- package/lib/errorUtils.d.ts +38 -6
- package/lib/errorUtils.d.ts.map +1 -1
- package/lib/errorUtils.js +31 -15
- package/lib/errorUtils.js.map +1 -1
- package/lib/gitManager.d.ts +3 -2
- package/lib/gitManager.d.ts.map +1 -1
- package/lib/gitManager.js +2 -2
- package/lib/gitManager.js.map +1 -1
- package/lib/historian.d.ts +3 -2
- package/lib/historian.d.ts.map +1 -1
- package/lib/historian.js +12 -5
- package/lib/historian.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/mapWithExpiration.js +1 -1
- package/lib/mapWithExpiration.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/policies.d.ts +7 -1
- package/lib/policies.d.ts.map +1 -1
- package/lib/policies.js.map +1 -1
- package/lib/r11sSnapshotParser.d.ts +4 -5
- package/lib/r11sSnapshotParser.d.ts.map +1 -1
- package/lib/r11sSnapshotParser.js +11 -13
- package/lib/r11sSnapshotParser.js.map +1 -1
- package/lib/restWrapper.d.ts +3 -3
- package/lib/restWrapper.d.ts.map +1 -1
- package/lib/restWrapper.js +48 -31
- package/lib/restWrapper.js.map +1 -1
- package/lib/restWrapperBase.js +39 -5
- package/lib/restWrapperBase.js.map +1 -1
- package/lib/retriableGitManager.d.ts +3 -2
- package/lib/retriableGitManager.d.ts.map +1 -1
- package/lib/retriableGitManager.js +2 -2
- package/lib/retriableGitManager.js.map +1 -1
- package/lib/shreddedSummaryDocumentStorageService.js +12 -15
- package/lib/shreddedSummaryDocumentStorageService.js.map +1 -1
- package/lib/storageContracts.d.ts +4 -3
- package/lib/storageContracts.d.ts.map +1 -1
- package/lib/storageContracts.js.map +1 -1
- package/lib/summaryTreeUploadManager.d.ts.map +1 -1
- package/lib/summaryTreeUploadManager.js +4 -4
- package/lib/summaryTreeUploadManager.js.map +1 -1
- package/lib/treeUtils.d.ts +2 -2
- package/lib/treeUtils.d.ts.map +1 -1
- package/lib/treeUtils.js +4 -4
- package/lib/treeUtils.js.map +1 -1
- package/lib/wholeSummaryDocumentStorageService.d.ts +2 -2
- package/lib/wholeSummaryDocumentStorageService.d.ts.map +1 -1
- package/lib/wholeSummaryDocumentStorageService.js +23 -18
- package/lib/wholeSummaryDocumentStorageService.js.map +1 -1
- package/lib/wholeSummaryUploadManager.js +1 -2
- package/lib/wholeSummaryUploadManager.js.map +1 -1
- package/package.json +26 -28
- package/src/contracts.ts +45 -1
- package/src/createNewUtils.ts +2 -2
- package/src/deltaStorageService.ts +8 -1
- package/src/documentService.ts +5 -5
- package/src/documentServiceFactory.ts +21 -11
- package/src/documentStorageService.ts +3 -3
- package/src/errorUtils.ts +48 -30
- package/src/gitManager.ts +3 -3
- package/src/historian.ts +5 -5
- package/src/index.ts +1 -1
- package/src/mapWithExpiration.ts +1 -1
- package/src/packageVersion.ts +1 -1
- package/src/policies.ts +7 -1
- package/src/r11sSnapshotParser.ts +14 -15
- package/src/restWrapper.ts +34 -21
- package/src/retriableGitManager.ts +3 -3
- package/src/shreddedSummaryDocumentStorageService.ts +3 -3
- package/src/storageContracts.ts +3 -3
- package/src/summaryTreeUploadManager.ts +2 -7
- package/src/treeUtils.ts +4 -3
- package/src/wholeSummaryDocumentStorageService.ts +14 -19
package/lib/errorUtils.d.ts
CHANGED
|
@@ -2,16 +2,50 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { DriverError } from "@fluidframework/driver-definitions";
|
|
5
|
+
import { DriverError, IDriverErrorBase } from "@fluidframework/driver-definitions";
|
|
6
|
+
import { IFluidErrorBase } from "@fluidframework/telemetry-utils";
|
|
6
7
|
/**
|
|
7
8
|
* Routerlicious Error types
|
|
8
9
|
* Different error types that may be thrown by the routerlicious driver
|
|
9
10
|
*/
|
|
11
|
+
export declare const RouterliciousErrorTypes: {
|
|
12
|
+
/**
|
|
13
|
+
* SSL Certificate Error.
|
|
14
|
+
*/
|
|
15
|
+
readonly sslCertError: "sslCertError";
|
|
16
|
+
readonly genericNetworkError: "genericNetworkError";
|
|
17
|
+
readonly authorizationError: "authorizationError";
|
|
18
|
+
readonly fileNotFoundOrAccessDeniedError: "fileNotFoundOrAccessDeniedError";
|
|
19
|
+
readonly offlineError: "offlineError";
|
|
20
|
+
readonly unsupportedClientProtocolVersion: "unsupportedClientProtocolVersion";
|
|
21
|
+
readonly writeError: "writeError";
|
|
22
|
+
readonly fetchFailure: "fetchFailure";
|
|
23
|
+
readonly fetchTokenError: "fetchTokenError";
|
|
24
|
+
readonly incorrectServerResponse: "incorrectServerResponse";
|
|
25
|
+
readonly fileOverwrittenInStorage: "fileOverwrittenInStorage";
|
|
26
|
+
readonly deltaStreamConnectionForbidden: "deltaStreamConnectionForbidden";
|
|
27
|
+
readonly locationRedirection: "locationRedirection";
|
|
28
|
+
readonly fluidInvalidSchema: "fluidInvalidSchema";
|
|
29
|
+
readonly fileIsLocked: "fileIsLocked";
|
|
30
|
+
readonly genericError: "genericError";
|
|
31
|
+
readonly throttlingError: "throttlingError";
|
|
32
|
+
readonly usageError: "usageError";
|
|
33
|
+
};
|
|
34
|
+
export declare type RouterliciousErrorTypes = typeof RouterliciousErrorTypes[keyof typeof RouterliciousErrorTypes];
|
|
35
|
+
/**
|
|
36
|
+
* Routerlicious Error types
|
|
37
|
+
* Different error types that may be thrown by the routerlicious driver
|
|
38
|
+
*
|
|
39
|
+
* @deprecated Use {@link (RouterliciousErrorTypes:variable)} instead.
|
|
40
|
+
*/
|
|
10
41
|
export declare enum RouterliciousErrorType {
|
|
11
42
|
/**
|
|
12
43
|
* File not found, or file deleted during session
|
|
13
44
|
*/
|
|
14
45
|
fileNotFoundOrAccessDeniedError = "fileNotFoundOrAccessDeniedError",
|
|
46
|
+
/**
|
|
47
|
+
* SSL Certificate Error.
|
|
48
|
+
*/
|
|
15
49
|
sslCertError = "sslCertError"
|
|
16
50
|
}
|
|
17
51
|
/**
|
|
@@ -40,14 +74,12 @@ export interface IR11sSocketError {
|
|
|
40
74
|
*/
|
|
41
75
|
retryAfterMs?: number;
|
|
42
76
|
}
|
|
43
|
-
export interface IR11sError {
|
|
77
|
+
export interface IR11sError extends Omit<IDriverErrorBase, "errorType"> {
|
|
44
78
|
readonly errorType: RouterliciousErrorType;
|
|
45
|
-
readonly message: string;
|
|
46
|
-
canRetry: boolean;
|
|
47
79
|
}
|
|
48
80
|
export declare type R11sError = DriverError | IR11sError;
|
|
49
|
-
export declare function createR11sNetworkError(errorMessage: string, statusCode
|
|
50
|
-
export declare function throwR11sNetworkError(errorMessage: string, statusCode
|
|
81
|
+
export declare function createR11sNetworkError(errorMessage: string, statusCode: number, retryAfterMs?: number): IFluidErrorBase & R11sError;
|
|
82
|
+
export declare function throwR11sNetworkError(errorMessage: string, statusCode: number, retryAfterMs?: number): never;
|
|
51
83
|
/**
|
|
52
84
|
* Returns network error based on error object from R11s socket (IR11sSocketError)
|
|
53
85
|
*/
|
package/lib/errorUtils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errorUtils.d.ts","sourceRoot":"","sources":["../src/errorUtils.ts"],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W,EAAE,gBAAgB,EAC7B,OAAO,EAAE,MAAM,GACb,SAAS,CAIX"}
|
package/lib/errorUtils.js
CHANGED
|
@@ -2,50 +2,66 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
+
import { DriverErrorTypes, } from "@fluidframework/driver-definitions";
|
|
5
6
|
import { NonRetryableError, GenericNetworkError, createGenericNetworkError, AuthorizationError, } from "@fluidframework/driver-utils";
|
|
6
7
|
import { pkgVersion as driverVersion } from "./packageVersion";
|
|
7
8
|
/**
|
|
8
9
|
* Routerlicious Error types
|
|
9
10
|
* Different error types that may be thrown by the routerlicious driver
|
|
10
11
|
*/
|
|
12
|
+
export const RouterliciousErrorTypes = {
|
|
13
|
+
// Inherit base driver error types
|
|
14
|
+
...DriverErrorTypes,
|
|
15
|
+
/**
|
|
16
|
+
* SSL Certificate Error.
|
|
17
|
+
*/
|
|
18
|
+
sslCertError: "sslCertError",
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Routerlicious Error types
|
|
22
|
+
* Different error types that may be thrown by the routerlicious driver
|
|
23
|
+
*
|
|
24
|
+
* @deprecated Use {@link (RouterliciousErrorTypes:variable)} instead.
|
|
25
|
+
*/
|
|
11
26
|
export var RouterliciousErrorType;
|
|
12
27
|
(function (RouterliciousErrorType) {
|
|
13
28
|
/**
|
|
14
29
|
* File not found, or file deleted during session
|
|
15
30
|
*/
|
|
16
31
|
RouterliciousErrorType["fileNotFoundOrAccessDeniedError"] = "fileNotFoundOrAccessDeniedError";
|
|
32
|
+
/**
|
|
33
|
+
* SSL Certificate Error.
|
|
34
|
+
*/
|
|
17
35
|
RouterliciousErrorType["sslCertError"] = "sslCertError";
|
|
18
36
|
})(RouterliciousErrorType || (RouterliciousErrorType = {}));
|
|
19
37
|
export function createR11sNetworkError(errorMessage, statusCode, retryAfterMs) {
|
|
38
|
+
let error;
|
|
20
39
|
const props = { statusCode, driverVersion };
|
|
21
40
|
switch (statusCode) {
|
|
22
|
-
case undefined:
|
|
23
|
-
// If a service is temporarily down or a browser resource limit is reached, RestWrapper will throw
|
|
24
|
-
// a network error with no status code (e.g. err:ERR_CONN_REFUSED or err:ERR_FAILED) and
|
|
25
|
-
// the error message will start with NetworkError as defined in restWrapper.ts
|
|
26
|
-
// If there exists a self-signed SSL certificates error, throw a NonRetryableError
|
|
27
|
-
// TODO: instead of relying on string matching, filter error based on the error code like we do for websocket connections
|
|
28
|
-
if (errorMessage.includes("failed, reason: self signed certificate")) {
|
|
29
|
-
return new NonRetryableError(errorMessage, RouterliciousErrorType.sslCertError, props);
|
|
30
|
-
}
|
|
31
|
-
return new GenericNetworkError(errorMessage, errorMessage.startsWith("NetworkError"), props);
|
|
32
41
|
case 401:
|
|
33
42
|
// The first 401 is manually retried in RouterliciousRestWrapper with a refreshed token,
|
|
34
43
|
// so we treat repeat 401s the same as 403.
|
|
35
44
|
case 403:
|
|
36
|
-
|
|
45
|
+
error = new AuthorizationError(errorMessage, undefined, undefined, props);
|
|
46
|
+
break;
|
|
37
47
|
case 404:
|
|
38
48
|
const errorType = RouterliciousErrorType.fileNotFoundOrAccessDeniedError;
|
|
39
|
-
|
|
49
|
+
error = new NonRetryableError(errorMessage, errorType, props);
|
|
50
|
+
break;
|
|
40
51
|
case 429:
|
|
41
|
-
|
|
52
|
+
error = createGenericNetworkError(errorMessage, { canRetry: true, retryAfterMs }, props);
|
|
53
|
+
break;
|
|
42
54
|
case 500:
|
|
43
55
|
case 502:
|
|
44
|
-
|
|
56
|
+
error = new GenericNetworkError(errorMessage, true, props);
|
|
57
|
+
break;
|
|
45
58
|
default:
|
|
46
59
|
const retryInfo = { canRetry: retryAfterMs !== undefined, retryAfterMs };
|
|
47
|
-
|
|
60
|
+
error = createGenericNetworkError(errorMessage, retryInfo, props);
|
|
61
|
+
break;
|
|
48
62
|
}
|
|
63
|
+
error.addTelemetryProperties({ endpointReached: true });
|
|
64
|
+
return error;
|
|
49
65
|
}
|
|
50
66
|
export function throwR11sNetworkError(errorMessage, statusCode, retryAfterMs) {
|
|
51
67
|
const networkError = createR11sNetworkError(errorMessage, statusCode, retryAfterMs);
|
package/lib/errorUtils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errorUtils.js","sourceRoot":"","sources":["../src/errorUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"errorUtils.js","sourceRoot":"","sources":["../src/errorUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAGN,gBAAgB,GAChB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACN,iBAAiB,EACjB,mBAAmB,EACnB,yBAAyB,EACzB,kBAAkB,GAClB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,UAAU,IAAI,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE/D;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACtC,kCAAkC;IAClC,GAAG,gBAAgB;IAEnB;;OAEG;IACH,YAAY,EAAE,cAAc;CACnB,CAAC;AAIX;;;;;GAKG;AACH,MAAM,CAAN,IAAY,sBAUX;AAVD,WAAY,sBAAsB;IACjC;;OAEG;IACH,6FAAmE,CAAA;IAEnE;;OAEG;IACH,uDAA6B,CAAA;AAC9B,CAAC,EAVW,sBAAsB,KAAtB,sBAAsB,QAUjC;AAsCD,MAAM,UAAU,sBAAsB,CACrC,YAAoB,EACpB,UAAkB,EAClB,YAAqB;IAErB,IAAI,KAAkC,CAAC;IACvC,MAAM,KAAK,GAAG,EAAE,UAAU,EAAE,aAAa,EAAE,CAAC;IAC5C,QAAQ,UAAU,EAAE;QACnB,KAAK,GAAG,CAAC;QACT,wFAAwF;QACxF,2CAA2C;QAC3C,KAAK,GAAG;YACP,KAAK,GAAG,IAAI,kBAAkB,CAAC,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,CAA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poration and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tDriverError,\n\tIDriverErrorBase,\n\tDriverErrorTypes,\n} from \"@fluidframework/driver-definitions\";\nimport {\n\tNonRetryableError,\n\tGenericNetworkError,\n\tcreateGenericNetworkError,\n\tAuthorizationError,\n} from \"@fluidframework/driver-utils\";\nimport { IFluidErrorBase } from \"@fluidframework/telemetry-utils\";\nimport { pkgVersion as driverVersion } from \"./packageVersion\";\n\n/**\n * Routerlicious Error types\n * Different error types that may be thrown by the routerlicious driver\n */\nexport const RouterliciousErrorTypes = {\n\t// Inherit base driver error types\n\t...DriverErrorTypes,\n\n\t/**\n\t * SSL Certificate Error.\n\t */\n\tsslCertError: \"sslCertError\",\n} as const;\nexport type RouterliciousErrorTypes =\n\ttypeof RouterliciousErrorTypes[keyof typeof RouterliciousErrorTypes];\n\n/**\n * Routerlicious Error types\n * Different error types that may be thrown by the routerlicious driver\n *\n * @deprecated Use {@link (RouterliciousErrorTypes:variable)} instead.\n */\nexport enum RouterliciousErrorType {\n\t/**\n\t * File not found, or file deleted during session\n\t */\n\tfileNotFoundOrAccessDeniedError = \"fileNotFoundOrAccessDeniedError\",\n\n\t/**\n\t * SSL Certificate Error.\n\t */\n\tsslCertError = \"sslCertError\",\n}\n\n/**\n * Interface for error responses for the WebSocket connection\n * Intended to be compatible with output from {@link NetworkError.toJSON}\n */\nexport interface IR11sSocketError {\n\t/**\n\t * An error code number for the error that occurred.\n\t * It will be a valid HTTP status code.\n\t */\n\tcode: number;\n\n\t/**\n\t * A message about the error that occurred for debugging / logging purposes.\n\t * This should not be displayed to the user directly.\n\t */\n\tmessage: string;\n\n\t/**\n\t * Optional Retry-After time in seconds.\n\t * The client should wait this many seconds before retrying its request.\n\t */\n\tretryAfter?: number;\n\n\t/**\n\t * Optional Retry-After time in milliseconds.\n\t * The client should wait this many milliseconds before retrying its request.\n\t */\n\tretryAfterMs?: number;\n}\n\nexport interface IR11sError extends Omit<IDriverErrorBase, \"errorType\"> {\n\treadonly errorType: RouterliciousErrorType;\n}\n\nexport type R11sError = DriverError | IR11sError;\n\nexport function createR11sNetworkError(\n\terrorMessage: string,\n\tstatusCode: number,\n\tretryAfterMs?: number,\n): IFluidErrorBase & R11sError {\n\tlet error: IFluidErrorBase & R11sError;\n\tconst props = { statusCode, driverVersion };\n\tswitch (statusCode) {\n\t\tcase 401:\n\t\t// The first 401 is manually retried in RouterliciousRestWrapper with a refreshed token,\n\t\t// so we treat repeat 401s the same as 403.\n\t\tcase 403:\n\t\t\terror = new AuthorizationError(errorMessage, undefined, undefined, props);\n\t\t\tbreak;\n\t\tcase 404:\n\t\t\tconst errorType = RouterliciousErrorType.fileNotFoundOrAccessDeniedError;\n\t\t\terror = new NonRetryableError(errorMessage, errorType, props);\n\t\t\tbreak;\n\t\tcase 429:\n\t\t\terror = createGenericNetworkError(\n\t\t\t\terrorMessage,\n\t\t\t\t{ canRetry: true, retryAfterMs },\n\t\t\t\tprops,\n\t\t\t);\n\t\t\tbreak;\n\t\tcase 500:\n\t\tcase 502:\n\t\t\terror = new GenericNetworkError(errorMessage, true, props);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tconst retryInfo = { canRetry: retryAfterMs !== undefined, retryAfterMs };\n\t\t\terror = createGenericNetworkError(errorMessage, retryInfo, props);\n\t\t\tbreak;\n\t}\n\terror.addTelemetryProperties({ endpointReached: true });\n\treturn error;\n}\n\nexport function throwR11sNetworkError(\n\terrorMessage: string,\n\tstatusCode: number,\n\tretryAfterMs?: number,\n): never {\n\tconst networkError = createR11sNetworkError(errorMessage, statusCode, retryAfterMs);\n\n\t// eslint-disable-next-line @typescript-eslint/no-throw-literal\n\tthrow networkError;\n}\n\n/**\n * Returns network error based on error object from R11s socket (IR11sSocketError)\n */\nexport function errorObjectFromSocketError(\n\tsocketError: IR11sSocketError,\n\thandler: string,\n): R11sError {\n\t// pre-0.58 error message prefix: R11sSocketError\n\tconst message = `R11s socket error (${handler}): ${socketError.message}`;\n\treturn createR11sNetworkError(message, socketError.code, socketError.retryAfterMs);\n}\n"]}
|
package/lib/gitManager.d.ts
CHANGED
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import * as resources from "@fluidframework/gitresources";
|
|
6
|
-
import {
|
|
6
|
+
import { IWholeSummaryPayload, IWriteSummaryResponse } from "@fluidframework/server-services-client";
|
|
7
7
|
import { IGitManager, IHistorian } from "./storageContracts";
|
|
8
8
|
import { IR11sResponse } from "./restWrapper";
|
|
9
|
+
import { IWholeFlatSnapshot } from "./contracts";
|
|
9
10
|
export declare class GitManager implements IGitManager {
|
|
10
11
|
private readonly historian;
|
|
11
12
|
private readonly blobCache;
|
|
@@ -25,6 +26,6 @@ export declare class GitManager implements IGitManager {
|
|
|
25
26
|
createBlob(content: string, encoding: "utf-8" | "base64"): Promise<IR11sResponse<resources.ICreateBlobResponse>>;
|
|
26
27
|
createGitTree(params: resources.ICreateTreeParams): Promise<IR11sResponse<resources.ITree>>;
|
|
27
28
|
createSummary(summary: IWholeSummaryPayload, initial?: boolean): Promise<IR11sResponse<IWriteSummaryResponse>>;
|
|
28
|
-
|
|
29
|
+
getSnapshot(sha: string): Promise<IR11sResponse<IWholeFlatSnapshot>>;
|
|
29
30
|
}
|
|
30
31
|
//# sourceMappingURL=gitManager.d.ts.map
|
package/lib/gitManager.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitManager.d.ts","sourceRoot":"","sources":["../src/gitManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,SAAS,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EACN,
|
|
1
|
+
{"version":3,"file":"gitManager.d.ts","sourceRoot":"","sources":["../src/gitManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,SAAS,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EACN,oBAAoB,EACpB,qBAAqB,EACrB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AAG,OAAO,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC;CAGjF"}
|
package/lib/gitManager.js
CHANGED
|
@@ -78,8 +78,8 @@ export class GitManager {
|
|
|
78
78
|
async createSummary(summary, initial = false) {
|
|
79
79
|
return this.historian.createSummary(summary, initial);
|
|
80
80
|
}
|
|
81
|
-
async
|
|
82
|
-
return this.historian.
|
|
81
|
+
async getSnapshot(sha) {
|
|
82
|
+
return this.historian.getSnapshot(sha);
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
//# sourceMappingURL=gitManager.js.map
|
package/lib/gitManager.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitManager.js","sourceRoot":"","sources":["../src/gitManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"gitManager.js","sourceRoot":"","sources":["../src/gitManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EAAiB,6BAA6B,EAAE,MAAM,eAAe,CAAC;AAG7E,MAAM,OAAO,UAAU;IAMtB,YAA6B,SAAqB;QAArB,cAAS,GAAT,SAAS,CAAY;QALjC,cAAS,GAAG,IAAI,GAAG,EAA2B,CAAC;QAC/C,gBAAW,GAAG,IAAI,GAAG,EAA6B,CAAC;QACnD,cAAS,GAAG,IAAI,GAAG,EAA2B,CAAC;QAC/C,aAAQ,GAAG,IAAI,GAAG,EAAkB,CAAC;IAED,CAAC;IAEtD;;OAEG;IACI,KAAK,CAAC,UAAU,CACtB,QAAgB,EAChB,KAAa;QAEb,IAAI,GAAG,GAAuB,QAAQ,CAAC;QAEvC,6CAA6C;QAC7C,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;YAChC,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;YAElC,kCAAkC;YAClC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC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CAAC,CAAC;SAC3C;QACD,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACpC,CAAC;IAEM,KAAK,CAAC,UAAU,CACtB,OAAe,EACf,QAA4B;QAE5B,MAAM,IAAI,GAAgC;YACzC,OAAO;YACP,QAAQ;SACR,CAAC;QACF,OAAO,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;IAEM,KAAK,CAAC,aAAa,CACzB,MAAmC;QAEnC,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QAChD,OAAO,KAAK,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,aAAa,CACzB,OAA6B,EAC7B,UAAmB,KAAK;QAExB,OAAO,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACvD,CAAC;IAEM,KAAK,CAAC,WAAW,CAAC,GAAW;QACnC,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IACxC,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as resources from \"@fluidframework/gitresources\";\nimport {\n\tIWholeSummaryPayload,\n\tIWriteSummaryResponse,\n} from \"@fluidframework/server-services-client\";\nimport { IGitManager, IHistorian } from \"./storageContracts\";\nimport { IR11sResponse, createR11sResponseFromContent } from \"./restWrapper\";\nimport { IWholeFlatSnapshot } from \"./contracts\";\n\nexport class GitManager implements IGitManager {\n\tprivate readonly blobCache = new Map<string, resources.IBlob>();\n\tprivate readonly commitCache = new Map<string, resources.ICommit>();\n\tprivate readonly treeCache = new Map<string, resources.ITree>();\n\tprivate readonly refCache = new Map<string, string>();\n\n\tconstructor(private readonly historian: IHistorian) {}\n\n\t/**\n\t * Reads the object with the given ID. We defer to the client implementation to do the actual read.\n\t */\n\tpublic async getCommits(\n\t\tshaOrRef: string,\n\t\tcount: number,\n\t): Promise<IR11sResponse<resources.ICommitDetails[]>> {\n\t\tlet sha: string | undefined = shaOrRef;\n\n\t\t// See if the sha is really a ref and convert\n\t\tif (this.refCache.has(shaOrRef)) {\n\t\t\tsha = this.refCache.get(shaOrRef);\n\n\t\t\t// Delete refcache after first use\n\t\t\tthis.refCache.delete(shaOrRef);\n\n\t\t\t// If null is stored for the ref then there are no commits - return an empty array\n\t\t\tif (!sha) {\n\t\t\t\treturn createR11sResponseFromContent([]);\n\t\t\t}\n\t\t}\n\n\t\t// See if the commit sha is hashed and return it if so\n\t\tconst commit = this.commitCache.get(sha);\n\t\tif (commit !== undefined) {\n\t\t\treturn createR11sResponseFromContent([\n\t\t\t\t{\n\t\t\t\t\tcommit: {\n\t\t\t\t\t\tauthor: commit.author,\n\t\t\t\t\t\tcommitter: commit.committer,\n\t\t\t\t\t\tmessage: commit.message,\n\t\t\t\t\t\ttree: commit.tree,\n\t\t\t\t\t\turl: commit.url,\n\t\t\t\t\t},\n\t\t\t\t\tparents: commit.parents,\n\t\t\t\t\tsha: commit.sha,\n\t\t\t\t\turl: commit.url,\n\t\t\t\t},\n\t\t\t]);\n\t\t}\n\n\t\t// Otherwise fall back to the historian\n\t\treturn this.historian.getCommits(sha, count);\n\t}\n\n\t/**\n\t * Reads the object with the given ID. We defer to the client implementation to do the actual read.\n\t */\n\tpublic async getTree(root: string, recursive = true): Promise<IR11sResponse<resources.ITree>> {\n\t\tconst tree = this.treeCache.get(root);\n\t\tif (tree !== undefined) {\n\t\t\treturn createR11sResponseFromContent(tree);\n\t\t}\n\n\t\treturn this.historian.getTree(root, recursive);\n\t}\n\n\tpublic async getBlob(sha: string): Promise<IR11sResponse<resources.IBlob>> {\n\t\tconst blob = this.blobCache.get(sha);\n\t\tif (blob !== undefined) {\n\t\t\treturn createR11sResponseFromContent(blob);\n\t\t}\n\t\treturn this.historian.getBlob(sha);\n\t}\n\n\tpublic async createBlob(\n\t\tcontent: string,\n\t\tencoding: \"utf-8\" | \"base64\",\n\t): Promise<IR11sResponse<resources.ICreateBlobResponse>> {\n\t\tconst blob: resources.ICreateBlobParams = {\n\t\t\tcontent,\n\t\t\tencoding,\n\t\t};\n\t\treturn this.historian.createBlob(blob);\n\t}\n\n\tpublic async createGitTree(\n\t\tparams: resources.ICreateTreeParams,\n\t): Promise<IR11sResponse<resources.ITree>> {\n\t\tconst treeP = this.historian.createTree(params);\n\t\treturn treeP;\n\t}\n\n\tpublic async createSummary(\n\t\tsummary: IWholeSummaryPayload,\n\t\tinitial: boolean = false,\n\t): Promise<IR11sResponse<IWriteSummaryResponse>> {\n\t\treturn this.historian.createSummary(summary, initial);\n\t}\n\n\tpublic async getSnapshot(sha: string): Promise<IR11sResponse<IWholeFlatSnapshot>> {\n\t\treturn this.historian.getSnapshot(sha);\n\t}\n}\n"]}
|
package/lib/historian.d.ts
CHANGED
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import * as git from "@fluidframework/gitresources";
|
|
6
|
-
import {
|
|
6
|
+
import { IWholeSummaryPayload, IWriteSummaryResponse } from "@fluidframework/server-services-client";
|
|
7
7
|
import { RestWrapper } from "./restWrapperBase";
|
|
8
8
|
import { IR11sResponse } from "./restWrapper";
|
|
9
9
|
import { IHistorian } from "./storageContracts";
|
|
10
|
+
import { IWholeFlatSnapshot } from "./contracts";
|
|
10
11
|
export interface ICredentials {
|
|
11
12
|
user: string;
|
|
12
13
|
password: string;
|
|
@@ -27,7 +28,7 @@ export declare class Historian implements IHistorian {
|
|
|
27
28
|
createTree(tree: git.ICreateTreeParams): Promise<IR11sResponse<git.ITree>>;
|
|
28
29
|
getTree(sha: string, recursive: boolean): Promise<IR11sResponse<git.ITree>>;
|
|
29
30
|
createSummary(summary: IWholeSummaryPayload, initial?: boolean): Promise<IR11sResponse<IWriteSummaryResponse>>;
|
|
30
|
-
|
|
31
|
+
getSnapshot(sha: string): Promise<IR11sResponse<IWholeFlatSnapshot>>;
|
|
31
32
|
private getQueryString;
|
|
32
33
|
}
|
|
33
34
|
//# sourceMappingURL=historian.d.ts.map
|
package/lib/historian.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"historian.d.ts","sourceRoot":"","sources":["../src/historian.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,GAAG,MAAM,8BAA8B,CAAC;AACpD,OAAO,EACN,
|
|
1
|
+
{"version":3,"file":"historian.d.ts","sourceRoot":"","sources":["../src/historian.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,GAAG,MAAM,8BAA8B,CAAC;AACpD,OAAO,EACN,oBAAoB,EACpB,qBAAqB,EACrB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAmB,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,WAAW,YAAY;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,oCAAoC,gBAAiB,YAAY,KAAG,MACN,CAAC;AAE5E;;GAEG;AACH,qBAAa,SAAU,YAAW,UAAU;IAK1C,OAAO,CAAC,QAAQ,CAAC,YAAY;IAE7B,OAAO,CAAC,QAAQ,CAAC,WAAW;IAN7B,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAuB;IAC1D,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAU;gBAGlB,YAAY,EAAE,OAAO,EACtC,YAAY,EAAE,OAAO,EACJ,WAAW,EAAE,WAAW;IAU7B,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAOvD,UAAU,CACtB,IAAI,EAAE,GAAG,CAAC,iBAAiB,GACzB,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;IAQrC,UAAU,CACtB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,GACX,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,cAAc,EAAE,CAAC,CAAC;IAelC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,iBAAiB,GAAG,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAI1E,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAM3E,aAAa,CACzB,OAAO,EAAE,oBAAoB,EAC7B,OAAO,CAAC,EAAE,OAAO,GACf,OAAO,CAAC,aAAa,CAAC,qBAAqB,CAAC,CAAC;IAQnC,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC;IAOjF,OAAO,CAAC,cAAc;CAatB"}
|
package/lib/historian.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { fromUtf8ToBase64 } from "@
|
|
5
|
+
import { fromUtf8ToBase64 } from "@fluid-internal/client-utils";
|
|
6
6
|
export const getAuthorizationTokenFromCredentials = (credentials) => `Basic ${fromUtf8ToBase64(`${credentials.user}:${credentials.password}`)}`;
|
|
7
7
|
/**
|
|
8
8
|
* Implementation of the IHistorian interface that calls out to a REST interface
|
|
@@ -29,7 +29,7 @@ export class Historian {
|
|
|
29
29
|
async getCommits(sha, count) {
|
|
30
30
|
return this.restWrapper
|
|
31
31
|
.get(`/commits`, this.getQueryString({ count, sha }))
|
|
32
|
-
.catch((error) => error.statusCode === 400 || error.statusCode === 404
|
|
32
|
+
.catch(async (error) => error.statusCode === 400 || error.statusCode === 404
|
|
33
33
|
? {
|
|
34
34
|
content: [],
|
|
35
35
|
headers: new Map(),
|
|
@@ -47,14 +47,21 @@ export class Historian {
|
|
|
47
47
|
async createSummary(summary, initial) {
|
|
48
48
|
return this.restWrapper.post(`/git/summaries`, summary, this.getQueryString(initial !== undefined ? { initial } : undefined));
|
|
49
49
|
}
|
|
50
|
-
async
|
|
50
|
+
async getSnapshot(sha) {
|
|
51
51
|
return this.restWrapper.get(`/git/summaries/${sha}`, this.getQueryString());
|
|
52
52
|
}
|
|
53
53
|
getQueryString(queryString) {
|
|
54
54
|
if (this.cacheBust) {
|
|
55
|
-
return
|
|
55
|
+
return {
|
|
56
|
+
cacheBust: Date.now(),
|
|
57
|
+
...this.defaultQueryString,
|
|
58
|
+
...queryString,
|
|
59
|
+
};
|
|
56
60
|
}
|
|
57
|
-
return
|
|
61
|
+
return {
|
|
62
|
+
...this.defaultQueryString,
|
|
63
|
+
...queryString,
|
|
64
|
+
};
|
|
58
65
|
}
|
|
59
66
|
}
|
|
60
67
|
//# sourceMappingURL=historian.js.map
|
package/lib/historian.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"historian.js","sourceRoot":"","sources":["../src/historian.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAgBhE,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC,WAAyB,EAAU,EAAE,CACzF,SAAS,gBAAgB,CAAC,GAAG,WAAW,CAAC,IAAI,IAAI,WAAW,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAC;AAE5E;;GAEG;AACH,MAAM,OAAO,SAAS;IAIrB,YACkB,YAAqB,EACtC,YAAqB,EACJ,WAAwB;QAFxB,iBAAY,GAAZ,YAAY,CAAS;QAErB,gBAAW,GAAX,WAAW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cAAc,EAAE,CAAC,CAAC;IACpF,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,GAAW,EAAE,SAAkB;QACnD,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAC1B,cAAc,kBAAkB,CAAC,GAAG,CAAC,EAAE,EACvC,IAAI,CAAC,cAAc,CAAC,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CACrD,CAAC;IACH,CAAC;IACM,KAAK,CAAC,aAAa,CACzB,OAA6B,EAC7B,OAAiB;QAEjB,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAC3B,gBAAgB,EAChB,OAAO,EACP,IAAI,CAAC,cAAc,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CACpE,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,WAAW,CAAC,GAAW;QACnC,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAC1B,kBAAkB,GAAG,EAAE,EACvB,IAAI,CAAC,cAAc,EAAE,CACrB,CAAC;IACH,CAAC;IAEO,cAAc,CAAC,WAA6B;QACnD,IAAI,IAAI,CAAC,SAAS,EAAE;YACnB,OAAO;gBACN,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;gBACrB,GAAG,IAAI,CAAC,kBAAkB;gBAC1B,GAAG,WAAW;aACd,CAAC;SACF;QACD,OAAO;YACN,GAAG,IAAI,CAAC,kBAAkB;YAC1B,GAAG,WAAW;SACd,CAAC;IACH,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { fromUtf8ToBase64 } from \"@fluid-internal/client-utils\";\nimport * as git from \"@fluidframework/gitresources\";\nimport {\n\tIWholeSummaryPayload,\n\tIWriteSummaryResponse,\n} from \"@fluidframework/server-services-client\";\nimport { QueryStringType, RestWrapper } from \"./restWrapperBase\";\nimport { IR11sResponse } from \"./restWrapper\";\nimport { IHistorian } from \"./storageContracts\";\nimport { IWholeFlatSnapshot } from \"./contracts\";\n\nexport interface ICredentials {\n\tuser: string;\n\tpassword: string;\n}\n\nexport const getAuthorizationTokenFromCredentials = (credentials: ICredentials): string =>\n\t`Basic ${fromUtf8ToBase64(`${credentials.user}:${credentials.password}`)}`;\n\n/**\n * Implementation of the IHistorian interface that calls out to a REST interface\n */\nexport class Historian implements IHistorian {\n\tprivate readonly defaultQueryString: QueryStringType = {};\n\tprivate readonly cacheBust: boolean;\n\n\tconstructor(\n\t\tprivate readonly historianApi: boolean,\n\t\tdisableCache: boolean,\n\t\tprivate readonly restWrapper: RestWrapper,\n\t) {\n\t\tif (disableCache && this.historianApi) {\n\t\t\tthis.defaultQueryString.disableCache = disableCache;\n\t\t\tthis.cacheBust = false;\n\t\t} else {\n\t\t\tthis.cacheBust = disableCache;\n\t\t}\n\t}\n\n\tpublic async getBlob(sha: string): Promise<IR11sResponse<git.IBlob>> {\n\t\treturn this.restWrapper.get<git.IBlob>(\n\t\t\t`/git/blobs/${encodeURIComponent(sha)}`,\n\t\t\tthis.getQueryString(),\n\t\t);\n\t}\n\n\tpublic async createBlob(\n\t\tblob: git.ICreateBlobParams,\n\t): Promise<IR11sResponse<git.ICreateBlobResponse>> {\n\t\treturn this.restWrapper.post<git.ICreateBlobResponse>(\n\t\t\t`/git/blobs`,\n\t\t\tblob,\n\t\t\tthis.getQueryString(),\n\t\t);\n\t}\n\n\tpublic async getCommits(\n\t\tsha: string,\n\t\tcount: number,\n\t): Promise<IR11sResponse<git.ICommitDetails[]>> {\n\t\treturn this.restWrapper\n\t\t\t.get<git.ICommitDetails[]>(`/commits`, this.getQueryString({ count, sha }))\n\t\t\t.catch(async (error) =>\n\t\t\t\terror.statusCode === 400 || error.statusCode === 404\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tcontent: [],\n\t\t\t\t\t\t\theaders: new Map(),\n\t\t\t\t\t\t\tpropsToLog: {},\n\t\t\t\t\t\t\trequestUrl: \"\",\n\t\t\t\t\t }\n\t\t\t\t\t: Promise.reject<IR11sResponse<git.ICommitDetails[]>>(error),\n\t\t\t);\n\t}\n\n\tpublic async createTree(tree: git.ICreateTreeParams): Promise<IR11sResponse<git.ITree>> {\n\t\treturn this.restWrapper.post<git.ITree>(`/git/trees`, tree, this.getQueryString());\n\t}\n\n\tpublic async getTree(sha: string, recursive: boolean): Promise<IR11sResponse<git.ITree>> {\n\t\treturn this.restWrapper.get<git.ITree>(\n\t\t\t`/git/trees/${encodeURIComponent(sha)}`,\n\t\t\tthis.getQueryString({ recursive: recursive ? 1 : 0 }),\n\t\t);\n\t}\n\tpublic async createSummary(\n\t\tsummary: IWholeSummaryPayload,\n\t\tinitial?: boolean,\n\t): Promise<IR11sResponse<IWriteSummaryResponse>> {\n\t\treturn this.restWrapper.post<IWriteSummaryResponse>(\n\t\t\t`/git/summaries`,\n\t\t\tsummary,\n\t\t\tthis.getQueryString(initial !== undefined ? { initial } : undefined),\n\t\t);\n\t}\n\n\tpublic async getSnapshot(sha: string): Promise<IR11sResponse<IWholeFlatSnapshot>> {\n\t\treturn this.restWrapper.get<IWholeFlatSnapshot>(\n\t\t\t`/git/summaries/${sha}`,\n\t\t\tthis.getQueryString(),\n\t\t);\n\t}\n\n\tprivate getQueryString(queryString?: QueryStringType): QueryStringType {\n\t\tif (this.cacheBust) {\n\t\t\treturn {\n\t\t\t\tcacheBust: Date.now(),\n\t\t\t\t...this.defaultQueryString,\n\t\t\t\t...queryString,\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t...this.defaultQueryString,\n\t\t\t...queryString,\n\t\t};\n\t}\n}\n"]}
|
package/lib/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export { DefaultTokenProvider } from "./defaultTokenProvider";
|
|
6
6
|
export { ITokenProvider, ITokenResponse, ITokenService } from "./tokens";
|
|
7
|
-
export { RouterliciousErrorType } from "./errorUtils";
|
|
7
|
+
export { RouterliciousErrorType, RouterliciousErrorTypes } from "./errorUtils";
|
|
8
8
|
export { DocumentPostCreateError, RouterliciousDocumentServiceFactory, } from "./documentServiceFactory";
|
|
9
9
|
export { IRouterliciousDriverPolicies } from "./policies";
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzE,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAG/E,OAAO,EACN,uBAAuB,EACvB,mCAAmC,GACnC,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAAE,4BAA4B,EAAE,MAAM,YAAY,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// Tokens
|
|
6
6
|
export { DefaultTokenProvider } from "./defaultTokenProvider";
|
|
7
7
|
// Errors
|
|
8
|
-
export { RouterliciousErrorType } from "./errorUtils";
|
|
8
|
+
export { RouterliciousErrorType, RouterliciousErrorTypes } from "./errorUtils";
|
|
9
9
|
// Factory
|
|
10
10
|
export { DocumentPostCreateError, RouterliciousDocumentServiceFactory, } from "./documentServiceFactory";
|
|
11
11
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,SAAS;AACT,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAG9D,SAAS;AACT,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,SAAS;AACT,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAG9D,SAAS;AACT,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAE/E,UAAU;AACV,OAAO,EACN,uBAAuB,EACvB,mCAAmC,GACnC,MAAM,0BAA0B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// Tokens\nexport { DefaultTokenProvider } from \"./defaultTokenProvider\";\nexport { ITokenProvider, ITokenResponse, ITokenService } from \"./tokens\";\n\n// Errors\nexport { RouterliciousErrorType, RouterliciousErrorTypes } from \"./errorUtils\";\n\n// Factory\nexport {\n\tDocumentPostCreateError,\n\tRouterliciousDocumentServiceFactory,\n} from \"./documentServiceFactory\";\n\n// Configuration\nexport { IRouterliciousDriverPolicies } from \"./policies\";\n"]}
|
package/lib/mapWithExpiration.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { assert } from "@fluidframework/
|
|
5
|
+
import { assert } from "@fluidframework/core-utils";
|
|
6
6
|
/**
|
|
7
7
|
* An extension of Map that expires (deletes) entries after a period of inactivity.
|
|
8
8
|
* The policy is based on the last time a key was written to.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapWithExpiration.js","sourceRoot":"","sources":["../src/mapWithExpiration.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"mapWithExpiration.js","sourceRoot":"","sources":["../src/mapWithExpiration.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEpD;;;GAGG;AACH,MAAM,OAAO,iBAA4C,SAAQ,GAAiB;IAIjF,YAA6B,QAAgB;QAC5C,KAAK,EAAE,CAAC;QADoB,aAAQ,GAAR,QAAQ,CAAQ;QAH7C,2EAA2E;QAC1D,uBAAkB,GAAG,IAAI,GAAG,EAAgB,CAAC;IAI9D,CAAC;IAEO,OAAO,CAAC,GAAS;QACxB,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;IACxD,CAAC;IAED;;;OAGG;IACK,WAAW,CAAC,GAAS,EAAE,UAAmB,KAAK;QACtD,MAAM,WAAW,GAAG,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACrD,MAAM,CACL,CAAC,WAAW,KAAK,SAAS,CAAC,KAAK,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,EAC9C,KAAK,CAAC,+BAA+B,CACrC,CAAC;QAEF,IAAI,WAAW,KAAK,SAAS,EAAE;YAC9B,OAAO,SAAS,CAAC;SACjB;QACD,MAAM,OAAO,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,WAAW,IAAI,IAAI,CAAC,QAAQ,CAAC;QACpE,IAAI,OAAO,IAAI,OAAO,EAAE;YACvB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;SACjB;QACD,OAAO,OAAO,CAAC;IA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CAAC,CAAC,CAAC;aACpB;iBAAM;gBACN,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;aAClC;QACF,CAAC,CAED,CAAC;QAEF,kEAAkE;QAClE,WAAW,CAAC,OAAO,CAAC,CAAC,GAAS,EAAE,EAAE;YACjC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,OAAO;QACN,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC,OAAO,EAAE,CAAC;IACxB,CAAC;IACD,IAAI;QACH,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC;IACrB,CAAC;IACD,MAAM;QACL,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC,MAAM,EAAE,CAAC;IACvB,CAAC;IACD,CAAC,MAAM,CAAC,QAAQ,CAAC;QAChB,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;IACjC,CAAC;IAED,OAAO;QACN,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC,OAAO,EAAE,CAAC;IACxB,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils\";\n\n/**\n * An extension of Map that expires (deletes) entries after a period of inactivity.\n * The policy is based on the last time a key was written to.\n */\nexport class MapWithExpiration<TKey = any, TValue = any> extends Map<TKey, TValue> {\n\t/** Timestamps (as epoch ms numbers) of when each key was last refreshed */\n\tprivate readonly lastRefreshedTimes = new Map<TKey, number>();\n\n\tconstructor(private readonly expiryMs: number) {\n\t\tsuper();\n\t}\n\n\tprivate refresh(key: TKey): void {\n\t\tthis.lastRefreshedTimes.set(key, new Date().valueOf());\n\t}\n\n\t/**\n\t * Returns true if the key is present and expired, false if it's not expired, and undefined if it's not found\n\t * If cleanUp is passed as true, then delete any expired entry before returning.\n\t */\n\tprivate checkExpiry(key: TKey, cleanUp: boolean = false): boolean | undefined {\n\t\tconst refreshTime = this.lastRefreshedTimes.get(key);\n\t\tassert(\n\t\t\t(refreshTime !== undefined) === super.has(key),\n\t\t\t0x50c /* freshness map out of sync */,\n\t\t);\n\n\t\tif (refreshTime === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst expired = new Date().valueOf() - refreshTime >= this.expiryMs;\n\t\tif (expired && cleanUp) {\n\t\t\tthis.delete(key);\n\t\t}\n\t\treturn expired;\n\t}\n\n\tprivate clearExpiredEntries() {\n\t\t// forEach clears out any expired entries\n\t\tthis.forEach(() => {});\n\t}\n\n\tget size(): number {\n\t\tthis.clearExpiredEntries();\n\t\treturn super.size;\n\t}\n\n\thas(key: TKey): boolean {\n\t\tthis.checkExpiry(key, true /* cleanUp */);\n\t\treturn super.has(key);\n\t}\n\n\tget(key: TKey): TValue | undefined {\n\t\tthis.checkExpiry(key, true /* cleanUp */);\n\t\treturn super.get(key);\n\t}\n\n\tset(key: TKey, value: TValue): this {\n\t\t// Sliding window expiration policy (on write)\n\t\tthis.refresh(key);\n\t\treturn super.set(key, value);\n\t}\n\n\tdelete(key: TKey): boolean {\n\t\tthis.lastRefreshedTimes.delete(key);\n\t\treturn super.delete(key);\n\t}\n\n\tclear(): void {\n\t\tthis.lastRefreshedTimes.clear();\n\t\tsuper.clear();\n\t}\n\n\tforEach(\n\t\tcallbackfn: (value: TValue, key: TKey, map: Map<TKey, TValue>) => void,\n\t\tthisArg?: any,\n\t): void {\n\t\tconst expiredKeys: TKey[] = [];\n\t\tsuper.forEach(\n\t\t\t(v, k, m) => {\n\t\t\t\tif (this.checkExpiry(k) === true) {\n\t\t\t\t\texpiredKeys.push(k);\n\t\t\t\t} else {\n\t\t\t\t\tcallbackfn.bind(thisArg)(v, k, m);\n\t\t\t\t}\n\t\t\t},\n\t\t\t// Note we don't pass thisArg here, since we bind it directly to callbackFn and don't need it otherwise\n\t\t);\n\n\t\t// Clean up keys we know are expired now that we're done iterating\n\t\texpiredKeys.forEach((key: TKey) => {\n\t\t\tthis.delete(key);\n\t\t});\n\t}\n\n\tentries(): IterableIterator<[TKey, TValue]> {\n\t\tthis.clearExpiredEntries();\n\t\treturn super.entries();\n\t}\n\tkeys(): IterableIterator<TKey> {\n\t\tthis.clearExpiredEntries();\n\t\treturn super.keys();\n\t}\n\tvalues(): IterableIterator<TValue> {\n\t\tthis.clearExpiredEntries();\n\t\treturn super.values();\n\t}\n\t[Symbol.iterator](): IterableIterator<[TKey, TValue]> {\n\t\tthis.clearExpiredEntries();\n\t\treturn super[Symbol.iterator]();\n\t}\n\n\tvalueOf() {\n\t\tthis.clearExpiredEntries();\n\t\treturn super.valueOf();\n\t}\n}\n"]}
|
package/lib/packageVersion.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export declare const pkgName = "@fluidframework/routerlicious-driver";
|
|
8
|
-
export declare const pkgVersion = "2.0.0-dev.
|
|
8
|
+
export declare const pkgVersion = "2.0.0-dev.6.4.0.191258";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
package/lib/packageVersion.js
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export const pkgName = "@fluidframework/routerlicious-driver";
|
|
8
|
-
export const pkgVersion = "2.0.0-dev.
|
|
8
|
+
export const pkgVersion = "2.0.0-dev.6.4.0.191258";
|
|
9
9
|
//# sourceMappingURL=packageVersion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,sCAAsC,CAAC;AAC9D,MAAM,CAAC,MAAM,UAAU,GAAG,wBAAwB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/routerlicious-driver\";\nexport const pkgVersion = \"2.0.0-dev.
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,sCAAsC,CAAC;AAC9D,MAAM,CAAC,MAAM,UAAU,GAAG,wBAAwB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/routerlicious-driver\";\nexport const pkgVersion = \"2.0.0-dev.6.4.0.191258\";\n"]}
|
package/lib/policies.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ export interface IRouterliciousDriverPolicies {
|
|
|
35
35
|
* Enable service endpoint discovery when creating or joining a session.
|
|
36
36
|
* Default: false
|
|
37
37
|
*/
|
|
38
|
-
enableDiscovery
|
|
38
|
+
enableDiscovery: boolean;
|
|
39
39
|
/**
|
|
40
40
|
* Enable using RestLess which avoids CORS preflight requests.
|
|
41
41
|
* Default: true
|
|
@@ -53,5 +53,11 @@ export interface IRouterliciousDriverPolicies {
|
|
|
53
53
|
* Default: true
|
|
54
54
|
*/
|
|
55
55
|
enableLongPollingDowngrade: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Indicates that the container is ephemeral.
|
|
58
|
+
* Artifacts relates to the container are limited to container lifetime.
|
|
59
|
+
* Default: false
|
|
60
|
+
*/
|
|
61
|
+
isEphemeralContainer: boolean;
|
|
56
62
|
}
|
|
57
63
|
//# sourceMappingURL=policies.d.ts.map
|
package/lib/policies.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"policies.d.ts","sourceRoot":"","sources":["../src/policies.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,4BAA4B;IAC5C;;;OAGG;IACH,cAAc,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,4BAA4B,EAAE,MAAM,CAAC;IACrC;;;OAGG;IACH,4BAA4B,EAAE,MAAM,CAAC;IACrC;;;;;;OAMG;IACH,8BAA8B,EAAE,MAAM,GAAG,SAAS,CAAC;IACnD;;;OAGG;IACH,wBAAwB,EAAE,OAAO,CAAC;IAClC;;;OAGG;IACH,eAAe,
|
|
1
|
+
{"version":3,"file":"policies.d.ts","sourceRoot":"","sources":["../src/policies.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,4BAA4B;IAC5C;;;OAGG;IACH,cAAc,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,4BAA4B,EAAE,MAAM,CAAC;IACrC;;;OAGG;IACH,4BAA4B,EAAE,MAAM,CAAC;IACrC;;;;;;OAMG;IACH,8BAA8B,EAAE,MAAM,GAAG,SAAS,CAAC;IACnD;;;OAGG;IACH,wBAAwB,EAAE,OAAO,CAAC;IAClC;;;OAGG;IACH,eAAe,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,cAAc,EAAE,OAAO,CAAC;IACxB;;;;OAIG;IACH,4BAA4B,EAAE,OAAO,CAAC;IACtC;;;;OAIG;IACH,0BAA0B,EAAE,OAAO,CAAC;IACpC;;;;OAIG;IACH,oBAAoB,EAAE,OAAO,CAAC;CAC9B"}
|
package/lib/policies.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"policies.js","sourceRoot":"","sources":["../src/policies.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport interface IRouterliciousDriverPolicies {\n\t/**\n\t * Enable prefetching entire snapshot tree into memory before it is loaded by the runtime.\n\t * Default: true\n\t */\n\tenablePrefetch: boolean;\n\t/**\n\t * Rate limit concurrent storage requests.\n\t * Default: 100\n\t */\n\tmaxConcurrentStorageRequests: number;\n\t/**\n\t * Rate limit concurrent orderer requests.\n\t * Default: 100\n\t */\n\tmaxConcurrentOrdererRequests: number;\n\t/**\n\t * Give hosts the option to change blob aggregation behavior to suit their needs.\n\t * Larger number means fewer blob individual requests, but less blob-deduping.\n\t * Smaller number means more blob individual requests, but more blob-deduping.\n\t * Setting to `undefined` disables blob aggregration.\n\t * Default: undefined\n\t */\n\taggregateBlobsSmallerThanBytes: number | undefined;\n\t/**\n\t * Enable uploading entire summary tree as a IWholeSummaryPayload to storage.\n\t * Default: false\n\t */\n\tenableWholeSummaryUpload: boolean;\n\t/**\n\t * Enable service endpoint discovery when creating or joining a session.\n\t * Default: false\n\t */\n\tenableDiscovery
|
|
1
|
+
{"version":3,"file":"policies.js","sourceRoot":"","sources":["../src/policies.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport interface IRouterliciousDriverPolicies {\n\t/**\n\t * Enable prefetching entire snapshot tree into memory before it is loaded by the runtime.\n\t * Default: true\n\t */\n\tenablePrefetch: boolean;\n\t/**\n\t * Rate limit concurrent storage requests.\n\t * Default: 100\n\t */\n\tmaxConcurrentStorageRequests: number;\n\t/**\n\t * Rate limit concurrent orderer requests.\n\t * Default: 100\n\t */\n\tmaxConcurrentOrdererRequests: number;\n\t/**\n\t * Give hosts the option to change blob aggregation behavior to suit their needs.\n\t * Larger number means fewer blob individual requests, but less blob-deduping.\n\t * Smaller number means more blob individual requests, but more blob-deduping.\n\t * Setting to `undefined` disables blob aggregration.\n\t * Default: undefined\n\t */\n\taggregateBlobsSmallerThanBytes: number | undefined;\n\t/**\n\t * Enable uploading entire summary tree as a IWholeSummaryPayload to storage.\n\t * Default: false\n\t */\n\tenableWholeSummaryUpload: boolean;\n\t/**\n\t * Enable service endpoint discovery when creating or joining a session.\n\t * Default: false\n\t */\n\tenableDiscovery: boolean;\n\t/**\n\t * Enable using RestLess which avoids CORS preflight requests.\n\t * Default: true\n\t */\n\tenableRestLess: boolean;\n\t/**\n\t * Enable internal cache of summaries/snapshots.\n\t * Reduces Summarizer boot time and reduces server load in E2E tests.\n\t * Default: true\n\t */\n\tenableInternalSummaryCaching: boolean;\n\t/**\n\t * Enable downgrading socket connection to long-polling\n\t * when websocket connection cannot be established.\n\t * Default: true\n\t */\n\tenableLongPollingDowngrade: boolean;\n\t/**\n\t * Indicates that the container is ephemeral.\n\t * Artifacts relates to the container are limited to container lifetime.\n\t * Default: false\n\t */\n\tisEphemeralContainer: boolean;\n}\n"]}
|
|
@@ -2,14 +2,13 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
6
|
-
import { INormalizedWholeSummary } from "./contracts";
|
|
5
|
+
import { INormalizedWholeSnapshot, IWholeFlatSnapshot } from "./contracts";
|
|
7
6
|
/**
|
|
8
|
-
* Converts existing
|
|
7
|
+
* Converts existing IWholeFlatSnapshot to snapshot tree, blob array, and sequence number.
|
|
9
8
|
*
|
|
10
|
-
* @param
|
|
9
|
+
* @param flatSnapshot - flat snapshot
|
|
11
10
|
* @param treePrefixToRemove - tree prefix to strip. By default we are stripping ".app" prefix
|
|
12
11
|
* @returns snapshot tree, blob array, and sequence number
|
|
13
12
|
*/
|
|
14
|
-
export declare function
|
|
13
|
+
export declare function convertWholeFlatSnapshotToSnapshotTreeAndBlobs(flatSnapshot: IWholeFlatSnapshot, treePrefixToRemove?: string): INormalizedWholeSnapshot;
|
|
15
14
|
//# sourceMappingURL=r11sSnapshotParser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"r11sSnapshotParser.d.ts","sourceRoot":"","sources":["../src/r11sSnapshotParser.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"r11sSnapshotParser.d.ts","sourceRoot":"","sources":["../src/r11sSnapshotParser.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,wBAAwB,EAAE,kBAAkB,EAA0B,MAAM,aAAa,CAAC;AA+CnG;;;;;;GAMG;AACH,wBAAgB,8CAA8C,CAC7D,YAAY,EAAE,kBAAkB,EAChC,kBAAkB,GAAE,MAAe,GACjC,wBAAwB,CAiB1B"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { stringToBuffer } from "@
|
|
5
|
+
import { stringToBuffer } from "@fluid-internal/client-utils";
|
|
6
6
|
/**
|
|
7
7
|
* Build a tree hierarchy from a flat tree.
|
|
8
8
|
*
|
|
@@ -43,29 +43,27 @@ function buildHierarchy(flatTree, treePrefixToRemove) {
|
|
|
43
43
|
return root;
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
46
|
-
* Converts existing
|
|
46
|
+
* Converts existing IWholeFlatSnapshot to snapshot tree, blob array, and sequence number.
|
|
47
47
|
*
|
|
48
|
-
* @param
|
|
48
|
+
* @param flatSnapshot - flat snapshot
|
|
49
49
|
* @param treePrefixToRemove - tree prefix to strip. By default we are stripping ".app" prefix
|
|
50
50
|
* @returns snapshot tree, blob array, and sequence number
|
|
51
51
|
*/
|
|
52
|
-
export function
|
|
53
|
-
var _a;
|
|
52
|
+
export function convertWholeFlatSnapshotToSnapshotTreeAndBlobs(flatSnapshot, treePrefixToRemove = ".app") {
|
|
54
53
|
const blobs = new Map();
|
|
55
|
-
if (
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
blobs.set(blob.id, stringToBuffer(blob.content, (_a = blob.encoding) !== null && _a !== void 0 ? _a : "utf-8"));
|
|
54
|
+
if (flatSnapshot.blobs) {
|
|
55
|
+
flatSnapshot.blobs.forEach((blob) => {
|
|
56
|
+
blobs.set(blob.id, stringToBuffer(blob.content, blob.encoding ?? "utf-8"));
|
|
59
57
|
});
|
|
60
58
|
}
|
|
61
|
-
const
|
|
62
|
-
const sequenceNumber =
|
|
63
|
-
const snapshotTree = buildHierarchy(
|
|
59
|
+
const flatSnapshotTree = flatSnapshot.trees?.[0];
|
|
60
|
+
const sequenceNumber = flatSnapshotTree?.sequenceNumber;
|
|
61
|
+
const snapshotTree = buildHierarchy(flatSnapshotTree, treePrefixToRemove);
|
|
64
62
|
return {
|
|
65
63
|
blobs,
|
|
66
64
|
snapshotTree,
|
|
67
65
|
sequenceNumber,
|
|
68
|
-
id:
|
|
66
|
+
id: flatSnapshot.id,
|
|
69
67
|
};
|
|
70
68
|
}
|
|
71
69
|
//# sourceMappingURL=r11sSnapshotParser.js.map
|