@fluidframework/runtime-utils 2.74.0 → 2.81.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/compatibilityBase.d.ts +22 -0
- package/dist/compatibilityBase.d.ts.map +1 -1
- package/dist/compatibilityBase.js +39 -10
- package/dist/compatibilityBase.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.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 +1 -0
- package/dist/requestParser.js.map +1 -1
- package/dist/summaryUtils.d.ts +8 -2
- package/dist/summaryUtils.d.ts.map +1 -1
- package/dist/summaryUtils.js +12 -2
- package/dist/summaryUtils.js.map +1 -1
- package/eslint.config.mts +4 -4
- package/lib/compatibilityBase.d.ts +22 -0
- package/lib/compatibilityBase.d.ts.map +1 -1
- package/lib/compatibilityBase.js +35 -8
- package/lib/compatibilityBase.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/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 +1 -0
- package/lib/requestParser.js.map +1 -1
- package/lib/summaryUtils.d.ts +8 -2
- package/lib/summaryUtils.d.ts.map +1 -1
- package/lib/summaryUtils.js +13 -3
- package/lib/summaryUtils.js.map +1 -1
- package/package.json +22 -22
- package/src/compatibilityBase.ts +47 -8
- package/src/index.ts +2 -0
- package/src/packageVersion.ts +1 -1
- package/src/requestParser.ts +1 -0
- package/src/summaryUtils.ts +19 -3
- package/.eslintrc.cjs +0 -14
package/CHANGELOG.md
CHANGED
|
@@ -101,6 +101,28 @@ export declare function getConfigsForMinVersionForCollab<T extends Record<Semant
|
|
|
101
101
|
* @internal
|
|
102
102
|
*/
|
|
103
103
|
export declare function getConfigForMinVersionForCollab<T>(minVersionForCollab: MinimumVersionForCollab, config: ConfigMapEntry<T>): T;
|
|
104
|
+
/**
|
|
105
|
+
* Returns a default configuration given minVersionForCollab and the contents of a {@link ConfigMapEntry} in an Iterable.
|
|
106
|
+
* @remarks
|
|
107
|
+
* See also {@link getConfigForMinVersionForCollab} for consuming a ConfigMapEntry directly.
|
|
108
|
+
*
|
|
109
|
+
* `ConfigMapEntry` is a nice type safe format for developers to directly author this data,
|
|
110
|
+
* but it is messy and less type safe to work with it in this format programmatically.
|
|
111
|
+
* Thus this function exists to help meet the needs of programmatic use cases,
|
|
112
|
+
* like cases which transform a ConfigMapEntry before selecting a value from it.
|
|
113
|
+
* @internal
|
|
114
|
+
*/
|
|
115
|
+
export declare function getConfigForMinVersionForCollabIterable<T>(minVersionForCollab: MinimumVersionForCollab, entries: Iterable<readonly [MinimumMinorSemanticVersion | MinimumVersionForCollab, T]>): T;
|
|
116
|
+
/**
|
|
117
|
+
* Finds the entry for the highest version that is less than or equal to the provided minVersionForCollab.
|
|
118
|
+
* @remarks
|
|
119
|
+
* If none is found, returns undefined.
|
|
120
|
+
*
|
|
121
|
+
* When used with Fluid client versions, use the stricter {@link getConfigForMinVersionForCollabIterable} instead.
|
|
122
|
+
*
|
|
123
|
+
* @internal
|
|
124
|
+
*/
|
|
125
|
+
export declare function selectVersionRoundedDown<T>(minVersionForCollab: string, entries: Iterable<readonly [string, T]>): readonly [string, T] | undefined;
|
|
104
126
|
/**
|
|
105
127
|
* Returns detailed information about the validity of a minVersionForCollab.
|
|
106
128
|
* @param minVersionForCollab - The minVersionForCollab to validate.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compatibilityBase.d.ts","sourceRoot":"","sources":["../src/compatibilityBase.ts"],"names":[],"mappings":"AAAA;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I,uBAAuB,CAIhD;AAID;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,qBAAqB,yBACqF,CAAC;AAExH;;;;;;;;;;GAUG;AACH,wBAAgB,+BAA+B,CAC9C,eAAe,EAAE,MAAM,GACrB,OAAO,CAAC,eAAe,IAAI,uBAAuB,CAYpD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,0BAA0B,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC3E,mBAAmB,EAAE,eAAe,EACpC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,EACrB,aAAa,EAAE,mBAAmB,CAAC,CAAC,CAAC,GACnC,IAAI,CA2BN;AAED;;;;;GAKG;AACH,wBAAgB,gCAAgC,CAC/C,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,EACxD,GAAG,SAAS,SAAS,CAAC,CAAC,EAAE,eAAe,CAAC,EAAE,EAC1C,cAAc,EAAE,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC,KAAK,eAAe,GAAG,SAAS,CAoCtE"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.configValueToMinVersionForCollab = exports.validateConfigMapOverrides = exports.validateMinimumVersionForCollab = exports.cleanedPackageVersion = exports.isValidMinVersionForCollab = exports.checkValidMinVersionForCollabVerbose = exports.getConfigForMinVersionForCollab = exports.getConfigsForMinVersionForCollab = exports.lowestMinVersionForCollab = exports.defaultMinVersionForCollab = void 0;
|
|
7
|
+
exports.configValueToMinVersionForCollab = exports.validateConfigMapOverrides = exports.validateMinimumVersionForCollab = exports.cleanedPackageVersion = exports.isValidMinVersionForCollab = exports.checkValidMinVersionForCollabVerbose = exports.selectVersionRoundedDown = exports.getConfigForMinVersionForCollabIterable = exports.getConfigForMinVersionForCollab = exports.getConfigsForMinVersionForCollab = exports.lowestMinVersionForCollab = exports.defaultMinVersionForCollab = void 0;
|
|
8
8
|
const internal_1 = require("@fluidframework/core-utils/internal");
|
|
9
9
|
const internal_2 = require("@fluidframework/telemetry-utils/internal");
|
|
10
10
|
const semver_ts_1 = require("semver-ts");
|
|
@@ -67,25 +67,54 @@ exports.getConfigsForMinVersionForCollab = getConfigsForMinVersionForCollab;
|
|
|
67
67
|
* @internal
|
|
68
68
|
*/
|
|
69
69
|
function getConfigForMinVersionForCollab(minVersionForCollab, config) {
|
|
70
|
-
|
|
70
|
+
return getConfigForMinVersionForCollabIterable(minVersionForCollab, Object.entries(config));
|
|
71
|
+
}
|
|
72
|
+
exports.getConfigForMinVersionForCollab = getConfigForMinVersionForCollab;
|
|
73
|
+
/**
|
|
74
|
+
* Returns a default configuration given minVersionForCollab and the contents of a {@link ConfigMapEntry} in an Iterable.
|
|
75
|
+
* @remarks
|
|
76
|
+
* See also {@link getConfigForMinVersionForCollab} for consuming a ConfigMapEntry directly.
|
|
77
|
+
*
|
|
78
|
+
* `ConfigMapEntry` is a nice type safe format for developers to directly author this data,
|
|
79
|
+
* but it is messy and less type safe to work with it in this format programmatically.
|
|
80
|
+
* Thus this function exists to help meet the needs of programmatic use cases,
|
|
81
|
+
* like cases which transform a ConfigMapEntry before selecting a value from it.
|
|
82
|
+
* @internal
|
|
83
|
+
*/
|
|
84
|
+
function getConfigForMinVersionForCollabIterable(minVersionForCollab, entries) {
|
|
71
85
|
// Validate and strongly type the versions from the configMap.
|
|
72
|
-
const versions =
|
|
86
|
+
const versions = Array.from(entries, ([version, value]) => {
|
|
73
87
|
validateMinimumVersionForCollab(version);
|
|
74
88
|
return [version, value];
|
|
75
89
|
});
|
|
76
|
-
|
|
77
|
-
|
|
90
|
+
return (selectVersionRoundedDown(minVersionForCollab, versions) ??
|
|
91
|
+
(0, internal_1.fail)(0xcb8 /* No config map entry for version */))[1];
|
|
92
|
+
}
|
|
93
|
+
exports.getConfigForMinVersionForCollabIterable = getConfigForMinVersionForCollabIterable;
|
|
94
|
+
/**
|
|
95
|
+
* Finds the entry for the highest version that is less than or equal to the provided minVersionForCollab.
|
|
96
|
+
* @remarks
|
|
97
|
+
* If none is found, returns undefined.
|
|
98
|
+
*
|
|
99
|
+
* When used with Fluid client versions, use the stricter {@link getConfigForMinVersionForCollabIterable} instead.
|
|
100
|
+
*
|
|
101
|
+
* @internal
|
|
102
|
+
*/
|
|
103
|
+
function selectVersionRoundedDown(minVersionForCollab, entries) {
|
|
104
|
+
// Sort a copy of the iterable in descending order
|
|
105
|
+
const versions = [...entries];
|
|
78
106
|
versions.sort((a, b) => (0, semver_ts_1.compare)(b[0], a[0]));
|
|
79
107
|
// For each config, we iterate over the keys and check if minVersionForCollab is greater than or equal to the version.
|
|
80
108
|
// If so, we set it as the default value for the option.
|
|
81
|
-
for (const
|
|
109
|
+
for (const pair of versions) {
|
|
110
|
+
const [version, _] = pair;
|
|
82
111
|
if ((0, semver_ts_1.gte)(minVersionForCollab, version)) {
|
|
83
|
-
return
|
|
112
|
+
return pair;
|
|
84
113
|
}
|
|
85
114
|
}
|
|
86
|
-
|
|
115
|
+
return undefined;
|
|
87
116
|
}
|
|
88
|
-
exports.
|
|
117
|
+
exports.selectVersionRoundedDown = selectVersionRoundedDown;
|
|
89
118
|
/**
|
|
90
119
|
* Returns detailed information about the validity of a minVersionForCollab.
|
|
91
120
|
* @param minVersionForCollab - The minVersionForCollab to validate.
|
|
@@ -114,7 +143,7 @@ function isValidMinVersionForCollab(minVersionForCollab) {
|
|
|
114
143
|
return isValidSemver && isGteLowestMinVersion && isLtePkgVersion;
|
|
115
144
|
}
|
|
116
145
|
exports.isValidMinVersionForCollab = isValidMinVersionForCollab;
|
|
117
|
-
const parsedPackageVersion = (0, semver_ts_1.parse)(packageVersion_js_1.pkgVersion) ?? (0, internal_1.fail)(
|
|
146
|
+
const parsedPackageVersion = (0, semver_ts_1.parse)(packageVersion_js_1.pkgVersion) ?? (0, internal_1.fail)(0xcb9 /* Invalid package version */);
|
|
118
147
|
/**
|
|
119
148
|
* `pkgVersion` version without pre-release.
|
|
120
149
|
* @remarks
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compatibilityBase.js","sourceRoot":"","sources":["../src/compatibilityBase.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAmE;AAEnE,uEAAsE;AACtE,yCAAgE;AAEhE,2DAAiD;AAEjD;;;;;;;;;;;;;;;;;;;GAmBG;AACU,QAAA,0BAA0B,GACtC,gBAA2D,CAAC;AAE7D;;;;;;;;;;GAUG;AACU,QAAA,yBAAyB,GAAG,OAAkD,CAAC;AAiE5F;;;;;;;GAOG;AACH,SAAgB,gCAAgC,CAC/C,mBAA4C,EAC5C,SAAkD;IAElD,+BAA+B,CAAC,mBAAmB,CAAC,CAAC;IACrD,MAAM,cAAc,GAAe,EAAE,CAAC;IACtC,gEAAgE;IAChE,KAAK,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;QACvD,cAAc,CAAC,GAAG,CAAC,GAAG,+BAA+B,CACpD,mBAAmB,EACnB,MAAiC,CACjC,CAAC;IACH,CAAC;IACD,wEAAwE;IACxE,OAAO,cAAmB,CAAC;AAC5B,CAAC;AAfD,4EAeC;AAED;;;;GAIG;AACH,SAAgB,+BAA+B,CAC9C,mBAA4C,EAC5C,MAAyB;IAEzB,MAAM,OAAO,GAAwB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,wEAAwE;IACrI,8DAA8D;IAC9D,MAAM,QAAQ,GAAyC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,EAAE;QACvF,+BAA+B,CAAC,OAAO,CAAC,CAAC;QACzC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACzB,CAAC,CAAC,CAAC;IACH,8EAA8E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CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1D,CAAC;QACD,qFAAqF;QACrF,+DAA+D;QAC/D,OAAO,SAAS,CAAC;IAClB,CAAC,CAAC;AACH,CAAC;AAvCD,4EAuCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, fail } from \"@fluidframework/core-utils/internal\";\nimport type { MinimumVersionForCollab } from \"@fluidframework/runtime-definitions/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\nimport { compare, gt, gte, lte, valid, parse } from \"semver-ts\";\n\nimport { pkgVersion } from \"./packageVersion.js\";\n\n/**\n * Our policy is to support major versions N and N-1, where N is most\n * recent public major release of the Fluid Framework Client.\n * Therefore, if the customer does not provide a minVersionForCollab, we will\n * default to use N-1.\n *\n * However, this is not consistent with today's behavior. Some options (i.e.\n * batching, compression) are enabled by default despite not being compatible\n * with 1.x clients. Since the policy was introduced during 2.x's lifespan,\n * N/N-1 compatibility by **default** will be in effect starting with 3.0.\n * Importantly though, N/N-2 compatibility is still guaranteed with the proper\n * configurations set.\n *\n * Further to distinguish unspecified `minVersionForCollab` from a specified\n * version and allow `enableExplicitSchemaControl` to default to `true` for\n * any 2.0.0+ version, we will use a special value of `2.0.0-defaults`, which\n * is semantically less than 2.0.0.\n *\n * @internal\n */\nexport const defaultMinVersionForCollab =\n\t\"2.0.0-defaults\" as const satisfies MinimumVersionForCollab;\n\n/**\n * We don't want allow a version before the major public release of the LTS version.\n * Today we use \"1.0.0\", because our policy supports N/N-1 & N/N-2, which includes\n * all minor versions of N. Though LTS starts at 1.4.0, we should stay consistent\n * with our policy and allow all 1.x versions to be compatible with 2.x.\n *\n * @privateRemarks\n * Exported for use in tests.\n *\n * @internal\n */\nexport const lowestMinVersionForCollab = \"1.0.0\" as const satisfies MinimumVersionForCollab;\n\n/**\n * String in a valid semver format specifying bottom of a minor version\n * or special \"defaults\" prerelease of a major.\n * @remarks Only 2.0.0-defaults is expected, but index signatures cannot be a\n * literal; so, just allow any major -defaults prerelease.\n *\n * @internal\n */\nexport type MinimumMinorSemanticVersion = `${bigint}.${bigint}.0` | `${bigint}.0.0-defaults`;\n\n/**\n * String in a valid semver format of a specific version at least specifying minor.\n * Unlike {@link @fluidframework/runtime-definitions#MinimumVersionForCollab}, this type allows any bigint for the major version.\n * Used as a more generic type that allows major versions other than 1 or 2.\n *\n * @internal\n */\nexport type SemanticVersion =\n\t| `${bigint}.${bigint}.${bigint}`\n\t| `${bigint}.${bigint}.${bigint}-${string}`;\n\n/**\n * Converts a record into a configuration map that associates each key with an instance of its value type that is based on a {@link MinimumMinorSemanticVersion}.\n * @remarks\n * For a given input {@link @fluidframework/runtime-definitions#MinimumVersionForCollab},\n * the corresponding configuration values can be found by using the entry in the inner objects with the highest {@link MinimumMinorSemanticVersion}\n * that does not exceed the given {@link @fluidframework/runtime-definitions#MinimumVersionForCollab}.\n *\n * Use {@link getConfigsForMinVersionForCollab} to retrieve the configuration for a given a {@link @fluidframework/runtime-definitions#MinimumVersionForCollab}.\n *\n * See the remarks on {@link MinimumMinorSemanticVersion} for some limitation on how ConfigMaps must handle versioning.\n * @internal\n */\nexport type ConfigMap<T extends Record<string, unknown>> = {\n\treadonly [K in keyof T]-?: ConfigMapEntry<T[K]>;\n};\n\n/**\n * Entry in {@link ConfigMap} associating {@link MinimumMinorSemanticVersion} with configuration values that became supported in that version.\n * @remarks\n * All entries must at least provide an entry for {@link lowestMinVersionForCollab}.\n * @internal\n */\nexport interface ConfigMapEntry<T> {\n\t// This index signature (See https://www.typescriptlang.org/docs/handbook/2/objects.html#index-signatures) requires all properties on this type to to have keys that are a MinimumMinorSemanticVersion and values of type T.\n\t// Note that the \"version\" part of this syntax is really just documentation and has no impact on the type checking (other than some identifier being required to the syntax here to differentiate it from the computed property syntax).\n\t[version: MinimumMinorSemanticVersion]: T;\n\t// Require an entry for the defaultMinVersionForCollab:\n\t// this ensures that all versions of lowestMinVersionForCollab or later have a specified value in the ConfigMap.\n\t// Note that this is NOT an index signature.\n\t// This is a regular property with a computed name (See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer#computed_property_names).\n\t[lowestMinVersionForCollab]: T;\n}\n\n/**\n * Generic type for runtimeOptionsAffectingDocSchemaConfigValidationMap\n *\n * @internal\n */\nexport type ConfigValidationMap<T extends Record<string, unknown>> = {\n\treadonly [K in keyof T]-?: (configValue: T[K]) => SemanticVersion | undefined;\n};\n\n/**\n * Returns a default configuration given minVersionForCollab and configuration version map.\n *\n * @privateRemarks\n * The extra `Record` type for the `configMap` is just used to allow the body of this function to be more type-safe due to limitations of generic types in TypeScript.\n * It should have no impact on the user of this function.\n * @internal\n */\nexport function getConfigsForMinVersionForCollab<T extends Record<SemanticVersion, unknown>>(\n\tminVersionForCollab: MinimumVersionForCollab,\n\tconfigMap: ConfigMap<T> & Record<keyof T, unknown>,\n): T {\n\tvalidateMinimumVersionForCollab(minVersionForCollab);\n\tconst defaultConfigs: Partial<T> = {};\n\t// Iterate over configMap to get default values for each option.\n\tfor (const [key, config] of Object.entries(configMap)) {\n\t\tdefaultConfigs[key] = getConfigForMinVersionForCollab(\n\t\t\tminVersionForCollab,\n\t\t\tconfig as ConfigMapEntry<unknown>,\n\t\t);\n\t}\n\t// We have populated every key, so casting away the Partial is now safe:\n\treturn defaultConfigs as T;\n}\n\n/**\n * Returns a default configuration given minVersionForCollab and {@link ConfigMapEntry}.\n *\n * @internal\n */\nexport function getConfigForMinVersionForCollab<T>(\n\tminVersionForCollab: MinimumVersionForCollab,\n\tconfig: ConfigMapEntry<T>,\n): T {\n\tconst entries: [string, unknown][] = Object.entries(config); // Assigning this to a typed variable to convert the \"any\" into unknown.\n\t// Validate and strongly type the versions from the configMap.\n\tconst versions: [MinimumVersionForCollab, unknown][] = entries.map(([version, value]) => {\n\t\tvalidateMinimumVersionForCollab(version);\n\t\treturn [version, value];\n\t});\n\t// Sort the versions in descending order to find the largest compatible entry.\n\t// TODO: Enforcing a sorted order might be a good idea. For now tolerates any order.\n\tversions.sort((a, b) => compare(b[0], a[0]));\n\t// For each config, we iterate over the keys and check if minVersionForCollab is greater than or equal to the version.\n\t// If so, we set it as the default value for the option.\n\tfor (const [version, value] of versions) {\n\t\tif (gte(minVersionForCollab, version)) {\n\t\t\treturn value as T;\n\t\t}\n\t}\n\tfail(\"No config map entry for version\");\n}\n\n/**\n * Returns detailed information about the validity of a minVersionForCollab.\n * @param minVersionForCollab - The minVersionForCollab to validate.\n * @returns An object containing the validity information.\n *\n * @internal\n */\nexport function checkValidMinVersionForCollabVerbose(minVersionForCollab: SemanticVersion): {\n\tisValidSemver: boolean;\n\tisGteLowestMinVersion: boolean;\n\tisLtePkgVersion: boolean;\n} {\n\tconst isValidSemver = valid(minVersionForCollab) !== null;\n\treturn {\n\t\tisValidSemver,\n\n\t\t// We have to check if the value is a valid semver before calling gte/lte, otherwise they will throw when parsing the version.\n\t\tisGteLowestMinVersion:\n\t\t\tisValidSemver && gte(minVersionForCollab, lowestMinVersionForCollab),\n\t\tisLtePkgVersion: isValidSemver && lte(minVersionForCollab, cleanedPackageVersion),\n\t};\n}\n\n/**\n * Checks if the minVersionForCollab is valid.\n * A valid minVersionForCollab is a MinimumVersionForCollab that is at least `lowestMinVersionForCollab` and less than or equal to the current package version.\n *\n * @internal\n */\nexport function isValidMinVersionForCollab(\n\tminVersionForCollab: SemanticVersion,\n): minVersionForCollab is MinimumVersionForCollab {\n\tconst { isValidSemver, isGteLowestMinVersion, isLtePkgVersion } =\n\t\tcheckValidMinVersionForCollabVerbose(minVersionForCollab);\n\treturn isValidSemver && isGteLowestMinVersion && isLtePkgVersion;\n}\n\nconst parsedPackageVersion = parse(pkgVersion) ?? fail(\"Invalid package version\");\n\n/**\n * `pkgVersion` version without pre-release.\n * @remarks\n * This is the version that the code in the current version of the codebase will have when officially released.\n * Generally, compatibility of prerelease builds is not guaranteed (especially for how they interact with future releases).\n * So while technically a prerelease build is less (older) than the released version which follows it and thus supports less features,\n * it makes sense for them to claim to support the same features as the following release so they can be used to test how the release would actually behave.\n *\n * To accomplish this, the version the next release will have is provided here as `cleanedPackageVersion` while `pkgVersion` may be a prerelease in some cases,\n * like when running tests on CI, or in an actual prerelease published package.\n * This is then used in {@link validateMinimumVersionForCollab} to allow the version shown on main to be usable as a `minVersionForCollab`, even in CI and prerelease packages.\n *\n * This is of particular note in two cases:\n * 1. When landing a new feature, and setting the minVersionForCollab which enables it to be the version that the next release will have.\n * Having that version be valid on main, pass tests locally, then fail on CI and when using published prerelease packages would be confusing, and probably undesired.\n * 2. Setting the minVersionForCollab to the current version for scenarios that do no involve collab with other package versions seems like it should be valid.\n * This is useful for testing new features, and also non collaborative scenarios where the latest features are desired.\n *\n * To accommodate some uses of the second case, it might be useful to package export this in the future.\n *\n * @privateRemarks\n * Since this is used by validateMinimumVersionForCollab, the type case to MinimumVersionForCollab can not use it directly.\n * Thus this is just `as` cast here, and a test confirms it is valid according to validateMinimumVersionForCollab.\n *\n * @internal\n */\nexport const cleanedPackageVersion =\n\t`${parsedPackageVersion.major}.${parsedPackageVersion.minor}.${parsedPackageVersion.patch}` as MinimumVersionForCollab;\n\n/**\n * Narrows the type of the provided {@link SemanticVersion} to a {@link @fluidframework/runtime-definitions#MinimumVersionForCollab}, throwing a UsageError if it is not valid.\n * @remarks\n * This is more strict than the type constraints imposed by `MinimumVersionForCollab`.\n * Currently there is no type which is used to separate semantically valid and typescript allowed MinimumVersionForCollab values:\n * thus users that care about strict validation may want to call this on un-validated `MinimumVersionForCollab` values.\n * @param semanticVersion - The version to check.\n * @throws UsageError if the version is not a valid MinimumVersionForCollab.\n *\n * @internal\n */\nexport function validateMinimumVersionForCollab(\n\tsemanticVersion: string,\n): asserts semanticVersion is MinimumVersionForCollab {\n\tconst minVersionForCollab = semanticVersion as MinimumVersionForCollab;\n\tconst { isValidSemver, isGteLowestMinVersion, isLtePkgVersion } =\n\t\tcheckValidMinVersionForCollabVerbose(minVersionForCollab);\n\tif (!(isValidSemver && isGteLowestMinVersion && isLtePkgVersion)) {\n\t\tthrow new UsageError(\n\t\t\t`Version ${minVersionForCollab} is not a valid MinimumVersionForCollab. ` +\n\t\t\t\t`It must be in a valid semver format, at least ${lowestMinVersionForCollab}, ` +\n\t\t\t\t`and less than or equal to the current package version ${cleanedPackageVersion}. ` +\n\t\t\t\t`Details: { isValidSemver: ${isValidSemver}, isGteLowestMinVersion: ${isGteLowestMinVersion}, isLtePkgVersion: ${isLtePkgVersion} }`,\n\t\t);\n\t}\n}\n\n/**\n * Validates the given `overrides`.\n *\n * No-op when minVersionForCollab is set to defaultMinVersionForCollab.\n *\n * Otherwise this checks that for keys which are in both the `validationMap` and the `overrides`,\n * that the `validationMap` function for that key either returns undefined or a version less than or equal to `minVersionForCollab`.\n * @privateRemarks\n * This design seems odd, and might want to be revisited.\n * Currently it only permits opting out of features, not into them (unless validationMap returns undefined),\n * and the handling of defaultMinVersionForCollab and undefined versions seems questionable.\n * Also ignoring of extra keys in overrides might be bad since it seems like overrides is supposed to be validated.\n * @internal\n */\nexport function validateConfigMapOverrides<T extends Record<string, unknown>>(\n\tminVersionForCollab: SemanticVersion,\n\toverrides: Partial<T>,\n\tvalidationMap: ConfigValidationMap<T>,\n): void {\n\tif (minVersionForCollab === defaultMinVersionForCollab) {\n\t\t// If the minVersionForCollab is set to the default value, then we will not validate the runtime options\n\t\t// This is to avoid disruption to users who have not yet set the minVersionForCollab value explicitly.\n\t\t// TODO: This also skips validation for users which explicitly request defaultMinVersionForCollab which seems like a bug.\n\t\treturn;\n\t}\n\t// Iterate through each runtime option passed in by the user\n\t// Type assertion is safe as entries come from runtimeOptions object\n\tfor (const [passedRuntimeOption, passedRuntimeOptionValue] of Object.entries(overrides) as [\n\t\tkeyof T & string,\n\t\tT[keyof T & string],\n\t][]) {\n\t\t// Skip if passedRuntimeOption is not in validation map\n\t\tif (!(passedRuntimeOption in validationMap)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst requiredVersion = validationMap[passedRuntimeOption](passedRuntimeOptionValue);\n\t\tif (requiredVersion !== undefined && gt(requiredVersion, minVersionForCollab)) {\n\t\t\tthrow new UsageError(\n\t\t\t\t`Runtime option ${passedRuntimeOption}:${JSON.stringify(passedRuntimeOptionValue)} requires ` +\n\t\t\t\t\t`runtime version ${requiredVersion}. Please update minVersionForCollab ` +\n\t\t\t\t\t`(currently ${minVersionForCollab}) to ${requiredVersion} or later to proceed.`,\n\t\t\t);\n\t\t}\n\t}\n}\n\n/**\n * Helper function to map ContainerRuntimeOptionsInternal config values to\n * minVersionForCollab in, e.g., {@link @fluidframework/container-runtime#runtimeOptionsAffectingDocSchemaConfigValidationMap}.\n *\n * @internal\n */\nexport function configValueToMinVersionForCollab<\n\tT extends string | number | boolean | undefined | object,\n\tArr extends readonly [T, SemanticVersion][],\n>(configToMinVer: Arr): (configValue: T) => SemanticVersion | undefined {\n\tconst configValueToRequiredVersionMap = new Map(configToMinVer);\n\treturn (configValue: T) => {\n\t\t// If the configValue is not an object then we can get the version required directly from the map.\n\t\tif (typeof configValue !== \"object\") {\n\t\t\treturn configValueToRequiredVersionMap.get(configValue);\n\t\t}\n\t\t// When the input `configValue` is an object, this logic determines the minimum runtime version it requires.\n\t\t// It iterates through each entry in `configValueToRequiredVersionMap`. If `possibleConfigValue` shares at\n\t\t// least one key-value pair with the input `configValue`, its associated `versionRequired` is collected into\n\t\t// `matchingVersions`. After checking all entries, the highest among the collected versions is returned.\n\t\t// This represents the overall minimum version required to support the features implied by the input `configValue`.\n\t\tconst matchingVersions: SemanticVersion[] = [];\n\t\tfor (const [\n\t\t\tpossibleConfigValue,\n\t\t\tversionRequired,\n\t\t] of configValueToRequiredVersionMap.entries()) {\n\t\t\tassert(\n\t\t\t\ttypeof possibleConfigValue == \"object\",\n\t\t\t\t0xbb9 /* possibleConfigValue should be an object */,\n\t\t\t);\n\t\t\t// Check if `possibleConfigValue` and the input `configValue` share at least one\n\t\t\t// common key-value pair. If they do, the `versionRequired` for this `possibleConfigValue`\n\t\t\t// is added to `matchingVersions`.\n\t\t\tif (Object.entries(possibleConfigValue).some(([k, v]) => configValue[k] === v)) {\n\t\t\t\tmatchingVersions.push(versionRequired);\n\t\t\t}\n\t\t}\n\t\tif (matchingVersions.length > 0) {\n\t\t\t// Return the latest minVersionForCollab among all matches.\n\t\t\treturn matchingVersions.sort((a, b) => compare(b, a))[0];\n\t\t}\n\t\t// If no matches then we return undefined. This means that the config value passed in\n\t\t// does not require a specific minVersionForCollab to be valid.\n\t\treturn undefined;\n\t};\n}\n"]}
|
|
1
|
+
{"version":3,"file":"compatibilityBase.js","sourceRoot":"","sources":["../src/compatibilityBase.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAmE;AAEnE,uEAAsE;AACtE,yCAAgE;AAEhE,2DAAiD;AAEjD;;;;;;;;;;;;;;;;;;;GAmBG;AACU,QAAA,0BAA0B,GACtC,gBAA2D,CAAC;AAE7D;;;;;;;;;;GAUG;AACU,QAAA,yBAAyB,GAAG,OAAkD,CAAC;AAiE5F;;;;;;;GAOG;AACH,SAAgB,gCAAgC,CAC/C,mBAA4C,EAC5C,SAAkD;IAElD,+BAA+B,CAAC,mBAAmB,CAAC,CAAC;IACrD,MAAM,cAAc,GAAe,EAAE,CAAC;IACtC,gEAAgE;IAChE,KAAK,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;QACvD,cAAc,CAAC,GAAG,CAAC,GAAG,+BAA+B,CACpD,mBAAmB,EACnB,MAAiC,CACjC,CAAC;IACH,CAAC;IACD,wEAAwE;IACxE,OAAO,cAAmB,CAAC;AAC5B,CAAC;AAfD,4EAeC;AAED;;;;GAIG;AACH,SAAgB,+BAA+B,CAC9C,mBAA4C,EAC5C,MAAyB;IAEzB,OAAO,uCAAuC,CAC7C,mBAAmB,EACnB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAuC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AAsB,EAAE,CAAC;QAC/C,KAAK,MAAM,CACV,mBAAmB,EACnB,eAAe,EACf,IAAI,+BAA+B,CAAC,OAAO,EAAE,EAAE,CAAC;YAChD,IAAA,iBAAM,EACL,OAAO,mBAAmB,IAAI,QAAQ,EACtC,KAAK,CAAC,6CAA6C,CACnD,CAAC;YACF,gFAAgF;YAChF,0FAA0F;YAC1F,kCAAkC;YAClC,IAAI,MAAM,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;gBAChF,gBAAgB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;YACxC,CAAC;QACF,CAAC;QACD,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACjC,2DAA2D;YAC3D,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,IAAA,mBAAO,EAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1D,CAAC;QACD,qFAAqF;QACrF,+DAA+D;QAC/D,OAAO,SAAS,CAAC;IAClB,CAAC,CAAC;AACH,CAAC;AAvCD,4EAuCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, fail } from \"@fluidframework/core-utils/internal\";\nimport type { MinimumVersionForCollab } from \"@fluidframework/runtime-definitions/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\nimport { compare, gt, gte, lte, valid, parse } from \"semver-ts\";\n\nimport { pkgVersion } from \"./packageVersion.js\";\n\n/**\n * Our policy is to support major versions N and N-1, where N is most\n * recent public major release of the Fluid Framework Client.\n * Therefore, if the customer does not provide a minVersionForCollab, we will\n * default to use N-1.\n *\n * However, this is not consistent with today's behavior. Some options (i.e.\n * batching, compression) are enabled by default despite not being compatible\n * with 1.x clients. Since the policy was introduced during 2.x's lifespan,\n * N/N-1 compatibility by **default** will be in effect starting with 3.0.\n * Importantly though, N/N-2 compatibility is still guaranteed with the proper\n * configurations set.\n *\n * Further to distinguish unspecified `minVersionForCollab` from a specified\n * version and allow `enableExplicitSchemaControl` to default to `true` for\n * any 2.0.0+ version, we will use a special value of `2.0.0-defaults`, which\n * is semantically less than 2.0.0.\n *\n * @internal\n */\nexport const defaultMinVersionForCollab =\n\t\"2.0.0-defaults\" as const satisfies MinimumVersionForCollab;\n\n/**\n * We don't want allow a version before the major public release of the LTS version.\n * Today we use \"1.0.0\", because our policy supports N/N-1 & N/N-2, which includes\n * all minor versions of N. Though LTS starts at 1.4.0, we should stay consistent\n * with our policy and allow all 1.x versions to be compatible with 2.x.\n *\n * @privateRemarks\n * Exported for use in tests.\n *\n * @internal\n */\nexport const lowestMinVersionForCollab = \"1.0.0\" as const satisfies MinimumVersionForCollab;\n\n/**\n * String in a valid semver format specifying bottom of a minor version\n * or special \"defaults\" prerelease of a major.\n * @remarks Only 2.0.0-defaults is expected, but index signatures cannot be a\n * literal; so, just allow any major -defaults prerelease.\n *\n * @internal\n */\nexport type MinimumMinorSemanticVersion = `${bigint}.${bigint}.0` | `${bigint}.0.0-defaults`;\n\n/**\n * String in a valid semver format of a specific version at least specifying minor.\n * Unlike {@link @fluidframework/runtime-definitions#MinimumVersionForCollab}, this type allows any bigint for the major version.\n * Used as a more generic type that allows major versions other than 1 or 2.\n *\n * @internal\n */\nexport type SemanticVersion =\n\t| `${bigint}.${bigint}.${bigint}`\n\t| `${bigint}.${bigint}.${bigint}-${string}`;\n\n/**\n * Converts a record into a configuration map that associates each key with an instance of its value type that is based on a {@link MinimumMinorSemanticVersion}.\n * @remarks\n * For a given input {@link @fluidframework/runtime-definitions#MinimumVersionForCollab},\n * the corresponding configuration values can be found by using the entry in the inner objects with the highest {@link MinimumMinorSemanticVersion}\n * that does not exceed the given {@link @fluidframework/runtime-definitions#MinimumVersionForCollab}.\n *\n * Use {@link getConfigsForMinVersionForCollab} to retrieve the configuration for a given a {@link @fluidframework/runtime-definitions#MinimumVersionForCollab}.\n *\n * See the remarks on {@link MinimumMinorSemanticVersion} for some limitation on how ConfigMaps must handle versioning.\n * @internal\n */\nexport type ConfigMap<T extends Record<string, unknown>> = {\n\treadonly [K in keyof T]-?: ConfigMapEntry<T[K]>;\n};\n\n/**\n * Entry in {@link ConfigMap} associating {@link MinimumMinorSemanticVersion} with configuration values that became supported in that version.\n * @remarks\n * All entries must at least provide an entry for {@link lowestMinVersionForCollab}.\n * @internal\n */\nexport interface ConfigMapEntry<T> {\n\t// This index signature (See https://www.typescriptlang.org/docs/handbook/2/objects.html#index-signatures) requires all properties on this type to to have keys that are a MinimumMinorSemanticVersion and values of type T.\n\t// Note that the \"version\" part of this syntax is really just documentation and has no impact on the type checking (other than some identifier being required to the syntax here to differentiate it from the computed property syntax).\n\t[version: MinimumMinorSemanticVersion]: T;\n\t// Require an entry for the defaultMinVersionForCollab:\n\t// this ensures that all versions of lowestMinVersionForCollab or later have a specified value in the ConfigMap.\n\t// Note that this is NOT an index signature.\n\t// This is a regular property with a computed name (See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer#computed_property_names).\n\t[lowestMinVersionForCollab]: T;\n}\n\n/**\n * Generic type for runtimeOptionsAffectingDocSchemaConfigValidationMap\n *\n * @internal\n */\nexport type ConfigValidationMap<T extends Record<string, unknown>> = {\n\treadonly [K in keyof T]-?: (configValue: T[K]) => SemanticVersion | undefined;\n};\n\n/**\n * Returns a default configuration given minVersionForCollab and configuration version map.\n *\n * @privateRemarks\n * The extra `Record` type for the `configMap` is just used to allow the body of this function to be more type-safe due to limitations of generic types in TypeScript.\n * It should have no impact on the user of this function.\n * @internal\n */\nexport function getConfigsForMinVersionForCollab<T extends Record<SemanticVersion, unknown>>(\n\tminVersionForCollab: MinimumVersionForCollab,\n\tconfigMap: ConfigMap<T> & Record<keyof T, unknown>,\n): T {\n\tvalidateMinimumVersionForCollab(minVersionForCollab);\n\tconst defaultConfigs: Partial<T> = {};\n\t// Iterate over configMap to get default values for each option.\n\tfor (const [key, config] of Object.entries(configMap)) {\n\t\tdefaultConfigs[key] = getConfigForMinVersionForCollab(\n\t\t\tminVersionForCollab,\n\t\t\tconfig as ConfigMapEntry<unknown>,\n\t\t);\n\t}\n\t// We have populated every key, so casting away the Partial is now safe:\n\treturn defaultConfigs as T;\n}\n\n/**\n * Returns a default configuration given minVersionForCollab and {@link ConfigMapEntry}.\n *\n * @internal\n */\nexport function getConfigForMinVersionForCollab<T>(\n\tminVersionForCollab: MinimumVersionForCollab,\n\tconfig: ConfigMapEntry<T>,\n): T {\n\treturn getConfigForMinVersionForCollabIterable(\n\t\tminVersionForCollab,\n\t\tObject.entries(config) as [MinimumMinorSemanticVersion, T][],\n\t);\n}\n\n/**\n * Returns a default configuration given minVersionForCollab and the contents of a {@link ConfigMapEntry} in an Iterable.\n * @remarks\n * See also {@link getConfigForMinVersionForCollab} for consuming a ConfigMapEntry directly.\n *\n * `ConfigMapEntry` is a nice type safe format for developers to directly author this data,\n * but it is messy and less type safe to work with it in this format programmatically.\n * Thus this function exists to help meet the needs of programmatic use cases,\n * like cases which transform a ConfigMapEntry before selecting a value from it.\n * @internal\n */\nexport function getConfigForMinVersionForCollabIterable<T>(\n\tminVersionForCollab: MinimumVersionForCollab,\n\tentries: Iterable<readonly [MinimumMinorSemanticVersion | MinimumVersionForCollab, T]>, // [[typeof lowestMinVersionForCollab, T], ...[MinimumVersionForCollab, T][]],\n): T {\n\t// Validate and strongly type the versions from the configMap.\n\tconst versions: [MinimumVersionForCollab, T][] = Array.from(entries, ([version, value]) => {\n\t\tvalidateMinimumVersionForCollab(version);\n\t\treturn [version, value];\n\t});\n\treturn (selectVersionRoundedDown(minVersionForCollab, versions) ??\n\t\tfail(0xcb8 /* No config map entry for version */))[1];\n}\n\n/**\n * Finds the entry for the highest version that is less than or equal to the provided minVersionForCollab.\n * @remarks\n * If none is found, returns undefined.\n *\n * When used with Fluid client versions, use the stricter {@link getConfigForMinVersionForCollabIterable} instead.\n *\n * @internal\n */\nexport function selectVersionRoundedDown<T>(\n\tminVersionForCollab: string,\n\tentries: Iterable<readonly [string, T]>,\n): readonly [string, T] | undefined {\n\t// Sort a copy of the iterable in descending order\n\tconst versions: (readonly [string, T])[] = [...entries];\n\tversions.sort((a, b) => compare(b[0], a[0]));\n\n\t// For each config, we iterate over the keys and check if minVersionForCollab is greater than or equal to the version.\n\t// If so, we set it as the default value for the option.\n\tfor (const pair of versions) {\n\t\tconst [version, _] = pair;\n\t\tif (gte(minVersionForCollab, version)) {\n\t\t\treturn pair;\n\t\t}\n\t}\n\treturn undefined;\n}\n\n/**\n * Returns detailed information about the validity of a minVersionForCollab.\n * @param minVersionForCollab - The minVersionForCollab to validate.\n * @returns An object containing the validity information.\n *\n * @internal\n */\nexport function checkValidMinVersionForCollabVerbose(minVersionForCollab: SemanticVersion): {\n\tisValidSemver: boolean;\n\tisGteLowestMinVersion: boolean;\n\tisLtePkgVersion: boolean;\n} {\n\tconst isValidSemver = valid(minVersionForCollab) !== null;\n\treturn {\n\t\tisValidSemver,\n\n\t\t// We have to check if the value is a valid semver before calling gte/lte, otherwise they will throw when parsing the version.\n\t\tisGteLowestMinVersion:\n\t\t\tisValidSemver && gte(minVersionForCollab, lowestMinVersionForCollab),\n\t\tisLtePkgVersion: isValidSemver && lte(minVersionForCollab, cleanedPackageVersion),\n\t};\n}\n\n/**\n * Checks if the minVersionForCollab is valid.\n * A valid minVersionForCollab is a MinimumVersionForCollab that is at least `lowestMinVersionForCollab` and less than or equal to the current package version.\n *\n * @internal\n */\nexport function isValidMinVersionForCollab(\n\tminVersionForCollab: SemanticVersion,\n): minVersionForCollab is MinimumVersionForCollab {\n\tconst { isValidSemver, isGteLowestMinVersion, isLtePkgVersion } =\n\t\tcheckValidMinVersionForCollabVerbose(minVersionForCollab);\n\treturn isValidSemver && isGteLowestMinVersion && isLtePkgVersion;\n}\n\nconst parsedPackageVersion = parse(pkgVersion) ?? fail(0xcb9 /* Invalid package version */);\n\n/**\n * `pkgVersion` version without pre-release.\n * @remarks\n * This is the version that the code in the current version of the codebase will have when officially released.\n * Generally, compatibility of prerelease builds is not guaranteed (especially for how they interact with future releases).\n * So while technically a prerelease build is less (older) than the released version which follows it and thus supports less features,\n * it makes sense for them to claim to support the same features as the following release so they can be used to test how the release would actually behave.\n *\n * To accomplish this, the version the next release will have is provided here as `cleanedPackageVersion` while `pkgVersion` may be a prerelease in some cases,\n * like when running tests on CI, or in an actual prerelease published package.\n * This is then used in {@link validateMinimumVersionForCollab} to allow the version shown on main to be usable as a `minVersionForCollab`, even in CI and prerelease packages.\n *\n * This is of particular note in two cases:\n * 1. When landing a new feature, and setting the minVersionForCollab which enables it to be the version that the next release will have.\n * Having that version be valid on main, pass tests locally, then fail on CI and when using published prerelease packages would be confusing, and probably undesired.\n * 2. Setting the minVersionForCollab to the current version for scenarios that do no involve collab with other package versions seems like it should be valid.\n * This is useful for testing new features, and also non collaborative scenarios where the latest features are desired.\n *\n * To accommodate some uses of the second case, it might be useful to package export this in the future.\n *\n * @privateRemarks\n * Since this is used by validateMinimumVersionForCollab, the type case to MinimumVersionForCollab can not use it directly.\n * Thus this is just `as` cast here, and a test confirms it is valid according to validateMinimumVersionForCollab.\n *\n * @internal\n */\nexport const cleanedPackageVersion =\n\t`${parsedPackageVersion.major}.${parsedPackageVersion.minor}.${parsedPackageVersion.patch}` as MinimumVersionForCollab;\n\n/**\n * Narrows the type of the provided {@link SemanticVersion} to a {@link @fluidframework/runtime-definitions#MinimumVersionForCollab}, throwing a UsageError if it is not valid.\n * @remarks\n * This is more strict than the type constraints imposed by `MinimumVersionForCollab`.\n * Currently there is no type which is used to separate semantically valid and typescript allowed MinimumVersionForCollab values:\n * thus users that care about strict validation may want to call this on un-validated `MinimumVersionForCollab` values.\n * @param semanticVersion - The version to check.\n * @throws UsageError if the version is not a valid MinimumVersionForCollab.\n *\n * @internal\n */\nexport function validateMinimumVersionForCollab(\n\tsemanticVersion: string,\n): asserts semanticVersion is MinimumVersionForCollab {\n\tconst minVersionForCollab = semanticVersion as MinimumVersionForCollab;\n\tconst { isValidSemver, isGteLowestMinVersion, isLtePkgVersion } =\n\t\tcheckValidMinVersionForCollabVerbose(minVersionForCollab);\n\tif (!(isValidSemver && isGteLowestMinVersion && isLtePkgVersion)) {\n\t\tthrow new UsageError(\n\t\t\t`Version ${minVersionForCollab} is not a valid MinimumVersionForCollab. ` +\n\t\t\t\t`It must be in a valid semver format, at least ${lowestMinVersionForCollab}, ` +\n\t\t\t\t`and less than or equal to the current package version ${cleanedPackageVersion}. ` +\n\t\t\t\t`Details: { isValidSemver: ${isValidSemver}, isGteLowestMinVersion: ${isGteLowestMinVersion}, isLtePkgVersion: ${isLtePkgVersion} }`,\n\t\t);\n\t}\n}\n\n/**\n * Validates the given `overrides`.\n *\n * No-op when minVersionForCollab is set to defaultMinVersionForCollab.\n *\n * Otherwise this checks that for keys which are in both the `validationMap` and the `overrides`,\n * that the `validationMap` function for that key either returns undefined or a version less than or equal to `minVersionForCollab`.\n * @privateRemarks\n * This design seems odd, and might want to be revisited.\n * Currently it only permits opting out of features, not into them (unless validationMap returns undefined),\n * and the handling of defaultMinVersionForCollab and undefined versions seems questionable.\n * Also ignoring of extra keys in overrides might be bad since it seems like overrides is supposed to be validated.\n * @internal\n */\nexport function validateConfigMapOverrides<T extends Record<string, unknown>>(\n\tminVersionForCollab: SemanticVersion,\n\toverrides: Partial<T>,\n\tvalidationMap: ConfigValidationMap<T>,\n): void {\n\tif (minVersionForCollab === defaultMinVersionForCollab) {\n\t\t// If the minVersionForCollab is set to the default value, then we will not validate the runtime options\n\t\t// This is to avoid disruption to users who have not yet set the minVersionForCollab value explicitly.\n\t\t// TODO: This also skips validation for users which explicitly request defaultMinVersionForCollab which seems like a bug.\n\t\treturn;\n\t}\n\t// Iterate through each runtime option passed in by the user\n\t// Type assertion is safe as entries come from runtimeOptions object\n\tfor (const [passedRuntimeOption, passedRuntimeOptionValue] of Object.entries(overrides) as [\n\t\tkeyof T & string,\n\t\tT[keyof T & string],\n\t][]) {\n\t\t// Skip if passedRuntimeOption is not in validation map\n\t\tif (!(passedRuntimeOption in validationMap)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst requiredVersion = validationMap[passedRuntimeOption](passedRuntimeOptionValue);\n\t\tif (requiredVersion !== undefined && gt(requiredVersion, minVersionForCollab)) {\n\t\t\tthrow new UsageError(\n\t\t\t\t`Runtime option ${passedRuntimeOption}:${JSON.stringify(passedRuntimeOptionValue)} requires ` +\n\t\t\t\t\t`runtime version ${requiredVersion}. Please update minVersionForCollab ` +\n\t\t\t\t\t`(currently ${minVersionForCollab}) to ${requiredVersion} or later to proceed.`,\n\t\t\t);\n\t\t}\n\t}\n}\n\n/**\n * Helper function to map ContainerRuntimeOptionsInternal config values to\n * minVersionForCollab in, e.g., {@link @fluidframework/container-runtime#runtimeOptionsAffectingDocSchemaConfigValidationMap}.\n *\n * @internal\n */\nexport function configValueToMinVersionForCollab<\n\tT extends string | number | boolean | undefined | object,\n\tArr extends readonly [T, SemanticVersion][],\n>(configToMinVer: Arr): (configValue: T) => SemanticVersion | undefined {\n\tconst configValueToRequiredVersionMap = new Map(configToMinVer);\n\treturn (configValue: T) => {\n\t\t// If the configValue is not an object then we can get the version required directly from the map.\n\t\tif (typeof configValue !== \"object\") {\n\t\t\treturn configValueToRequiredVersionMap.get(configValue);\n\t\t}\n\t\t// When the input `configValue` is an object, this logic determines the minimum runtime version it requires.\n\t\t// It iterates through each entry in `configValueToRequiredVersionMap`. If `possibleConfigValue` shares at\n\t\t// least one key-value pair with the input `configValue`, its associated `versionRequired` is collected into\n\t\t// `matchingVersions`. After checking all entries, the highest among the collected versions is returned.\n\t\t// This represents the overall minimum version required to support the features implied by the input `configValue`.\n\t\tconst matchingVersions: SemanticVersion[] = [];\n\t\tfor (const [\n\t\t\tpossibleConfigValue,\n\t\t\tversionRequired,\n\t\t] of configValueToRequiredVersionMap.entries()) {\n\t\t\tassert(\n\t\t\t\ttypeof possibleConfigValue == \"object\",\n\t\t\t\t0xbb9 /* possibleConfigValue should be an object */,\n\t\t\t);\n\t\t\t// Check if `possibleConfigValue` and the input `configValue` share at least one\n\t\t\t// common key-value pair. If they do, the `versionRequired` for this `possibleConfigValue`\n\t\t\t// is added to `matchingVersions`.\n\t\t\tif (Object.entries(possibleConfigValue).some(([k, v]) => configValue[k] === v)) {\n\t\t\t\tmatchingVersions.push(versionRequired);\n\t\t\t}\n\t\t}\n\t\tif (matchingVersions.length > 0) {\n\t\t\t// Return the latest minVersionForCollab among all matches.\n\t\t\treturn matchingVersions.sort((a, b) => compare(b, a))[0];\n\t\t}\n\t\t// If no matches then we return undefined. This means that the config value passed in\n\t\t// does not require a specific minVersionForCollab to be valid.\n\t\treturn undefined;\n\t};\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -17,6 +17,6 @@ export { RuntimeHeaders, seqFromTree, encodeCompactIdToString, } from "./utils.j
|
|
|
17
17
|
export type { ReadAndParseBlob } from "./utils.js";
|
|
18
18
|
export { isSnapshotFetchRequiredForLoadingGroupId } from "./snapshotUtils.js";
|
|
19
19
|
export { toDeltaManagerErased, toDeltaManagerInternal, } from "./deltaManager.js";
|
|
20
|
-
export { configValueToMinVersionForCollab, defaultMinVersionForCollab, validateConfigMapOverrides, getConfigForMinVersionForCollab, getConfigsForMinVersionForCollab, isValidMinVersionForCollab, validateMinimumVersionForCollab, lowestMinVersionForCollab, cleanedPackageVersion, } from "./compatibilityBase.js";
|
|
20
|
+
export { configValueToMinVersionForCollab, defaultMinVersionForCollab, validateConfigMapOverrides, getConfigForMinVersionForCollab, getConfigsForMinVersionForCollab, isValidMinVersionForCollab, validateMinimumVersionForCollab, lowestMinVersionForCollab, getConfigForMinVersionForCollabIterable, cleanedPackageVersion, selectVersionRoundedDown, } from "./compatibilityBase.js";
|
|
21
21
|
export type { ConfigMap, ConfigMapEntry, ConfigValidationMap, MinimumMinorSemanticVersion, SemanticVersion, } from "./compatibilityBase.js";
|
|
22
22
|
//# 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,kCAAkC,CAAC;AAC7E,OAAO,EACN,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,aAAa,GACb,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACN,mBAAmB,EACnB,4BAA4B,EAC5B,eAAe,EACf,aAAa,EACb,mCAAmC,EACnC,2BAA2B,EAC3B,kBAAkB,EAClB,kBAAkB,EAClB,4BAA4B,EAC5B,mBAAmB,EACnB,qBAAqB,GACrB,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EACN,mCAAmC,EACnC,mBAAmB,GACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EACN,gBAAgB,EAChB,2BAA2B,EAC3B,cAAc,EACd,gCAAgC,EAChC,yBAAyB,EACzB,oBAAoB,EACpB,6BAA6B,EAC7B,aAAa,EACb,WAAW,EACX,UAAU,EACV,0BAA0B,EAC1B,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,GACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EACN,cA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ACpB,6BAA6B,EAC7B,aAAa,EACb,WAAW,EACX,UAAU,EACV,0BAA0B,EAC1B,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,GACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EACN,cAAc,EACd,WAAW,EACX,uBAAuB,GACvB,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,wCAAwC,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EACN,oBAAoB,EACpB,sBAAsB,GACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACN,gCAAgC,EAChC,0BAA0B,EAC1B,0BAA0B,EAC1B,+BAA+B,EAC/B,gCAAgC,EAChC,0BAA0B,EAC1B,+BAA+B,EAC/B,yBAAyB,EACzB,uCAAuC,EACvC,qBAAqB,EACrB,wBAAwB,GACxB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EACX,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,2BAA2B,EAC3B,eAAe,GACf,MAAM,wBAAwB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.isValidMinVersionForCollab = exports.getConfigsForMinVersionForCollab = exports.getConfigForMinVersionForCollab = exports.validateConfigMapOverrides = exports.defaultMinVersionForCollab = exports.configValueToMinVersionForCollab = exports.toDeltaManagerInternal = exports.toDeltaManagerErased = exports.isSnapshotFetchRequiredForLoadingGroupId = exports.encodeCompactIdToString = exports.seqFromTree = exports.RuntimeHeaders = exports.unpackChildNodesUsedRoutes = exports.utf8ByteLength = exports.TelemetryContext = exports.SummaryTreeBuilder = exports.processAttachMessageGCData = exports.mergeStats = exports.getBlobSize = exports.GCDataBuilder = exports.convertToSummaryTreeWithStats = exports.convertToSummaryTree = exports.convertSummaryTreeToITree = exports.convertSnapshotTreeToSummaryTree = exports.calculateStats = exports.addSummarizeResultToSummary = exports.addBlobToSummary = exports.RuntimeFactoryHelper = exports.RequestParser = exports.RemoteFluidObjectHandle = exports.listBlobsAtTreePath = exports.getNormalizedObjectStoragePathParts = exports.ObjectStoragePartition = exports.toFluidHandleInternal = exports.toFluidHandleErased = exports.lookupTemporaryBlobStorageId = exports.isSerializedHandle = exports.isLocalFluidHandle = exports.isFluidHandlePayloadPending = exports.isFluidHandleInternalPayloadPending = exports.isFluidHandle = exports.FluidHandleBase = exports.encodeHandleForSerialization = exports.compareFluidHandles = exports.asLegacyAlpha = exports.responseToException = exports.exceptionToResponse = exports.createResponseError = exports.create404Response = exports.generateHandleContextPath = void 0;
|
|
8
|
-
exports.cleanedPackageVersion = exports.lowestMinVersionForCollab = exports.validateMinimumVersionForCollab = void 0;
|
|
8
|
+
exports.selectVersionRoundedDown = exports.cleanedPackageVersion = exports.getConfigForMinVersionForCollabIterable = exports.lowestMinVersionForCollab = exports.validateMinimumVersionForCollab = void 0;
|
|
9
9
|
var dataStoreHandleContextUtils_js_1 = require("./dataStoreHandleContextUtils.js");
|
|
10
10
|
Object.defineProperty(exports, "generateHandleContextPath", { enumerable: true, get: function () { return dataStoreHandleContextUtils_js_1.generateHandleContextPath; } });
|
|
11
11
|
var dataStoreHelpers_js_1 = require("./dataStoreHelpers.js");
|
|
@@ -72,5 +72,7 @@ Object.defineProperty(exports, "getConfigsForMinVersionForCollab", { enumerable:
|
|
|
72
72
|
Object.defineProperty(exports, "isValidMinVersionForCollab", { enumerable: true, get: function () { return compatibilityBase_js_1.isValidMinVersionForCollab; } });
|
|
73
73
|
Object.defineProperty(exports, "validateMinimumVersionForCollab", { enumerable: true, get: function () { return compatibilityBase_js_1.validateMinimumVersionForCollab; } });
|
|
74
74
|
Object.defineProperty(exports, "lowestMinVersionForCollab", { enumerable: true, get: function () { return compatibilityBase_js_1.lowestMinVersionForCollab; } });
|
|
75
|
+
Object.defineProperty(exports, "getConfigForMinVersionForCollabIterable", { enumerable: true, get: function () { return compatibilityBase_js_1.getConfigForMinVersionForCollabIterable; } });
|
|
75
76
|
Object.defineProperty(exports, "cleanedPackageVersion", { enumerable: true, get: function () { return compatibilityBase_js_1.cleanedPackageVersion; } });
|
|
77
|
+
Object.defineProperty(exports, "selectVersionRoundedDown", { enumerable: true, get: function () { return compatibilityBase_js_1.selectVersionRoundedDown; } });
|
|
76
78
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,mFAA6E;AAApE,2IAAA,yBAAyB,OAAA;AAClC,6DAM+B;AAL9B,wHAAA,iBAAiB,OAAA;AACjB,0HAAA,mBAAmB,OAAA;AACnB,0HAAA,mBAAmB,OAAA;AACnB,0HAAA,mBAAmB,OAAA;AACnB,oHAAA,aAAa,OAAA;AAEd,2CAYsB;AAXrB,iHAAA,mBAAmB,OAAA;AACnB,0HAAA,4BAA4B,OAAA;AAC5B,6GAAA,eAAe,OAAA;AACf,2GAAA,aAAa,OAAA;AACb,iIAAA,mCAAmC,OAAA;AACnC,yHAAA,2BAA2B,OAAA;AAC3B,gHAAA,kBAAkB,OAAA;AAClB,gHAAA,kBAAkB,OAAA;AAClB,0HAAA,4BAA4B,OAAA;AAC5B,iHAAA,mBAAmB,OAAA;AACnB,mHAAA,qBAAqB,OAAA;AAGtB,yEAAqE;AAA5D,mIAAA,sBAAsB,OAAA;AAC/B,iEAGiC;AAFhC,4IAAA,mCAAmC,OAAA;AACnC,4HAAA,mBAAmB,OAAA;AAEpB,2EAAuE;AAA9D,qIAAA,uBAAuB,OAAA;AAChC,uDAAmD;AAA1C,iHAAA,aAAa,OAAA;AACtB,qEAAiE;AAAxD,+HAAA,oBAAoB,OAAA;AAC7B,qDAe2B;AAd1B,mHAAA,gBAA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ors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { generateHandleContextPath } from \"./dataStoreHandleContextUtils.js\";\nexport {\n\tcreate404Response,\n\tcreateResponseError,\n\texceptionToResponse,\n\tresponseToException,\n\tasLegacyAlpha,\n} from \"./dataStoreHelpers.js\";\nexport {\n\tcompareFluidHandles,\n\tencodeHandleForSerialization,\n\tFluidHandleBase,\n\tisFluidHandle,\n\tisFluidHandleInternalPayloadPending,\n\tisFluidHandlePayloadPending,\n\tisLocalFluidHandle,\n\tisSerializedHandle,\n\tlookupTemporaryBlobStorageId,\n\ttoFluidHandleErased,\n\ttoFluidHandleInternal,\n} from \"./handles.js\";\nexport type { ISerializedHandle } from \"./handles.js\";\nexport { ObjectStoragePartition } from \"./objectstoragepartition.js\";\nexport {\n\tgetNormalizedObjectStoragePathParts,\n\tlistBlobsAtTreePath,\n} from \"./objectstorageutils.js\";\nexport { RemoteFluidObjectHandle } from \"./remoteFluidObjectHandle.js\";\nexport { RequestParser } from \"./requestParser.js\";\nexport { RuntimeFactoryHelper } from \"./runtimeFactoryHelper.js\";\nexport {\n\taddBlobToSummary,\n\taddSummarizeResultToSummary,\n\tcalculateStats,\n\tconvertSnapshotTreeToSummaryTree,\n\tconvertSummaryTreeToITree,\n\tconvertToSummaryTree,\n\tconvertToSummaryTreeWithStats,\n\tGCDataBuilder,\n\tgetBlobSize,\n\tmergeStats,\n\tprocessAttachMessageGCData,\n\tSummaryTreeBuilder,\n\tTelemetryContext,\n\tutf8ByteLength,\n} from \"./summaryUtils.js\";\nexport { unpackChildNodesUsedRoutes } from \"./unpackUsedRoutes.js\";\nexport {\n\tRuntimeHeaders,\n\tseqFromTree,\n\tencodeCompactIdToString,\n} from \"./utils.js\";\nexport type { ReadAndParseBlob } from \"./utils.js\";\nexport { isSnapshotFetchRequiredForLoadingGroupId } from \"./snapshotUtils.js\";\nexport {\n\ttoDeltaManagerErased,\n\ttoDeltaManagerInternal,\n} from \"./deltaManager.js\";\nexport {\n\tconfigValueToMinVersionForCollab,\n\tdefaultMinVersionForCollab,\n\tvalidateConfigMapOverrides,\n\tgetConfigForMinVersionForCollab,\n\tgetConfigsForMinVersionForCollab,\n\tisValidMinVersionForCollab,\n\tvalidateMinimumVersionForCollab,\n\tlowestMinVersionForCollab,\n\tgetConfigForMinVersionForCollabIterable,\n\tcleanedPackageVersion,\n\tselectVersionRoundedDown,\n} from \"./compatibilityBase.js\";\nexport type {\n\tConfigMap,\n\tConfigMapEntry,\n\tConfigValidationMap,\n\tMinimumMinorSemanticVersion,\n\tSemanticVersion,\n} from \"./compatibilityBase.js\";\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.
|
|
8
|
+
export declare const pkgVersion = "2.81.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.
|
|
11
|
+
exports.pkgVersion = "2.81.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,QAAQ,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.
|
|
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,QAAQ,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.81.0\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestParser.d.ts","sourceRoot":"","sources":["../src/requestParser.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEhF;;;GAGG;AACH,qBAAa,aAAc,YAAW,QAAQ;IA8BvB,OAAO,CAAC,QAAQ,CAAC,OAAO;IA7B9C;;;OAGG;WACW,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE;IAc1D,OAAO,CAAC,gBAAgB,CAAgC;IACxD,SAAgB,KAAK,EAAE,MAAM,CAAC;WAEhB,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,QAAQ,CAAC,GAAG,aAAa;IAQhE,SAAS,aAA8B,OAAO,EAAE,QAAQ,CAAC,QAAQ,CAAC;IAQlE,IAAW,GAAG,IAAI,MAAM,CAEvB;IAED,SAAgB,OAAO,CAAC,EAAE,cAAc,CAAC;IAEzC;;OAEG;IACH,IAAW,SAAS,IAAI,SAAS,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"requestParser.d.ts","sourceRoot":"","sources":["../src/requestParser.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEhF;;;GAGG;AACH,qBAAa,aAAc,YAAW,QAAQ;IA8BvB,OAAO,CAAC,QAAQ,CAAC,OAAO;IA7B9C;;;OAGG;WACW,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE;IAc1D,OAAO,CAAC,gBAAgB,CAAgC;IACxD,SAAgB,KAAK,EAAE,MAAM,CAAC;WAEhB,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,QAAQ,CAAC,GAAG,aAAa;IAQhE,SAAS,aAA8B,OAAO,EAAE,QAAQ,CAAC,QAAQ,CAAC;IAQlE,IAAW,GAAG,IAAI,MAAM,CAEvB;IAED,SAAgB,OAAO,CAAC,EAAE,cAAc,CAAC;IAEzC;;OAEG;IACH,IAAW,SAAS,IAAI,SAAS,MAAM,EAAE,CAMxC;IAED;;;OAGG;IACI,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAIxC;;;;;;;;;;;OAWG;IACI,gBAAgB,CAAC,iBAAiB,EAAE,MAAM,GAAG,QAAQ;CAiB5D"}
|
package/dist/requestParser.js
CHANGED
|
@@ -47,6 +47,7 @@ class RequestParser {
|
|
|
47
47
|
* Returns the decoded path parts of the request's url
|
|
48
48
|
*/
|
|
49
49
|
get pathParts() {
|
|
50
|
+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- using ??= could change behavior if value is falsy
|
|
50
51
|
if (this.requestPathParts === undefined) {
|
|
51
52
|
this.requestPathParts = RequestParser.getPathParts(this.url);
|
|
52
53
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestParser.js","sourceRoot":"","sources":["../src/requestParser.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH;;;GAGG;AACH,MAAa,aAAa;IACzB;;;OAGG;IACI,MAAM,CAAC,YAAY,CAAC,GAAW;QACrC,MAAM,eAAe,GAAG,GAA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E;YACvD,OAAO,EAAE,IAAI,CAAC,OAAO;SACrB,CAAC;IACH,CAAC;CACD;AA5FD,sCA4FC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IRequest, IRequestHeader } from \"@fluidframework/core-interfaces\";\n\n/**\n * The Request Parser takes an IRequest provides parsing and sub request creation\n * @legacy @beta\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\tconst pathParts: string[] = [];\n\t\tconst urlPath = url.slice(0, queryStartIndex < 0 ? url.length : queryStartIndex);\n\n\t\tfor (const part of urlPath.split(\"/\")) {\n\t\t\tif (part !== undefined && part.length > 0) {\n\t\t\t\tpathParts.push(decodeURIComponent(part));\n\t\t\t}\n\t\t}\n\n\t\treturn pathParts;\n\t}\n\n\tprivate requestPathParts: readonly string[] | undefined;\n\tpublic readonly query: string;\n\n\tpublic static create(request: Readonly<IRequest>): RequestParser {\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.slice(queryStartIndex) : \"\";\n\t\tif (request.headers !== undefined) {\n\t\t\tthis.headers = request.headers;\n\t\t}\n\t}\n\n\tpublic get url(): string {\n\t\treturn this.request.url;\n\t}\n\n\tpublic readonly headers?: IRequestHeader;\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\t// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- using ??= could change behavior if value is falsy\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): boolean {\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"]}
|
package/dist/summaryUtils.d.ts
CHANGED
|
@@ -168,13 +168,19 @@ export declare class TelemetryContext implements ITelemetryContext, ITelemetryCo
|
|
|
168
168
|
*/
|
|
169
169
|
setMultiple(prefix: string, property: string, values: Record<string, TelemetryEventPropertyTypeExt>): void;
|
|
170
170
|
/**
|
|
171
|
-
*
|
|
171
|
+
* Get the telemetry data being tracked
|
|
172
|
+
* @param prefix - unique prefix to tag this data with (ex: "fluid:map:")
|
|
173
|
+
* @param property - property name of the telemetry data being tracked (ex: "DirectoryCount")
|
|
174
|
+
* @returns undefined if item not found
|
|
172
175
|
*/
|
|
173
176
|
get(prefix: string, property: string): TelemetryEventPropertyTypeExt;
|
|
174
177
|
/**
|
|
175
|
-
*
|
|
178
|
+
* Returns a serialized version of all the telemetry data.
|
|
179
|
+
* Should be used when logging in telemetry events.
|
|
176
180
|
*/
|
|
177
181
|
serialize(): string;
|
|
182
|
+
getCurrentSummarizeStep(): TelemetryEventPropertyTypeExt;
|
|
183
|
+
setCurrentSummarizeStep(value: TelemetryEventPropertyTypeExt): void;
|
|
178
184
|
}
|
|
179
185
|
/**
|
|
180
186
|
* Helper class to build the garbage collection data of a node by combining the data from multiple nodes.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summaryUtils.d.ts","sourceRoot":"","sources":["../src/summaryUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,gDAAgD,CAAC;AAEpG,OAAO,KAAK,EACX,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,KAAK,EAAE,KAAK,EAAc,MAAM,6CAA6C,CAAC;AAOrF,OAAO,KAAK,EACX,aAAa,EACb,qBAAqB,EACrB,iBAAiB,EACjB,sBAAsB,EACtB,gBAAgB,EAChB,oBAAoB,EACpB,MAAM,8CAA8C,CAAC;
|
|
1
|
+
{"version":3,"file":"summaryUtils.d.ts","sourceRoot":"","sources":["../src/summaryUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,gDAAgD,CAAC;AAEpG,OAAO,KAAK,EACX,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,KAAK,E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AS,CAAoD;IAE9E;;OAEG;IACI,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,6BAA6B,GAAG,IAAI;IAIxF;;OAEG;IACI,WAAW,CACjB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,6BAA6B,CAAC,GACnD,IAAI;IAOP;;;;;OAKG;IACI,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,6BAA6B;IAI3E;;;OAGG;IACI,SAAS,IAAI,MAAM;IAQnB,uBAAuB,IAAI,6BAA6B;IAIxD,uBAAuB,CAAC,KAAK,EAAE,6BAA6B,GAAG,IAAI;CAG1E;AAoBD;;;GAGG;AACH,qBAAa,aAAc,YAAW,sBAAsB;IAC3D,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAmC;IAC9D,IAAW,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAM7C;IAEM,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,IAAI;IAI1D;;;;;OAKG;IACI,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,IAAI;IAe5E,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,IAAI;IAMxD;;OAEG;IACI,kBAAkB,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI;IAM/C,SAAS,IAAI,sBAAsB;CAK1C"}
|
package/dist/summaryUtils.js
CHANGED
|
@@ -427,13 +427,17 @@ class TelemetryContext {
|
|
|
427
427
|
}
|
|
428
428
|
}
|
|
429
429
|
/**
|
|
430
|
-
*
|
|
430
|
+
* Get the telemetry data being tracked
|
|
431
|
+
* @param prefix - unique prefix to tag this data with (ex: "fluid:map:")
|
|
432
|
+
* @param property - property name of the telemetry data being tracked (ex: "DirectoryCount")
|
|
433
|
+
* @returns undefined if item not found
|
|
431
434
|
*/
|
|
432
435
|
get(prefix, property) {
|
|
433
436
|
return this.telemetry.get(`${prefix}${property}`);
|
|
434
437
|
}
|
|
435
438
|
/**
|
|
436
|
-
*
|
|
439
|
+
* Returns a serialized version of all the telemetry data.
|
|
440
|
+
* Should be used when logging in telemetry events.
|
|
437
441
|
*/
|
|
438
442
|
serialize() {
|
|
439
443
|
const jsonObject = {};
|
|
@@ -442,6 +446,12 @@ class TelemetryContext {
|
|
|
442
446
|
}
|
|
443
447
|
return JSON.stringify(jsonObject);
|
|
444
448
|
}
|
|
449
|
+
getCurrentSummarizeStep() {
|
|
450
|
+
return this.get(internal_4.currentSummarizeStepPrefix, internal_4.currentSummarizeStepPropertyName);
|
|
451
|
+
}
|
|
452
|
+
setCurrentSummarizeStep(value) {
|
|
453
|
+
this.set(internal_4.currentSummarizeStepPrefix, internal_4.currentSummarizeStepPropertyName, value);
|
|
454
|
+
}
|
|
445
455
|
}
|
|
446
456
|
exports.TelemetryContext = TelemetryContext;
|
|
447
457
|
/**
|