@fluidframework/runtime-utils 2.74.0-365691 → 2.74.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 CHANGED
@@ -1,5 +1,9 @@
1
1
  # @fluidframework/runtime-utils
2
2
 
3
+ ## 2.74.0
4
+
5
+ Dependency updates only.
6
+
3
7
  ## 2.73.0
4
8
 
5
9
  Dependency updates only.
@@ -144,6 +144,7 @@ export declare function isValidMinVersionForCollab(minVersionForCollab: Semantic
144
144
  * Since this is used by validateMinimumVersionForCollab, the type case to MinimumVersionForCollab can not use it directly.
145
145
  * Thus this is just `as` cast here, and a test confirms it is valid according to validateMinimumVersionForCollab.
146
146
  *
147
+ * @internal
147
148
  */
148
149
  export declare const cleanedPackageVersion: MinimumVersionForCollab;
149
150
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"compatibilityBase.d.ts","sourceRoot":"","sources":["../src/compatibilityBase.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AAM5F;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,0BAA0B,kBACqB,CAAC;AAE7D;;;;;;;;;;GAUG;AACH,eAAO,MAAM,yBAAyB,SAAqD,CAAC;AAE5F;;;;;;;GAOG;AACH,MAAM,MAAM,2BAA2B,GAAG,GAAG,MAAM,IAAI,MAAM,IAAI,GAAG,GAAG,MAAM,eAAe,CAAC;AAE7F;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GACxB,GAAG,MAAM,IAAI,MAAM,IAAI,MAAM,EAAE,GAC/B,GAAG,MAAM,IAAI,MAAM,IAAI,MAAM,IAAI,MAAM,EAAE,CAAC;AAE7C;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI;IAC1D,QAAQ,EAAE,CAAC,IAA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AyBG;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"}
@@ -139,6 +139,7 @@ const parsedPackageVersion = (0, semver_ts_1.parse)(packageVersion_js_1.pkgVersi
139
139
  * Since this is used by validateMinimumVersionForCollab, the type case to MinimumVersionForCollab can not use it directly.
140
140
  * Thus this is just `as` cast here, and a test confirms it is valid according to validateMinimumVersionForCollab.
141
141
  *
142
+ * @internal
142
143
  */
143
144
  exports.cleanedPackageVersion = `${parsedPackageVersion.major}.${parsedPackageVersion.minor}.${parsedPackageVersion.patch}`;
144
145
  /**
@@ -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,QAA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,CAAC;YACrC,OAAO,+BAA+B,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QACzD,CAAC;QACD,4GAA4G;QAC5G,0GAA0G;QAC1G,4GAA4G;QAC5G,wGAAwG;QACxG,mHAAmH;QACnH,MAAM,gBAAgB,GAAsB,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\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 */\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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ourcesContent":["/*!\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"]}
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, } from "./compatibilityBase.js";
20
+ export { configValueToMinVersionForCollab, defaultMinVersionForCollab, validateConfigMapOverrides, getConfigForMinVersionForCollab, getConfigsForMinVersionForCollab, isValidMinVersionForCollab, validateMinimumVersionForCollab, lowestMinVersionForCollab, cleanedPackageVersion, } from "./compatibilityBase.js";
21
21
  export type { ConfigMap, ConfigMapEntry, ConfigValidationMap, MinimumMinorSemanticVersion, SemanticVersion, } from "./compatibilityBase.js";
22
22
  //# sourceMappingURL=index.d.ts.map
@@ -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,EACl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C;AAC3B,OAAO,EACN,gCAAgC,EAChC,0BAA0B,EAC1B,0BAA0B,EAC1B,+BAA+B,EAC/B,gCAAgC,EAChC,0BAA0B,EAC1B,+BAA+B,EAC/B,yBAAyB,EACzB,qBAAqB,GACrB,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.lowestMinVersionForCollab = exports.validateMinimumVersionForCollab = void 0;
8
+ exports.cleanedPackageVersion = 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,4 +72,5 @@ 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, "cleanedPackageVersion", { enumerable: true, get: function () { return compatibilityBase_js_1.cleanedPackageVersion; } });
75
76
  //# 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,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,iIAAA,yBAAyB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. 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} from \"./compatibilityBase.js\";\nexport type {\n\tConfigMap,\n\tConfigMapEntry,\n\tConfigValidationMap,\n\tMinimumMinorSemanticVersion,\n\tSemanticVersion,\n} from \"./compatibilityBase.js\";\n"]}
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,gBAAgB,OAAA;AAChB,8HAAA,2BAA2B,OAAA;AAC3B,iHAAA,cAAc,OAAA;AACd,mIAAA,gCAAgC,OAAA;AAChC,4HAAA,yBAAyB,OAAA;AACzB,uHAAA,oBAAoB,OAAA;AACpB,gIAAA,6BAA6B,OAAA;AAC7B,gHAAA,aAAa,OAAA;AACb,8GAAA,WAAW,OAAA;AACX,6GAAA,UAAU,OAAA;AACV,6HAAA,0BAA0B,OAAA;AAC1B,qHAAA,kBAAkB,OAAA;AAClB,mHAAA,gBAAgB,OAAA;AAChB,iHAAA,cAAc,OAAA;AAEf,6DAAmE;AAA1D,iIAAA,0BAA0B,OAAA;AACnC,uCAIoB;AAHnB,0GAAA,cAAc,OAAA;AACd,uGAAA,WAAW,OAAA;AACX,mHAAA,uBAAuB,OAAA;AAGxB,uDAA8E;AAArE,4IAAA,wCAAwC,OAAA;AACjD,qDAG2B;AAF1B,uHAAA,oBAAoB,OAAA;AACpB,yHAAA,sBAAsB,OAAA;AAEvB,+DAUgC;AAT/B,wIAAA,gCAAgC,OAAA;AAChC,kIAAA,0BAA0B,OAAA;AAC1B,kIAAA,0BAA0B,OAAA;AAC1B,uIAAA,+BAA+B,OAAA;AAC/B,wIAAA,gCAAgC,OAAA;AAChC,kIAAA,0BAA0B,OAAA;AAC1B,uIAAA,+BAA+B,OAAA;AAC/B,iIAAA,yBAAyB,OAAA;AACzB,6HAAA,qBAAqB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. 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\tcleanedPackageVersion,\n} from \"./compatibilityBase.js\";\nexport type {\n\tConfigMap,\n\tConfigMapEntry,\n\tConfigValidationMap,\n\tMinimumMinorSemanticVersion,\n\tSemanticVersion,\n} from \"./compatibilityBase.js\";\n"]}
@@ -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.74.0-365691";
8
+ export declare const pkgVersion = "2.74.0";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,kCAAkC,CAAC;AACvD,eAAO,MAAM,UAAU,kBAAkB,CAAC"}
1
+ {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,kCAAkC,CAAC;AACvD,eAAO,MAAM,UAAU,WAAW,CAAC"}
@@ -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.74.0-365691";
11
+ exports.pkgVersion = "2.74.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,eAAe,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.74.0-365691\";\n"]}
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.74.0\";\n"]}
@@ -0,0 +1,18 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * GENERATED FILE - DO NOT EDIT DIRECTLY.
4
+ * To regenerate: pnpm tsx scripts/generate-flat-eslint-configs.ts --typescript
5
+ */
6
+ import type { Linter } from "eslint";
7
+ import { strict } from "../../../common/build/eslint-config-fluid/flat.mts";
8
+
9
+ const config: Linter.Config[] = [
10
+ ...strict,
11
+ {
12
+ rules: {
13
+ "@fluid-internal/fluid/no-unchecked-record-access": "warn",
14
+ },
15
+ },
16
+ ];
17
+
18
+ export default config;
@@ -144,6 +144,7 @@ export declare function isValidMinVersionForCollab(minVersionForCollab: Semantic
144
144
  * Since this is used by validateMinimumVersionForCollab, the type case to MinimumVersionForCollab can not use it directly.
145
145
  * Thus this is just `as` cast here, and a test confirms it is valid according to validateMinimumVersionForCollab.
146
146
  *
147
+ * @internal
147
148
  */
148
149
  export declare const cleanedPackageVersion: MinimumVersionForCollab;
149
150
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"compatibilityBase.d.ts","sourceRoot":"","sources":["../src/compatibilityBase.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AAM5F;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,0BAA0B,kBACqB,CAAC;AAE7D;;;;;;;;;;GAUG;AACH,eAAO,MAAM,yBAAyB,SAAqD,CAAC;AAE5F;;;;;;;GAOG;AACH,MAAM,M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EAC5C,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC,GACvB,CAAC,CAkBH;AAED;;;;;;GAMG;AACH,wBAAgB,oCAAoC,CAAC,mBAAmB,EAAE,eAAe,GAAG;IAC3F,aAAa,EAAE,OAAO,CAAC;IACvB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,eAAe,EAAE,OAAO,CAAC;CACzB,CAUA;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACzC,mBAAmB,EAAE,eAAe,GAClC,mBAAmB,IAAI,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"}
@@ -132,6 +132,7 @@ const parsedPackageVersion = parse(pkgVersion) ?? fail("Invalid package version"
132
132
  * Since this is used by validateMinimumVersionForCollab, the type case to MinimumVersionForCollab can not use it directly.
133
133
  * Thus this is just `as` cast here, and a test confirms it is valid according to validateMinimumVersionForCollab.
134
134
  *
135
+ * @internal
135
136
  */
136
137
  export const cleanedPackageVersion = `${parsedPackageVersion.major}.${parsedPackageVersion.minor}.${parsedPackageVersion.patch}`;
137
138
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"compatibilityBase.js","sourceRoot":"","sources":["../src/compatibilityBase.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC;AAEnE,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAEhE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,0BAA0B,GACtC,gBAA2D,CAAC;AAE7D;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,OAAkD,CAAC;AAiE5F;;;;;;;GAOG;AACH,MAAM,UAAU,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;AAED;;;;GAIG;AACH,MAAM,UAAU,+BAA+B,CAC9C,mBAA4C,EAC5C,MAAyB;IAEzB,MAAM,OAAO,GAAwB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,wEAAwE;IACrI,8DAA8D;IAC9D,MAAM,QAA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D;YAC3D,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,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","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 */\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,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC;AAEnE,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAEhE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,0BAA0B,GACtC,gBAA2D,CAAC;AAE7D;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,OAAkD,CAAC;AAiE5F;;;;;;;GAOG;AACH,MAAM,UAAU,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,CAA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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,OAAO,CAAC,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","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"]}
package/lib/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, } from "./compatibilityBase.js";
20
+ export { configValueToMinVersionForCollab, defaultMinVersionForCollab, validateConfigMapOverrides, getConfigForMinVersionForCollab, getConfigsForMinVersionForCollab, isValidMinVersionForCollab, validateMinimumVersionForCollab, lowestMinVersionForCollab, cleanedPackageVersion, } from "./compatibilityBase.js";
21
21
  export type { ConfigMap, ConfigMapEntry, ConfigValidationMap, MinimumMinorSemanticVersion, SemanticVersion, } from "./compatibilityBase.js";
22
22
  //# sourceMappingURL=index.d.ts.map
@@ -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,0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oB,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,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,qBAAqB,GACrB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EACX,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,2BAA2B,EAC3B,eAAe,GACf,MAAM,wBAAwB,CAAC"}
package/lib/index.js CHANGED
@@ -15,5 +15,5 @@ export { unpackChildNodesUsedRoutes } from "./unpackUsedRoutes.js";
15
15
  export { RuntimeHeaders, seqFromTree, encodeCompactIdToString, } from "./utils.js";
16
16
  export { isSnapshotFetchRequiredForLoadingGroupId } from "./snapshotUtils.js";
17
17
  export { toDeltaManagerErased, toDeltaManagerInternal, } from "./deltaManager.js";
18
- export { configValueToMinVersionForCollab, defaultMinVersionForCollab, validateConfigMapOverrides, getConfigForMinVersionForCollab, getConfigsForMinVersionForCollab, isValidMinVersionForCollab, validateMinimumVersionForCollab, lowestMinVersionForCollab, } from "./compatibilityBase.js";
18
+ export { configValueToMinVersionForCollab, defaultMinVersionForCollab, validateConfigMapOverrides, getConfigForMinVersionForCollab, getConfigsForMinVersionForCollab, isValidMinVersionForCollab, validateMinimumVersionForCollab, lowestMinVersionForCollab, cleanedPackageVersion, } from "./compatibilityBase.js";
19
19
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,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;AAEtB,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,cAAc,EACd,WAAW,EACX,uBAAuB,GACvB,MAAM,YAAY,CAAC;AAEpB,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,GACzB,MAAM,wBAAwB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. 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} from \"./compatibilityBase.js\";\nexport type {\n\tConfigMap,\n\tConfigMapEntry,\n\tConfigValidationMap,\n\tMinimumMinorSemanticVersion,\n\tSemanticVersion,\n} from \"./compatibilityBase.js\";\n"]}
1
+ {"version":3,"file":"index.js","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;AAEtB,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,cAAc,EACd,WAAW,EACX,uBAAuB,GACvB,MAAM,YAAY,CAAC;AAEpB,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,qBAAqB,GACrB,MAAM,wBAAwB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. 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\tcleanedPackageVersion,\n} from \"./compatibilityBase.js\";\nexport type {\n\tConfigMap,\n\tConfigMapEntry,\n\tConfigValidationMap,\n\tMinimumMinorSemanticVersion,\n\tSemanticVersion,\n} from \"./compatibilityBase.js\";\n"]}
@@ -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.74.0-365691";
8
+ export declare const pkgVersion = "2.74.0";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,kCAAkC,CAAC;AACvD,eAAO,MAAM,UAAU,kBAAkB,CAAC"}
1
+ {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,kCAAkC,CAAC;AACvD,eAAO,MAAM,UAAU,WAAW,CAAC"}
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export const pkgName = "@fluidframework/runtime-utils";
8
- export const pkgVersion = "2.74.0-365691";
8
+ export const pkgVersion = "2.74.0";
9
9
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,+BAA+B,CAAC;AACvD,MAAM,CAAC,MAAM,UAAU,GAAG,eAAe,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.74.0-365691\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,+BAA+B,CAAC;AACvD,MAAM,CAAC,MAAM,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.74.0\";\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/runtime-utils",
3
- "version": "2.74.0-365691",
3
+ "version": "2.74.0",
4
4
  "description": "Collection of utility functions for Fluid Runtime",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -79,26 +79,26 @@
79
79
  "temp-directory": "nyc/.nyc_output"
80
80
  },
81
81
  "dependencies": {
82
- "@fluid-internal/client-utils": "2.74.0-365691",
83
- "@fluidframework/container-definitions": "2.74.0-365691",
84
- "@fluidframework/container-runtime-definitions": "2.74.0-365691",
85
- "@fluidframework/core-interfaces": "2.74.0-365691",
86
- "@fluidframework/core-utils": "2.74.0-365691",
87
- "@fluidframework/datastore-definitions": "2.74.0-365691",
88
- "@fluidframework/driver-definitions": "2.74.0-365691",
89
- "@fluidframework/driver-utils": "2.74.0-365691",
90
- "@fluidframework/runtime-definitions": "2.74.0-365691",
91
- "@fluidframework/telemetry-utils": "2.74.0-365691",
82
+ "@fluid-internal/client-utils": "~2.74.0",
83
+ "@fluidframework/container-definitions": "~2.74.0",
84
+ "@fluidframework/container-runtime-definitions": "~2.74.0",
85
+ "@fluidframework/core-interfaces": "~2.74.0",
86
+ "@fluidframework/core-utils": "~2.74.0",
87
+ "@fluidframework/datastore-definitions": "~2.74.0",
88
+ "@fluidframework/driver-definitions": "~2.74.0",
89
+ "@fluidframework/driver-utils": "~2.74.0",
90
+ "@fluidframework/runtime-definitions": "~2.74.0",
91
+ "@fluidframework/telemetry-utils": "~2.74.0",
92
92
  "semver-ts": "^1.0.3"
93
93
  },
94
94
  "devDependencies": {
95
95
  "@arethetypeswrong/cli": "^0.17.1",
96
96
  "@biomejs/biome": "~1.9.3",
97
- "@fluid-internal/mocha-test-setup": "2.74.0-365691",
98
- "@fluid-tools/build-cli": "^0.60.0",
97
+ "@fluid-internal/mocha-test-setup": "~2.74.0",
98
+ "@fluid-tools/build-cli": "^0.61.0",
99
99
  "@fluidframework/build-common": "^2.0.3",
100
- "@fluidframework/build-tools": "^0.60.0",
101
- "@fluidframework/eslint-config-fluid": "2.74.0-365691",
100
+ "@fluidframework/build-tools": "^0.61.0",
101
+ "@fluidframework/eslint-config-fluid": "~2.74.0",
102
102
  "@fluidframework/runtime-utils-previous": "npm:@fluidframework/runtime-utils@2.73.0",
103
103
  "@microsoft/api-extractor": "7.52.11",
104
104
  "@types/mocha": "^10.0.10",
@@ -109,6 +109,7 @@
109
109
  "copyfiles": "^2.4.1",
110
110
  "cross-env": "^7.0.3",
111
111
  "eslint": "~8.57.1",
112
+ "jiti": "^2.6.1",
112
113
  "mocha": "^10.8.2",
113
114
  "mocha-multi-reporters": "^1.5.1",
114
115
  "rimraf": "^4.4.0",
@@ -225,6 +225,7 @@ const parsedPackageVersion = parse(pkgVersion) ?? fail("Invalid package version"
225
225
  * Since this is used by validateMinimumVersionForCollab, the type case to MinimumVersionForCollab can not use it directly.
226
226
  * Thus this is just `as` cast here, and a test confirms it is valid according to validateMinimumVersionForCollab.
227
227
  *
228
+ * @internal
228
229
  */
229
230
  export const cleanedPackageVersion =
230
231
  `${parsedPackageVersion.major}.${parsedPackageVersion.minor}.${parsedPackageVersion.patch}` as MinimumVersionForCollab;
package/src/index.ts CHANGED
@@ -70,6 +70,7 @@ export {
70
70
  isValidMinVersionForCollab,
71
71
  validateMinimumVersionForCollab,
72
72
  lowestMinVersionForCollab,
73
+ cleanedPackageVersion,
73
74
  } from "./compatibilityBase.js";
74
75
  export type {
75
76
  ConfigMap,
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/runtime-utils";
9
- export const pkgVersion = "2.74.0-365691";
9
+ export const pkgVersion = "2.74.0";