@fluidframework/runtime-utils 2.0.0-internal.3.0.1 → 2.0.0-internal.3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +5 -7
- package/.mocharc.js +2 -2
- package/api-extractor.json +2 -2
- package/dist/dataStoreHandleContextUtils.d.ts.map +1 -1
- package/dist/dataStoreHandleContextUtils.js +3 -1
- package/dist/dataStoreHandleContextUtils.js.map +1 -1
- package/dist/dataStoreHelpers.d.ts.map +1 -1
- package/dist/dataStoreHelpers.js +23 -7
- package/dist/dataStoreHelpers.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/objectstoragepartition.d.ts.map +1 -1
- package/dist/objectstoragepartition.js.map +1 -1
- package/dist/objectstorageutils.d.ts.map +1 -1
- package/dist/objectstorageutils.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/requestParser.d.ts.map +1 -1
- package/dist/requestParser.js.map +1 -1
- package/dist/runtimeFactoryHelper.d.ts.map +1 -1
- package/dist/runtimeFactoryHelper.js +6 -2
- package/dist/runtimeFactoryHelper.js.map +1 -1
- package/dist/summarizerNode/index.d.ts +1 -1
- package/dist/summarizerNode/index.d.ts.map +1 -1
- package/dist/summarizerNode/index.js.map +1 -1
- package/dist/summarizerNode/summarizerNode.d.ts +4 -5
- package/dist/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/dist/summarizerNode/summarizerNode.js +33 -13
- package/dist/summarizerNode/summarizerNode.js.map +1 -1
- package/dist/summarizerNode/summarizerNodeUtils.d.ts +14 -5
- package/dist/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
- package/dist/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/dist/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/dist/summarizerNode/summarizerNodeWithGc.js +20 -12
- package/dist/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/dist/summaryUtils.d.ts.map +1 -1
- package/dist/summaryUtils.js +3 -2
- package/dist/summaryUtils.js.map +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js.map +1 -1
- package/lib/dataStoreHandleContextUtils.d.ts.map +1 -1
- package/lib/dataStoreHandleContextUtils.js +3 -1
- package/lib/dataStoreHandleContextUtils.js.map +1 -1
- package/lib/dataStoreHelpers.d.ts.map +1 -1
- package/lib/dataStoreHelpers.js +23 -7
- package/lib/dataStoreHelpers.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/objectstoragepartition.d.ts.map +1 -1
- package/lib/objectstoragepartition.js.map +1 -1
- package/lib/objectstorageutils.d.ts.map +1 -1
- package/lib/objectstorageutils.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/requestParser.d.ts.map +1 -1
- package/lib/requestParser.js.map +1 -1
- package/lib/runtimeFactoryHelper.d.ts.map +1 -1
- package/lib/runtimeFactoryHelper.js +6 -2
- package/lib/runtimeFactoryHelper.js.map +1 -1
- package/lib/summarizerNode/index.d.ts +1 -1
- package/lib/summarizerNode/index.d.ts.map +1 -1
- package/lib/summarizerNode/index.js.map +1 -1
- package/lib/summarizerNode/summarizerNode.d.ts +4 -5
- package/lib/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/lib/summarizerNode/summarizerNode.js +33 -13
- package/lib/summarizerNode/summarizerNode.js.map +1 -1
- package/lib/summarizerNode/summarizerNodeUtils.d.ts +14 -5
- package/lib/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
- package/lib/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/lib/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/lib/summarizerNode/summarizerNodeWithGc.js +21 -13
- package/lib/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/lib/summaryUtils.d.ts.map +1 -1
- package/lib/summaryUtils.js +3 -2
- package/lib/summaryUtils.js.map +1 -1
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js.map +1 -1
- package/package.json +110 -104
- package/prettier.config.cjs +1 -1
- package/src/dataStoreHandleContextUtils.ts +23 -16
- package/src/dataStoreHelpers.ts +104 -86
- package/src/index.ts +2 -1
- package/src/objectstoragepartition.ts +13 -13
- package/src/objectstorageutils.ts +31 -28
- package/src/packageVersion.ts +1 -1
- package/src/requestParser.ts +80 -82
- package/src/runtimeFactoryHelper.ts +24 -17
- package/src/summarizerNode/index.ts +5 -1
- package/src/summarizerNode/summarizerNode.ts +602 -549
- package/src/summarizerNode/summarizerNodeUtils.ts +163 -150
- package/src/summarizerNode/summarizerNodeWithGc.ts +508 -472
- package/src/summaryUtils.ts +299 -291
- package/src/utils.ts +6 -6
- package/tsconfig.esnext.json +6 -6
- package/tsconfig.json +8 -12
package/.eslintrc.js
CHANGED
|
@@ -4,10 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
module.exports = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
},
|
|
13
|
-
}
|
|
7
|
+
extends: [require.resolve("@fluidframework/eslint-config-fluid/minimal"), "prettier"],
|
|
8
|
+
parserOptions: {
|
|
9
|
+
project: ["./tsconfig.json", "./src/test/tsconfig.json"],
|
|
10
|
+
},
|
|
11
|
+
};
|
package/.mocharc.js
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
"use strict";
|
|
7
7
|
|
|
8
|
-
const getFluidTestMochaConfig = require(
|
|
8
|
+
const getFluidTestMochaConfig = require("@fluidframework/mocha-test-setup/mocharc-common");
|
|
9
9
|
|
|
10
10
|
const packageDir = __dirname;
|
|
11
11
|
const config = getFluidTestMochaConfig(packageDir);
|
package/api-extractor.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
+
"extends": "@fluidframework/build-common/api-extractor-common-report.json"
|
|
4
4
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataStoreHandleContextUtils.d.ts","sourceRoot":"","sources":["../src/dataStoreHandleContextUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEtE;;;;;GAKG;AACH,wBAAgB,yBAAyB,
|
|
1
|
+
{"version":3,"file":"dataStoreHandleContextUtils.d.ts","sourceRoot":"","sources":["../src/dataStoreHandleContextUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEtE;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACxC,IAAI,EAAE,MAAM,EACZ,YAAY,CAAC,EAAE,mBAAmB,GAChC,MAAM,CAqBR"}
|
|
@@ -21,7 +21,9 @@ function generateHandleContextPath(path, routeContext) {
|
|
|
21
21
|
else {
|
|
22
22
|
// Remove beginning and trailing slashes, if any, from the path.
|
|
23
23
|
let normalizedPath = path.startsWith("/") ? path.slice(1) : path;
|
|
24
|
-
normalizedPath = normalizedPath.endsWith("/")
|
|
24
|
+
normalizedPath = normalizedPath.endsWith("/")
|
|
25
|
+
? normalizedPath.slice(0, -1)
|
|
26
|
+
: normalizedPath;
|
|
25
27
|
// If the routeContext does not exist, path is the absolute path.
|
|
26
28
|
// If the routeContext exists, absolute path is routeContext's absolute path plus the path.
|
|
27
29
|
return routeContext === undefined
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataStoreHandleContextUtils.js","sourceRoot":"","sources":["../src/dataStoreHandleContextUtils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH;;;;;GAKG;AACH,SAAgB,yBAAyB,
|
|
1
|
+
{"version":3,"file":"dataStoreHandleContextUtils.js","sourceRoot":"","sources":["../src/dataStoreHandleContextUtils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH;;;;;GAKG;AACH,SAAgB,yBAAyB,CACxC,IAAY,EACZ,YAAkC;IAElC,IAAI,IAAI,KAAK,EAAE,EAAE;QAChB,uBAAuB;QACvB,wDAAwD;QACxD,yFAAyF;QACzF,OAAO,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,YAAY,CAAC;KACnE;SAAM;QACN,gEAAgE;QAChE,IAAI,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACjE,cAAc,GAAG,cAAc,CAAC,QAAQ,CAAC,GAAG,CAAC;YAC5C,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YAC7B,CAAC,CAAC,cAAc,CAAC;QAElB,iEAAiE;QACjE,2FAA2F;QAC3F,OAAO,YAAY,KAAK,SAAS;YAChC,CAAC,CAAC,IAAI,cAAc,EAAE;YACtB,CAAC,CAAC,GACA,YAAY,CAAC,YAAY,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,YACtD,IAAI,cAAc,EAAE,CAAC;KACxB;AACF,CAAC;AAxBD,8DAwBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IFluidHandleContext } from \"@fluidframework/core-interfaces\";\n\n/**\n * Generates the absolute path for a Fluid object given its path and its parent routeContext.\n * @param path - The path to the Fluid object relative to the route context.\n * @param routeContext - The route context that contains the Fluid object.\n * @returns The absolute path to the Fluid object from the root of the Container.\n */\nexport function generateHandleContextPath(\n\tpath: string,\n\trouteContext?: IFluidHandleContext,\n): string {\n\tif (path === \"\") {\n\t\t// The `path` is empty.\n\t\t// If the routeContext does not exist, this is the root.\n\t\t// If the routeContext exists, the absolute path is the same as that of the routeContext.\n\t\treturn routeContext === undefined ? \"\" : routeContext.absolutePath;\n\t} else {\n\t\t// Remove beginning and trailing slashes, if any, from the path.\n\t\tlet normalizedPath = path.startsWith(\"/\") ? path.slice(1) : path;\n\t\tnormalizedPath = normalizedPath.endsWith(\"/\")\n\t\t\t? normalizedPath.slice(0, -1)\n\t\t\t: normalizedPath;\n\n\t\t// If the routeContext does not exist, path is the absolute path.\n\t\t// If the routeContext exists, absolute path is routeContext's absolute path plus the path.\n\t\treturn routeContext === undefined\n\t\t\t? `/${normalizedPath}`\n\t\t\t: `${\n\t\t\t\t\trouteContext.absolutePath === \"/\" ? \"\" : routeContext.absolutePath\n\t\t\t }/${normalizedPath}`;\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataStoreHelpers.d.ts","sourceRoot":"","sources":["../src/dataStoreHelpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAElF,OAAO,
|
|
1
|
+
{"version":3,"file":"dataStoreHelpers.d.ts","sourceRoot":"","sources":["../src/dataStoreHelpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAElF,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjG,OAAO,EACN,sBAAsB,EACtB,uBAAuB,EACvB,8BAA8B,EAC9B,MAAM,qCAAqC,CAAC;AAW7C,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,GAAG,GAAG,SAAS,CA0BvD;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,GAAG,KAAK,CAejF;AAED;;GAEG;AACH,wBAAgB,8BAA8B,CAC7C,WAAW,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,GACxC,4BAA4B,GAAG,SAAS,CAI1C;AAED,wBAAsB,kBAAkB,CAAC,CAAC,GAAG,WAAW,EACvD,MAAM,EAAE,YAAY,EACpB,GAAG,EAAE,MAAM,GAAG,QAAQ,GACpB,OAAO,CAAC,CAAC,CAAC,CAUZ;AAED,eAAO,MAAM,iBAAiB,YAAa,QAAQ,cACJ,CAAC;AAEhD,wBAAgB,mBAAmB,CAClC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,QAAQ,EACjB,OAAO,CAAC,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,GAC9B,SAAS,CAiBX;AAED,oBAAY,OAAO,GAAG,sBAAsB,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAAC;AAEvF,wBAAgB,sBAAsB,CACrC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,GACjC,sBAAsB,GAAG,uBAAuB,CAalD"}
|
package/dist/dataStoreHelpers.js
CHANGED
|
@@ -15,7 +15,9 @@ function exceptionToResponse(err) {
|
|
|
15
15
|
mimeType: "text/plain",
|
|
16
16
|
status: responseErr.code,
|
|
17
17
|
value: responseErr.message,
|
|
18
|
-
get stack() {
|
|
18
|
+
get stack() {
|
|
19
|
+
return responseErr.stack;
|
|
20
|
+
},
|
|
19
21
|
headers: responseErr.underlyingResponseHeaders,
|
|
20
22
|
};
|
|
21
23
|
}
|
|
@@ -25,7 +27,10 @@ function exceptionToResponse(err) {
|
|
|
25
27
|
mimeType: "text/plain",
|
|
26
28
|
status,
|
|
27
29
|
value: `${err}`,
|
|
28
|
-
get stack() {
|
|
30
|
+
get stack() {
|
|
31
|
+
var _a;
|
|
32
|
+
return (_a = err === null || err === void 0 ? void 0 : err.stack) !== null && _a !== void 0 ? _a : errWithStack.stack;
|
|
33
|
+
},
|
|
29
34
|
};
|
|
30
35
|
}
|
|
31
36
|
exports.exceptionToResponse = exceptionToResponse;
|
|
@@ -37,7 +42,10 @@ function responseToException(response, request) {
|
|
|
37
42
|
message,
|
|
38
43
|
name: "Error",
|
|
39
44
|
code: response.status,
|
|
40
|
-
get stack() {
|
|
45
|
+
get stack() {
|
|
46
|
+
var _a;
|
|
47
|
+
return (_a = response.stack) !== null && _a !== void 0 ? _a : errWithStack.stack;
|
|
48
|
+
},
|
|
41
49
|
underlyingResponseHeaders: response.headers,
|
|
42
50
|
};
|
|
43
51
|
return responseErr;
|
|
@@ -47,7 +55,9 @@ exports.responseToException = responseToException;
|
|
|
47
55
|
* Takes a set of packages and joins them pkg1/pkg2... etc. Tags the field as a code artifact
|
|
48
56
|
*/
|
|
49
57
|
function packagePathToTelemetryProperty(packagePath) {
|
|
50
|
-
return packagePath
|
|
58
|
+
return packagePath
|
|
59
|
+
? { value: packagePath.join("/"), tag: telemetry_utils_1.TelemetryDataTag.CodeArtifact }
|
|
60
|
+
: undefined;
|
|
51
61
|
}
|
|
52
62
|
exports.packagePathToTelemetryProperty = packagePathToTelemetryProperty;
|
|
53
63
|
async function requestFluidObject(router, url) {
|
|
@@ -73,7 +83,9 @@ function createResponseError(status, value, request, headers) {
|
|
|
73
83
|
mimeType: "text/plain",
|
|
74
84
|
status,
|
|
75
85
|
value: urlNoQuery === undefined ? value : `${value}: ${urlNoQuery}`,
|
|
76
|
-
get stack() {
|
|
86
|
+
get stack() {
|
|
87
|
+
return errWithStack.stack;
|
|
88
|
+
},
|
|
77
89
|
headers,
|
|
78
90
|
};
|
|
79
91
|
}
|
|
@@ -81,8 +93,12 @@ exports.createResponseError = createResponseError;
|
|
|
81
93
|
function createDataStoreFactory(type, factory) {
|
|
82
94
|
return {
|
|
83
95
|
type,
|
|
84
|
-
get IFluidDataStoreFactory() {
|
|
85
|
-
|
|
96
|
+
get IFluidDataStoreFactory() {
|
|
97
|
+
return this;
|
|
98
|
+
},
|
|
99
|
+
get IFluidDataStoreRegistry() {
|
|
100
|
+
return this;
|
|
101
|
+
},
|
|
86
102
|
instantiateDataStore: async (context, existing) => (await factory).instantiateDataStore(context, existing),
|
|
87
103
|
get: async (name) => { var _a; return (_a = (await factory).IFluidDataStoreRegistry) === null || _a === void 0 ? void 0 : _a.get(name); },
|
|
88
104
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataStoreHelpers.js","sourceRoot":"","sources":["../src/dataStoreHelpers.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,+DAAsD;
|
|
1
|
+
{"version":3,"file":"dataStoreHelpers.js","sourceRoot":"","sources":["../src/dataStoreHelpers.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,+DAAsD;AAOtD,qEAA2F;AAU3F,SAAgB,mBAAmB,CAAC,GAAQ;IAC3C,MAAM,MAAM,GAAG,GAAG,CAAC;IACnB,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,CAAC,2BAA2B,KAAK,IAAI,EAAE;QACxF,MAAM,WAAW,GAAuB,GAAG,CAAC;QAC5C,OAAO;YACN,QAAQ,EAAE,YAAY;YACtB,MAAM,EAAE,WAAW,CAAC,IAAI;YACxB,KAAK,EAAE,WAAW,CAAC,OAAO;YAC1B,IAAI,KAAK;gBACR,OAAO,WAAW,CAAC,KAAK,CAAC;YAC1B,CAAC;YACD,OAAO,EAAE,WAAW,CAAC,yBAAyB;SAC9C,CAAC;KACF;IAED,0GAA0G;IAC1G,MAAM,YAAY,GAAG,IAAA,wCAAsB,GAAE,CAAC;IAE9C,OAAO;QACN,QAAQ,EAAE,YAAY;QACtB,MAAM;QACN,KAAK,EAAE,G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CAAC,OAAO,EAAE,QAAQ,CAAC;QACxD,GAAG,EAAE,KAAK,EAAE,IAAY,EAAE,EAAE,WAAC,OAAA,MAAA,CAAC,MAAM,OAAO,CAAC,CAAC,uBAAuB,0CAAE,GAAG,CAAC,IAAI,CAAC,CAAA,EAAA;KAC/E,CAAC;AACH,CAAC;AAhBD,wDAgBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITaggedTelemetryPropertyType } from \"@fluidframework/common-definitions\";\nimport { assert } from \"@fluidframework/common-utils\";\nimport { FluidObject, IFluidRouter, IRequest, IResponse } from \"@fluidframework/core-interfaces\";\nimport {\n\tIFluidDataStoreFactory,\n\tIFluidDataStoreRegistry,\n\tIProvideFluidDataStoreRegistry,\n} from \"@fluidframework/runtime-definitions\";\nimport { generateErrorWithStack, TelemetryDataTag } from \"@fluidframework/telemetry-utils\";\n\ninterface IResponseException extends Error {\n\terrorFromRequestFluidObject: true;\n\tmessage: string;\n\tcode: number;\n\tstack?: string;\n\tunderlyingResponseHeaders?: { [key: string]: any };\n}\n\nexport function exceptionToResponse(err: any): IResponse {\n\tconst status = 500;\n\tif (err !== null && typeof err === \"object\" && err.errorFromRequestFluidObject === true) {\n\t\tconst responseErr: IResponseException = err;\n\t\treturn {\n\t\t\tmimeType: \"text/plain\",\n\t\t\tstatus: responseErr.code,\n\t\t\tvalue: responseErr.message,\n\t\t\tget stack() {\n\t\t\t\treturn responseErr.stack;\n\t\t\t},\n\t\t\theaders: responseErr.underlyingResponseHeaders,\n\t\t};\n\t}\n\n\t// Capture error objects, not stack itself, as stack retrieval is very expensive operation, so we delay it\n\tconst errWithStack = generateErrorWithStack();\n\n\treturn {\n\t\tmimeType: \"text/plain\",\n\t\tstatus,\n\t\tvalue: `${err}`,\n\t\tget stack() {\n\t\t\treturn (err?.stack as string | undefined) ?? errWithStack.stack;\n\t\t},\n\t};\n}\n\nexport function responseToException(response: IResponse, request: IRequest): Error {\n\tconst message = response.value;\n\tconst errWithStack = generateErrorWithStack();\n\tconst responseErr: Error & IResponseException = {\n\t\terrorFromRequestFluidObject: true,\n\t\tmessage,\n\t\tname: \"Error\",\n\t\tcode: response.status,\n\t\tget stack() {\n\t\t\treturn response.stack ?? errWithStack.stack;\n\t\t},\n\t\tunderlyingResponseHeaders: response.headers,\n\t};\n\n\treturn responseErr;\n}\n\n/**\n * Takes a set of packages and joins them pkg1/pkg2... etc. Tags the field as a code artifact\n */\nexport function packagePathToTelemetryProperty(\n\tpackagePath: readonly string[] | undefined,\n): ITaggedTelemetryPropertyType | undefined {\n\treturn packagePath\n\t\t? { value: packagePath.join(\"/\"), tag: TelemetryDataTag.CodeArtifact }\n\t\t: undefined;\n}\n\nexport async function requestFluidObject<T = FluidObject>(\n\trouter: IFluidRouter,\n\turl: string | IRequest,\n): Promise<T> {\n\tconst request = typeof url === \"string\" ? { url } : url;\n\tconst response = await router.request(request);\n\n\tif (response.status !== 200 || response.mimeType !== \"fluid/object\") {\n\t\tthrow responseToException(response, request);\n\t}\n\n\tassert(response.value, 0x19a /* \"Invalid response value for Fluid object request\" */);\n\treturn response.value as T;\n}\n\nexport const create404Response = (request: IRequest) =>\n\tcreateResponseError(404, \"not found\", request);\n\nexport function createResponseError(\n\tstatus: number,\n\tvalue: string,\n\trequest: IRequest,\n\theaders?: { [key: string]: any },\n): IResponse {\n\tassert(status !== 200, 0x19b /* \"Cannot not create response error on 200 status\" */);\n\t// Omit query string which could contain personal data (aka \"PII\")\n\tconst urlNoQuery = request.url?.split(\"?\")[0];\n\n\t// Capture error objects, not stack itself, as stack retrieval is very expensive operation, so we delay it\n\tconst errWithStack = generateErrorWithStack();\n\n\treturn {\n\t\tmimeType: \"text/plain\",\n\t\tstatus,\n\t\tvalue: urlNoQuery === undefined ? value : `${value}: ${urlNoQuery}`,\n\t\tget stack() {\n\t\t\treturn errWithStack.stack;\n\t\t},\n\t\theaders,\n\t};\n}\n\nexport type Factory = IFluidDataStoreFactory & Partial<IProvideFluidDataStoreRegistry>;\n\nexport function createDataStoreFactory(\n\ttype: string,\n\tfactory: Factory | Promise<Factory>,\n): IFluidDataStoreFactory & IFluidDataStoreRegistry {\n\treturn {\n\t\ttype,\n\t\tget IFluidDataStoreFactory() {\n\t\t\treturn this;\n\t\t},\n\t\tget IFluidDataStoreRegistry() {\n\t\t\treturn this;\n\t\t},\n\t\tinstantiateDataStore: async (context, existing) =>\n\t\t\t(await factory).instantiateDataStore(context, existing),\n\t\tget: async (name: string) => (await factory).IFluidDataStoreRegistry?.get(name),\n\t};\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export { ObjectStoragePartition } from "./objectstoragepartition";
|
|
|
8
8
|
export { getNormalizedObjectStoragePathParts, listBlobsAtTreePath } from "./objectstorageutils";
|
|
9
9
|
export { RequestParser } from "./requestParser";
|
|
10
10
|
export { RuntimeFactoryHelper } from "./runtimeFactoryHelper";
|
|
11
|
-
export { createRootSummarizerNode, createRootSummarizerNodeWithGC, IRootSummarizerNode, IRootSummarizerNodeWithGC, ISummarizerNodeRootContract, RefreshSummaryResult, } from "./summarizerNode";
|
|
11
|
+
export { createRootSummarizerNode, createRootSummarizerNodeWithGC, IFetchSnapshotResult, IRootSummarizerNode, IRootSummarizerNodeWithGC, ISummarizerNodeRootContract, RefreshSummaryResult, } from "./summarizerNode";
|
|
12
12
|
export { addBlobToSummary, addSummarizeResultToSummary, addTreeToSummary, calculateStats, convertSnapshotTreeToSummaryTree, convertSummaryTreeToITree, convertToSummaryTree, convertToSummaryTreeWithStats, getBlobSize, mergeStats, SummaryTreeBuilder, TelemetryContext, utf8ByteLength, } from "./summaryUtils";
|
|
13
13
|
export { ReadAndParseBlob, seqFromTree } from "./utils";
|
|
14
14
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EACN,iBAAiB,EACjB,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,EACnB,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EACN,iBAAiB,EACjB,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,EACnB,OAAO,EACP,8BAA8B,EAC9B,kBAAkB,EAClB,mBAAmB,GACnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,mCAAmC,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAChG,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EACN,wBAAwB,EACxB,8BAA8B,EAC9B,oBAAoB,EACpB,mBAAmB,EACnB,yBAAyB,EACzB,2BAA2B,EAC3B,oBAAoB,GACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,gBAAgB,EAChB,2BAA2B,EAC3B,gBAAgB,EAChB,cAAc,EACd,gCAAgC,EAChC,yBAAyB,EACzB,oBAAoB,EACpB,6BAA6B,EAC7B,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,GACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6EAA0E;AAAjE,wIAAA,yBAAyB,OAAA;AAClC,uDAS4B;AAR3B,qHAAA,iBAAiB,OAAA;AACjB,0HAAA,sBAAsB,OAAA;AACtB,uHAAA,mBAAmB,OAAA;AACnB,uHAAA,mBAAmB,OAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6EAA0E;AAAjE,wIAAA,yBAAyB,OAAA;AAClC,uDAS4B;AAR3B,qHAAA,iBAAiB,OAAA;AACjB,0HAAA,sBAAsB,OAAA;AACtB,uHAAA,mBAAmB,OAAA;AACnB,uHAAA,mBAAmB,OAAA;AAEnB,kIAAA,8BAA8B,OAAA;AAC9B,sHAAA,kBAAkB,OAAA;AAClB,uHAAA,mBAAmB,OAAA;AAEpB,mEAAkE;AAAzD,gIAAA,sBAAsB,OAAA;AAC/B,2DAAgG;AAAvF,yIAAA,mCAAmC,OAAA;AAAE,yHAAA,mBAAmB,OAAA;AACjE,iDAAgD;AAAvC,8GAAA,aAAa,OAAA;AACtB,+DAA8D;AAArD,4HAAA,oBAAoB,OAAA;AAC7B,mDAQ0B;AAPzB,0HAAA,wBAAwB,OAAA;AACxB,gIAAA,8BAA8B,OAAA;AAO/B,+CAcwB;AAbvB,gHAAA,gBAAgB,OAAA;AAChB,2HAAA,2BAA2B,OAAA;AAC3B,gHAAA,gBAAgB,OAAA;AAChB,8GAAA,cAAc,OAAA;AACd,gIAAA,gCAAgC,OAAA;AAChC,yHAAA,yBAAyB,OAAA;AACzB,oHAAA,oBAAoB,OAAA;AACpB,6HAAA,6BAA6B,OAAA;AAC7B,2GAAA,WAAW,OAAA;AACX,0GAAA,UAAU,OAAA;AACV,kHAAA,kBAAkB,OAAA;AAClB,gHAAA,gBAAgB,OAAA;AAChB,8GAAA,cAAc,OAAA;AAEf,iCAAwD;AAA7B,oGAAA,WAAW,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { generateHandleContextPath } from \"./dataStoreHandleContextUtils\";\nexport {\n\tcreate404Response,\n\tcreateDataStoreFactory,\n\tcreateResponseError,\n\texceptionToResponse,\n\tFactory,\n\tpackagePathToTelemetryProperty,\n\trequestFluidObject,\n\tresponseToException,\n} from \"./dataStoreHelpers\";\nexport { ObjectStoragePartition } from \"./objectstoragepartition\";\nexport { getNormalizedObjectStoragePathParts, listBlobsAtTreePath } from \"./objectstorageutils\";\nexport { RequestParser } from \"./requestParser\";\nexport { RuntimeFactoryHelper } from \"./runtimeFactoryHelper\";\nexport {\n\tcreateRootSummarizerNode,\n\tcreateRootSummarizerNodeWithGC,\n\tIFetchSnapshotResult,\n\tIRootSummarizerNode,\n\tIRootSummarizerNodeWithGC,\n\tISummarizerNodeRootContract,\n\tRefreshSummaryResult,\n} from \"./summarizerNode\";\nexport {\n\taddBlobToSummary,\n\taddSummarizeResultToSummary,\n\taddTreeToSummary,\n\tcalculateStats,\n\tconvertSnapshotTreeToSummaryTree,\n\tconvertSummaryTreeToITree,\n\tconvertToSummaryTree,\n\tconvertToSummaryTreeWithStats,\n\tgetBlobSize,\n\tmergeStats,\n\tSummaryTreeBuilder,\n\tTelemetryContext,\n\tutf8ByteLength,\n} from \"./summaryUtils\";\nexport { ReadAndParseBlob, seqFromTree } from \"./utils\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"objectstoragepartition.d.ts","sourceRoot":"","sources":["../src/objectstoragepartition.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAE/E;;GAEG;AACH,qBAAa,sBAAuB,YAAW,sBAAsB;
|
|
1
|
+
{"version":3,"file":"objectstoragepartition.d.ts","sourceRoot":"","sources":["../src/objectstoragepartition.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAE/E;;GAEG;AACH,qBAAa,sBAAuB,YAAW,sBAAsB;IACxD,OAAO,CAAC,QAAQ,CAAC,OAAO;IAA0B,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAtD,OAAO,EAAE,sBAAsB,EAAmB,IAAI,EAAE,MAAM;IAK9E,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAIhD,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAIxC,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;CAGlD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"objectstoragepartition.js","sourceRoot":"","sources":["../src/objectstoragepartition.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAsD;AAGtD;;GAEG;AACH,MAAa,sBAAsB;
|
|
1
|
+
{"version":3,"file":"objectstoragepartition.js","sourceRoot":"","sources":["../src/objectstoragepartition.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAsD;AAGtD;;GAEG;AACH,MAAa,sBAAsB;IAClC,YAA6B,OAA+B,EAAmB,IAAY;QAA9D,YAAO,GAAP,OAAO,CAAwB;QAAmB,SAAI,GAAJ,IAAI,CAAQ;QAC1F,kDAAkD;QAClD,IAAA,qBAAM,EAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACxF,CAAC;IAEM,KAAK,CAAC,QAAQ,CAAC,IAAY;QACjC,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,EAAE,CAAC,CAAC;IACtD,CAAC;IAEM,KAAK,CAAC,QAAQ,CAAC,IAAY;QACjC,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,EAAE,CAAC,CAAC;IACtD,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,IAAY;QAC7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,EAAE,CAAC,CAAC;IAClD,CAAC;CACD;AAjBD,wDAiBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/common-utils\";\nimport { IChannelStorageService } from \"@fluidframework/datastore-definitions\";\n\n/**\n * Returns a new IChannelStorageService that resolves the given `path` as root.\n */\nexport class ObjectStoragePartition implements IChannelStorageService {\n\tconstructor(private readonly storage: IChannelStorageService, private readonly path: string) {\n\t\t// `path` must not include the trailing separator.\n\t\tassert(!path.endsWith(\"/\"), 0x19c /* \"storage service path has trailing separator\" */);\n\t}\n\n\tpublic async readBlob(path: string): Promise<ArrayBufferLike> {\n\t\treturn this.storage.readBlob(`${this.path}/${path}`);\n\t}\n\n\tpublic async contains(path: string): Promise<boolean> {\n\t\treturn this.storage.contains(`${this.path}/${path}`);\n\t}\n\n\tpublic async list(path: string): Promise<string[]> {\n\t\treturn this.storage.list(`${this.path}/${path}`);\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"objectstorageutils.d.ts","sourceRoot":"","sources":["../src/objectstorageutils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,sCAAsC,CAAC;AAE7D,wBAAgB,mCAAmC,CAAC,IAAI,EAAE,MAAM,YAY/D;AAED,wBAAsB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"objectstorageutils.d.ts","sourceRoot":"","sources":["../src/objectstorageutils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,sCAAsC,CAAC;AAE7D,wBAAgB,mCAAmC,CAAC,IAAI,EAAE,MAAM,YAY/D;AAED,wBAAsB,mBAAmB,CACxC,SAAS,EAAE,KAAK,GAAG,SAAS,EAC5B,IAAI,EAAE,MAAM,GACV,OAAO,CAAC,MAAM,EAAE,CAAC,CAkBnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"objectstorageutils.js","sourceRoot":"","sources":["../src/objectstorageutils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,SAAgB,mCAAmC,CAAC,IAAY;
|
|
1
|
+
{"version":3,"file":"objectstorageutils.js","sourceRoot":"","sources":["../src/objectstorageutils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,SAAgB,mCAAmC,CAAC,IAAY;IAC/D,IAAI,aAAa,GAAG,IAAI,CAAC;IACzB,IAAI,aAAa,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;QAClC,aAAa,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;KACxC;IACD,IAAI,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QAChC,aAAa,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC,EAAE,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;KAClE;IACD,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE;QAC7B,OAAO,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;KAChC;IACD,OAAO,EAAE,CAAC;AACX,CAAC;AAZD,kFAYC;AAEM,KAAK,UAAU,mBAAmB,CACxC,SAA4B,EAC5B,IAAY;IAEZ,MAAM,SAAS,GAAG,mCAAmC,CAAC,IAAI,CAAC,CAAC;IAC5D,IAAI,IAAI,GAAsB,SAAS,CAAC;IACxC,OAAO,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,OAAO,MAAK,SAAS,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE;QAC3D,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,EAAE,CAAC;QAC/B,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE;YAC7C,OAAO,KAAK,CAAC,IAAI,KAAK,MAAM,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;QACpE,CAAC,CAAC,CAAC;QAEH,qEAAqE;QACrE,qEAAqE;QACrE,mEAAmE;QACnE,IAAI,GAAG,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,IAAI,MAAK,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;KAChE;IACD,IAAI,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,OAAO,MAAK,SAAS,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;QAC1D,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;KACvC;IACD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AACzE,CAAC;AArBD,kDAqBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITree } from \"@fluidframework/protocol-definitions\";\n\nexport function getNormalizedObjectStoragePathParts(path: string) {\n\tlet normalizePath = path;\n\tif (normalizePath.startsWith(\"/\")) {\n\t\tnormalizePath = normalizePath.substr(1);\n\t}\n\tif (normalizePath.endsWith(\"/\")) {\n\t\tnormalizePath = normalizePath.substr(0, normalizePath.length - 1);\n\t}\n\tif (normalizePath.length > 0) {\n\t\treturn normalizePath.split(\"/\");\n\t}\n\treturn [];\n}\n\nexport async function listBlobsAtTreePath(\n\tinputTree: ITree | undefined,\n\tpath: string,\n): Promise<string[]> {\n\tconst pathParts = getNormalizedObjectStoragePathParts(path);\n\tlet tree: ITree | undefined = inputTree;\n\twhile (tree?.entries !== undefined && pathParts.length > 0) {\n\t\tconst part = pathParts.shift();\n\t\tconst treeEntry = tree.entries.find((value) => {\n\t\t\treturn value.type === \"Tree\" && value.path === part ? true : false;\n\t\t});\n\n\t\t// this check is largely superfluous due to the same check being done\n\t\t// immediately above. the type system, however, is not aware of this.\n\t\t// so we must redundantly determine that the entry's type is \"Tree\"\n\t\ttree = treeEntry?.type === \"Tree\" ? treeEntry.value : undefined;\n\t}\n\tif (tree?.entries === undefined || pathParts.length !== 0) {\n\t\tthrow new Error(\"path does not exist\");\n\t}\n\treturn tree.entries.filter((e) => e.type === \"Blob\").map((e) => e.path);\n}\n"]}
|
package/dist/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/runtime-utils";
|
|
8
|
-
export declare const pkgVersion = "2.0.0-internal.3.0
|
|
8
|
+
export declare const pkgVersion = "2.0.0-internal.3.1.0";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
package/dist/packageVersion.js
CHANGED
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.pkgVersion = exports.pkgName = void 0;
|
|
10
10
|
exports.pkgName = "@fluidframework/runtime-utils";
|
|
11
|
-
exports.pkgVersion = "2.0.0-internal.3.0
|
|
11
|
+
exports.pkgVersion = "2.0.0-internal.3.1.0";
|
|
12
12
|
//# sourceMappingURL=packageVersion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,+BAA+B,CAAC;AAC1C,QAAA,UAAU,GAAG,sBAAsB,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/runtime-utils\";\nexport const pkgVersion = \"2.0.0-internal.3.0
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,+BAA+B,CAAC;AAC1C,QAAA,UAAU,GAAG,sBAAsB,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/runtime-utils\";\nexport const pkgVersion = \"2.0.0-internal.3.1.0\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestParser.d.ts","sourceRoot":"","sources":["../src/requestParser.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAE3E;;GAEG;AACH,qBAAa,aAAc,YAAW,QAAQ;
|
|
1
|
+
{"version":3,"file":"requestParser.d.ts","sourceRoot":"","sources":["../src/requestParser.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAE3E;;GAEG;AACH,qBAAa,aAAc,YAAW,QAAQ;IA6BvB,OAAO,CAAC,QAAQ,CAAC,OAAO;IA5B9C;;;OAGG;WACW,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE;IAa1D,OAAO,CAAC,gBAAgB,CAAgC;IACxD,SAAgB,KAAK,EAAE,MAAM,CAAC;WAEhB,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,QAAQ,CAAC;IAQhD,SAAS,aAA8B,OAAO,EAAE,QAAQ,CAAC,QAAQ,CAAC;IAKlE,IAAW,GAAG,IAAI,MAAM,CAEvB;IAED,IAAW,OAAO,IAAI,cAAc,GAAG,SAAS,CAE/C;IAED;;OAEG;IACH,IAAW,SAAS,IAAI,SAAS,MAAM,EAAE,CAKxC;IAED;;;OAGG;IACI,MAAM,CAAC,QAAQ,EAAE,MAAM;IAI9B;;;;;;;;;;;OAWG;IACI,gBAAgB,CAAC,iBAAiB,EAAE,MAAM,GAAG,QAAQ;CAiB5D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestParser.js","sourceRoot":"","sources":["../src/requestParser.ts"],"names":[],"mappings":";;;AAMA;;GAEG;AACH,MAAa,aAAa;
|
|
1
|
+
{"version":3,"file":"requestParser.js","sourceRoot":"","sources":["../src/requestParser.ts"],"names":[],"mappings":";;;AAMA;;GAEG;AACH,MAAa,aAAa;IA6BzB,YAAuC,OAA2B;QAA3B,YAAO,GAAP,OAAO,CAAoB;QACjE,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACtD,IAAI,CAAC,KAAK,GAAG,eAAe,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACtF,CAAC;IA/BD;;;OAGG;IACI,MAAM,CAAC,YAAY,CAAC,GAAW;QACrC,MAAM,eAAe,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACzC,OAAO,GAAG;aACR,SAAS,CAAC,CAAC,EAAE,eAAe,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC;aAChE,KAAK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AAI,iBAAiB,KAAK,OAAO,IAAI,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YAC5D,OAAO;gBACN,GAAG,EAAE,IAAI,IAAI,CAAC,KAAK,EAAE;gBACrB,OAAO,EAAE,IAAI,CAAC,OAAO;aACrB,CAAC;SACF;QACD,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACrE,OAAO;YACN,GAAG,EAAE,IAAI,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE;YACvD,OAAO,EAAE,IAAI,CAAC,OAAO;SACrB,CAAC;IACH,CAAC;CACD;AAzFD,sCAyFC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { IRequest, IRequestHeader } from \"@fluidframework/core-interfaces\";\n\n/**\n * The Request Parser takes an IRequest provides parsing and sub request creation\n */\nexport class RequestParser implements IRequest {\n\t/**\n\t * Splits the path of the url and decodes each path part\n\t * @param url - the url to get path parts of\n\t */\n\tpublic static getPathParts(url: string): readonly string[] {\n\t\tconst queryStartIndex = url.indexOf(\"?\");\n\t\treturn url\n\t\t\t.substring(0, queryStartIndex < 0 ? url.length : queryStartIndex)\n\t\t\t.split(\"/\")\n\t\t\t.reduce<string[]>((pv, cv) => {\n\t\t\t\tif (cv !== undefined && cv.length > 0) {\n\t\t\t\t\tpv.push(decodeURIComponent(cv));\n\t\t\t\t}\n\t\t\t\treturn pv;\n\t\t\t}, []);\n\t}\n\n\tprivate requestPathParts: readonly string[] | undefined;\n\tpublic readonly query: string;\n\n\tpublic static create(request: Readonly<IRequest>) {\n\t\t// Perf optimizations.\n\t\tif (request instanceof RequestParser) {\n\t\t\treturn request;\n\t\t}\n\t\treturn new RequestParser(request);\n\t}\n\n\tprotected constructor(private readonly request: Readonly<IRequest>) {\n\t\tconst queryStartIndex = this.request.url.indexOf(\"?\");\n\t\tthis.query = queryStartIndex >= 0 ? this.request.url.substring(queryStartIndex) : \"\";\n\t}\n\n\tpublic get url(): string {\n\t\treturn this.request.url;\n\t}\n\n\tpublic get headers(): IRequestHeader | undefined {\n\t\treturn this.request.headers;\n\t}\n\n\t/**\n\t * Returns the decoded path parts of the request's url\n\t */\n\tpublic get pathParts(): readonly string[] {\n\t\tif (this.requestPathParts === undefined) {\n\t\t\tthis.requestPathParts = RequestParser.getPathParts(this.url);\n\t\t}\n\t\treturn this.requestPathParts;\n\t}\n\n\t/**\n\t * Returns true if it's a terminating path, i.e. no more elements after `elements` entries and empty query.\n\t * @param elements - number of elements in path\n\t */\n\tpublic isLeaf(elements: number) {\n\t\treturn this.query === \"\" && this.pathParts.length === elements;\n\t}\n\n\t/**\n\t * Creates a sub request starting at a specific path part of this request's url\n\t * The sub request url always has a leading slash, and always include query params if original url has any\n\t * e.g. original url is /a/b/?queryParams, createSubRequest(0) is /a/b/?queryParams\n\t * createSubRequest(1) is /b/?queryParams\n\t * createSubRequest(2) is /?queryParams\n\t * createSubRequest(n) where n is bigger than parts length, e.g. 2, or n is less than 0 will throw an exception\n\t *\n\t * note: query params are not counted towards path parts.\n\t *\n\t * @param startingPathIndex - The index of the first path part of the sub request\n\t */\n\tpublic createSubRequest(startingPathIndex: number): IRequest {\n\t\tconst pathLen = this.pathParts.length;\n\t\tif (startingPathIndex < 0 || startingPathIndex > pathLen) {\n\t\t\tthrow new Error(\"incorrect sub-request\");\n\t\t}\n\t\tif (startingPathIndex === pathLen && this.url.includes(\"?\")) {\n\t\t\treturn {\n\t\t\t\turl: `/${this.query}`,\n\t\t\t\theaders: this.headers,\n\t\t\t};\n\t\t}\n\t\tconst path = `/${this.pathParts.slice(startingPathIndex).join(\"/\")}`;\n\t\treturn {\n\t\t\turl: this.query === \"\" ? path : `${path}/${this.query}`,\n\t\t\theaders: this.headers,\n\t\t};\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtimeFactoryHelper.d.ts","sourceRoot":"","sources":["../src/runtimeFactoryHelper.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"runtimeFactoryHelper.d.ts","sourceRoot":"","sources":["../src/runtimeFactoryHelper.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,iBAAiB,EACjB,QAAQ,EACR,eAAe,EACf,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAElF,8BAAsB,oBAAoB,CAAC,CAAC,GAAG,iBAAiB,CAAE,YAAW,eAAe;IAC3F,IAAW,eAAe,SAEzB;IAEY,kBAAkB,CAC9B,OAAO,EAAE,iBAAiB,EAC1B,QAAQ,EAAE,OAAO,GACf,OAAO,CAAC,QAAQ,CAAC;aASJ,aAAa,CAC5B,OAAO,EAAE,iBAAiB,EAC1B,QAAQ,EAAE,OAAO,GACf,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACX,oBAAoB,CAAC,QAAQ,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAChD,uBAAuB,CAAC,QAAQ,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IACnD,cAAc,CAAC,QAAQ,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CACvD"}
|
|
@@ -6,10 +6,14 @@
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.RuntimeFactoryHelper = void 0;
|
|
8
8
|
class RuntimeFactoryHelper {
|
|
9
|
-
get IRuntimeFactory() {
|
|
9
|
+
get IRuntimeFactory() {
|
|
10
|
+
return this;
|
|
11
|
+
}
|
|
10
12
|
async instantiateRuntime(context, existing) {
|
|
11
13
|
const runtime = await this.preInitialize(context, existing);
|
|
12
|
-
await (existing
|
|
14
|
+
await (existing
|
|
15
|
+
? this.instantiateFromExisting(runtime)
|
|
16
|
+
: this.instantiateFirstTime(runtime));
|
|
13
17
|
await this.hasInitialized(runtime);
|
|
14
18
|
return runtime;
|
|
15
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtimeFactoryHelper.js","sourceRoot":"","sources":["../src/runtimeFactoryHelper.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AASH,MAAsB,oBAAoB;
|
|
1
|
+
{"version":3,"file":"runtimeFactoryHelper.js","sourceRoot":"","sources":["../src/runtimeFactoryHelper.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AASH,MAAsB,oBAAoB;IACzC,IAAW,eAAe;QACzB,OAAO,IAAI,CAAC;IACb,CAAC;IAEM,KAAK,CAAC,kBAAkB,CAC9B,OAA0B,EAC1B,QAAiB;QAEjB,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QAC5D,MAAM,CAAC,QAAQ;YACd,CAAC,CAAC,IAAI,CAAC,uBAAuB,CAAC,OAAO,CAAC;YACvC,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC,CAAC;QACvC,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QACnC,OAAO,OAAO,CAAC;IAChB,CAAC;IAMM,KAAK,CAAC,oBAAoB,CAAC,QAAW,IAAkB,CAAC;IACzD,KAAK,CAAC,uBAAuB,CAAC,QAAW,IAAkB,CAAC;IAC5D,KAAK,CAAC,cAAc,CAAC,QAAW,IAAkB,CAAC;CAC1D;AAxBD,oDAwBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIContainerContext,\n\tIRuntime,\n\tIRuntimeFactory,\n} from \"@fluidframework/container-definitions\";\nimport { IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\n\nexport abstract class RuntimeFactoryHelper<T = IContainerRuntime> implements IRuntimeFactory {\n\tpublic get IRuntimeFactory() {\n\t\treturn this;\n\t}\n\n\tpublic async instantiateRuntime(\n\t\tcontext: IContainerContext,\n\t\texisting: boolean,\n\t): Promise<IRuntime> {\n\t\tconst runtime = await this.preInitialize(context, existing);\n\t\tawait (existing\n\t\t\t? this.instantiateFromExisting(runtime)\n\t\t\t: this.instantiateFirstTime(runtime));\n\t\tawait this.hasInitialized(runtime);\n\t\treturn runtime;\n\t}\n\n\tpublic abstract preInitialize(\n\t\tcontext: IContainerContext,\n\t\texisting: boolean,\n\t): Promise<IRuntime & T>;\n\tpublic async instantiateFirstTime(_runtime: T): Promise<void> {}\n\tpublic async instantiateFromExisting(_runtime: T): Promise<void> {}\n\tpublic async hasInitialized(_runtime: T): Promise<void> {}\n}\n"]}
|
|
@@ -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
|
-
export { ISummarizerNodeRootContract, RefreshSummaryResult } from "./summarizerNodeUtils";
|
|
5
|
+
export { IFetchSnapshotResult, ISummarizerNodeRootContract, RefreshSummaryResult, } from "./summarizerNodeUtils";
|
|
6
6
|
export { IRootSummarizerNode, createRootSummarizerNode } from "./summarizerNode";
|
|
7
7
|
export { IRootSummarizerNodeWithGC, createRootSummarizerNodeWithGC } from "./summarizerNodeWithGc";
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/summarizerNode/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/summarizerNode/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,oBAAoB,EACpB,2BAA2B,EAC3B,oBAAoB,GACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AACjF,OAAO,EAAE,yBAAyB,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/summarizerNode/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/summarizerNode/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAOH,mDAAiF;AAAnD,0HAAA,wBAAwB,OAAA;AACtD,+DAAmG;AAA/D,sIAAA,8BAA8B,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tIFetchSnapshotResult,\n\tISummarizerNodeRootContract,\n\tRefreshSummaryResult,\n} from \"./summarizerNodeUtils\";\nexport { IRootSummarizerNode, createRootSummarizerNode } from \"./summarizerNode\";\nexport { IRootSummarizerNodeWithGC, createRootSummarizerNodeWithGC } from \"./summarizerNodeWithGc\";\n"]}
|
|
@@ -6,7 +6,7 @@ import { ISummarizerNode, ISummarizerNodeConfig, ISummarizeResult, CreateChildSu
|
|
|
6
6
|
import { ISequencedDocumentMessage, ISnapshotTree } from "@fluidframework/protocol-definitions";
|
|
7
7
|
import { ITelemetryLogger } from "@fluidframework/common-definitions";
|
|
8
8
|
import { ReadAndParseBlob } from "../utils";
|
|
9
|
-
import { EscapedPath, ICreateChildDetails, IInitialSummary, ISummarizerNodeRootContract, RefreshSummaryResult, SummaryNode } from "./summarizerNodeUtils";
|
|
9
|
+
import { EscapedPath, ICreateChildDetails, IFetchSnapshotResult, IInitialSummary, ISummarizerNodeRootContract, RefreshSummaryResult, SummaryNode } from "./summarizerNodeUtils";
|
|
10
10
|
export interface IRootSummarizerNode extends ISummarizerNode, ISummarizerNodeRootContract {
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
@@ -54,19 +54,18 @@ export declare class SummarizerNode implements IRootSummarizerNode {
|
|
|
54
54
|
/**
|
|
55
55
|
* Refreshes the latest summary tracked by this node. If we have a pending summary for the given proposal handle,
|
|
56
56
|
* it becomes the latest summary. If the current summary is already ahead (e.g., loaded from a service summary),
|
|
57
|
-
* we skip the update. Otherwise, we
|
|
58
|
-
* summary based off of that.
|
|
57
|
+
* we skip the update. Otherwise, we fetch the latest snapshot and update latest summary based off of that.
|
|
59
58
|
*
|
|
60
59
|
* @returns A RefreshSummaryResult type which returns information based on the following three scenarios:
|
|
61
60
|
*
|
|
62
|
-
* 1. The latest summary was not
|
|
61
|
+
* 1. The latest summary was not updated.
|
|
63
62
|
*
|
|
64
63
|
* 2. The latest summary was updated and the summary corresponding to the params was being tracked.
|
|
65
64
|
*
|
|
66
65
|
* 3. The latest summary was updated but the summary corresponding to the params was not tracked. In this
|
|
67
66
|
* case, the latest summary is updated based on the downloaded snapshot which is also returned.
|
|
68
67
|
*/
|
|
69
|
-
refreshLatestSummary(proposalHandle: string | undefined, summaryRefSeq: number,
|
|
68
|
+
refreshLatestSummary(proposalHandle: string | undefined, summaryRefSeq: number, fetchLatestSnapshot: () => Promise<IFetchSnapshotResult>, readAndParseBlob: ReadAndParseBlob, correlatedSummaryLogger: ITelemetryLogger): Promise<RefreshSummaryResult>;
|
|
70
69
|
/**
|
|
71
70
|
* Called when we get an ack from the server for a summary we've just sent. Updates the reference state of this node
|
|
72
71
|
* from the state in the pending summary queue.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summarizerNode.d.ts","sourceRoot":"","sources":["../../src/summarizerNode/summarizerNode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"summarizerNode.d.ts","sourceRoot":"","sources":["../../src/summarizerNode/summarizerNode.ts"],"names":[],"mappings":"AAAA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AAM;IACrC,8CAA8C;IACtC,cAAc,CAAC,yBAAa,EACnB,cAAc,CAAC,6BAAiB,EACvC,gBAAgB,CAAC,8BAAkB;IAKvC,WAAW;IACjB,yBAAyB;IACzB,mBAAmB,EAAE,mBAAmB;IACxC,2CAA2C;IAC3C,EAAE,EAAE,MAAM;IACV;;;;OAIG;IACH,WAAW,EAAE,8BAA8B,EAC3C,MAAM,GAAE,qBAA0B,GAChC,eAAe;IAuBX,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IAIxD;;;;;OAKG;IACH,SAAS,CAAC,wBAAwB,CACjC,EAAE,EAAE,MAAM,EACV,WAAW,EAAE,8BAA8B,GACzC,mBAAmB;IAwFtB;;;;;;OAMG;IACH,SAAS,CAAC,qBAAqB,CAAC,KAAK,EAAE,cAAc;IAoBrD,SAAS,CAAC,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW;IAG7D;;OAEG;IACH,SAAS,CAAC,oBAAoB,IAAI,OAAO;CAGzC;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB,WAC5B,gBAAgB,uBACH,mBAAmB,wBAClB,MAAM,2BACH,MAAM,GAAG,SAAS,WACnC,qBAAqB,KAC3B,mBASD,CAAC"}
|
|
@@ -159,25 +159,30 @@ class SummarizerNode {
|
|
|
159
159
|
/**
|
|
160
160
|
* Refreshes the latest summary tracked by this node. If we have a pending summary for the given proposal handle,
|
|
161
161
|
* it becomes the latest summary. If the current summary is already ahead (e.g., loaded from a service summary),
|
|
162
|
-
* we skip the update. Otherwise, we
|
|
163
|
-
* summary based off of that.
|
|
162
|
+
* we skip the update. Otherwise, we fetch the latest snapshot and update latest summary based off of that.
|
|
164
163
|
*
|
|
165
164
|
* @returns A RefreshSummaryResult type which returns information based on the following three scenarios:
|
|
166
165
|
*
|
|
167
|
-
* 1. The latest summary was not
|
|
166
|
+
* 1. The latest summary was not updated.
|
|
168
167
|
*
|
|
169
168
|
* 2. The latest summary was updated and the summary corresponding to the params was being tracked.
|
|
170
169
|
*
|
|
171
170
|
* 3. The latest summary was updated but the summary corresponding to the params was not tracked. In this
|
|
172
171
|
* case, the latest summary is updated based on the downloaded snapshot which is also returned.
|
|
173
172
|
*/
|
|
174
|
-
async refreshLatestSummary(proposalHandle, summaryRefSeq,
|
|
173
|
+
async refreshLatestSummary(proposalHandle, summaryRefSeq, fetchLatestSnapshot, readAndParseBlob, correlatedSummaryLogger) {
|
|
175
174
|
var _a;
|
|
175
|
+
this.defaultLogger.sendTelemetryEvent({
|
|
176
|
+
eventName: "refreshLatestSummary_start",
|
|
177
|
+
proposalHandle,
|
|
178
|
+
referenceSequenceNumber: this.referenceSequenceNumber,
|
|
179
|
+
summaryRefSeq,
|
|
180
|
+
});
|
|
176
181
|
if (proposalHandle !== undefined) {
|
|
177
182
|
const maybeSummaryNode = this.pendingSummaries.get(proposalHandle);
|
|
178
183
|
if (maybeSummaryNode !== undefined) {
|
|
179
184
|
this.refreshLatestSummaryFromPending(proposalHandle, maybeSummaryNode.referenceSequenceNumber);
|
|
180
|
-
return { latestSummaryUpdated: true, wasSummaryTracked: true };
|
|
185
|
+
return { latestSummaryUpdated: true, wasSummaryTracked: true, summaryRefSeq };
|
|
181
186
|
}
|
|
182
187
|
const props = {
|
|
183
188
|
summaryRefSeq,
|
|
@@ -190,13 +195,25 @@ class SummarizerNode {
|
|
|
190
195
|
details: JSON.stringify(props),
|
|
191
196
|
});
|
|
192
197
|
}
|
|
193
|
-
// If
|
|
198
|
+
// If the summary for which refresh is called is older than the latest tracked summary, ignore it.
|
|
194
199
|
if (this.referenceSequenceNumber >= summaryRefSeq) {
|
|
195
200
|
return { latestSummaryUpdated: false };
|
|
196
201
|
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
202
|
+
// Fetch the latest snapshot and refresh state from it. Note that we need to use the reference sequence number
|
|
203
|
+
// of the fetched snapshot and not the "summaryRefSeq" that was passed in.
|
|
204
|
+
const { snapshotTree, snapshotRefSeq: fetchedSnapshotRefSeq } = await fetchLatestSnapshot();
|
|
205
|
+
// Possible re-entrancy. We may have updated latest summary state while fetching the snapshot. If the fetched
|
|
206
|
+
// snapshot is older than the latest tracked summary, ignore it.
|
|
207
|
+
if (this.referenceSequenceNumber >= fetchedSnapshotRefSeq) {
|
|
208
|
+
return { latestSummaryUpdated: false };
|
|
209
|
+
}
|
|
210
|
+
await this.refreshLatestSummaryFromSnapshot(fetchedSnapshotRefSeq, snapshotTree, undefined, summarizerNodeUtils_1.EscapedPath.create(""), correlatedSummaryLogger, readAndParseBlob);
|
|
211
|
+
return {
|
|
212
|
+
latestSummaryUpdated: true,
|
|
213
|
+
wasSummaryTracked: false,
|
|
214
|
+
snapshotTree,
|
|
215
|
+
summaryRefSeq: fetchedSnapshotRefSeq,
|
|
216
|
+
};
|
|
200
217
|
}
|
|
201
218
|
/**
|
|
202
219
|
* Called when we get an ack from the server for a summary we've just sent. Updates the reference state of this node
|
|
@@ -249,7 +266,8 @@ class SummarizerNode {
|
|
|
249
266
|
// Assuming subtrees missing from snapshot are newer than the snapshot,
|
|
250
267
|
// but might be nice to assert this using earliest seq for node.
|
|
251
268
|
return childrenTree.trees[id] !== undefined;
|
|
252
|
-
})
|
|
269
|
+
})
|
|
270
|
+
.map(async ([id, child]) => {
|
|
253
271
|
return child.refreshLatestSummaryFromSnapshot(referenceSequenceNumber, childrenTree.trees[id], pathForChildren, summarizerNodeUtils_1.EscapedPath.create(id), correlatedSummaryLogger, readAndParseBlob);
|
|
254
272
|
}));
|
|
255
273
|
}
|
|
@@ -325,8 +343,8 @@ class SummarizerNode {
|
|
|
325
343
|
const parentLatestSummary = this._latestSummary;
|
|
326
344
|
switch (createParam.type) {
|
|
327
345
|
case runtime_definitions_1.CreateSummarizerNodeSource.FromAttach: {
|
|
328
|
-
if (parentLatestSummary !== undefined
|
|
329
|
-
|
|
346
|
+
if (parentLatestSummary !== undefined &&
|
|
347
|
+
createParam.sequenceNumber <= parentLatestSummary.referenceSequenceNumber) {
|
|
330
348
|
// Prioritize latest summary if it was after this node was attached.
|
|
331
349
|
latestSummary = parentLatestSummary.createForChild(id);
|
|
332
350
|
}
|
|
@@ -434,6 +452,8 @@ exports.SummarizerNode = SummarizerNode;
|
|
|
434
452
|
* or undefined if not loaded from summary
|
|
435
453
|
* @param config - Configure behavior of summarizer node
|
|
436
454
|
*/
|
|
437
|
-
const createRootSummarizerNode = (logger, summarizeInternalFn, changeSequenceNumber, referenceSequenceNumber, config = {}) => new SummarizerNode(logger, summarizeInternalFn, config, changeSequenceNumber, referenceSequenceNumber === undefined
|
|
455
|
+
const createRootSummarizerNode = (logger, summarizeInternalFn, changeSequenceNumber, referenceSequenceNumber, config = {}) => new SummarizerNode(logger, summarizeInternalFn, config, changeSequenceNumber, referenceSequenceNumber === undefined
|
|
456
|
+
? undefined
|
|
457
|
+
: summarizerNodeUtils_1.SummaryNode.createForRoot(referenceSequenceNumber));
|
|
438
458
|
exports.createRootSummarizerNode = createRootSummarizerNode;
|
|
439
459
|
//# sourceMappingURL=summarizerNode.js.map
|