@fluidframework/runtime-utils 2.60.0 → 2.61.0-355516

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.
Files changed (50) hide show
  1. package/.mocharc.cjs +1 -2
  2. package/dist/compatibilityBase.d.ts +9 -0
  3. package/dist/compatibilityBase.d.ts.map +1 -1
  4. package/dist/compatibilityBase.js +17 -1
  5. package/dist/compatibilityBase.js.map +1 -1
  6. package/dist/dataStoreHelpers.d.ts.map +1 -1
  7. package/dist/dataStoreHelpers.js +9 -9
  8. package/dist/dataStoreHelpers.js.map +1 -1
  9. package/dist/handles.d.ts +19 -0
  10. package/dist/handles.d.ts.map +1 -1
  11. package/dist/handles.js +39 -1
  12. package/dist/handles.js.map +1 -1
  13. package/dist/index.d.ts +2 -2
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +3 -1
  16. package/dist/index.js.map +1 -1
  17. package/dist/legacy.d.ts +4 -2
  18. package/dist/packageVersion.d.ts +1 -1
  19. package/dist/packageVersion.d.ts.map +1 -1
  20. package/dist/packageVersion.js +1 -1
  21. package/dist/packageVersion.js.map +1 -1
  22. package/dist/public.d.ts +2 -1
  23. package/lib/compatibilityBase.d.ts +9 -0
  24. package/lib/compatibilityBase.d.ts.map +1 -1
  25. package/lib/compatibilityBase.js +15 -0
  26. package/lib/compatibilityBase.js.map +1 -1
  27. package/lib/dataStoreHelpers.d.ts.map +1 -1
  28. package/lib/dataStoreHelpers.js +9 -9
  29. package/lib/dataStoreHelpers.js.map +1 -1
  30. package/lib/handles.d.ts +19 -0
  31. package/lib/handles.d.ts.map +1 -1
  32. package/lib/handles.js +37 -0
  33. package/lib/handles.js.map +1 -1
  34. package/lib/index.d.ts +2 -2
  35. package/lib/index.d.ts.map +1 -1
  36. package/lib/index.js +2 -2
  37. package/lib/index.js.map +1 -1
  38. package/lib/legacy.d.ts +4 -2
  39. package/lib/packageVersion.d.ts +1 -1
  40. package/lib/packageVersion.d.ts.map +1 -1
  41. package/lib/packageVersion.js +1 -1
  42. package/lib/packageVersion.js.map +1 -1
  43. package/lib/public.d.ts +2 -1
  44. package/lib/tsdoc-metadata.json +1 -1
  45. package/package.json +21 -21
  46. package/src/compatibilityBase.ts +21 -0
  47. package/src/dataStoreHelpers.ts +10 -11
  48. package/src/handles.ts +53 -0
  49. package/src/index.ts +2 -0
  50. package/src/packageVersion.ts +1 -1
package/.mocharc.cjs CHANGED
@@ -7,6 +7,5 @@
7
7
 
8
8
  const getFluidTestMochaConfig = require("@fluid-internal/mocha-test-setup/mocharc-common");
9
9
 
10
- const packageDir = __dirname;
11
- const config = getFluidTestMochaConfig(packageDir);
10
+ const config = getFluidTestMochaConfig(__dirname);
12
11
  module.exports = config;
@@ -70,6 +70,15 @@ export declare function getConfigsForMinVersionForCollab<T extends Record<Semant
70
70
  * @internal
71
71
  */
72
72
  export declare function isValidMinVersionForCollab(minVersionForCollab: MinimumVersionForCollab): boolean;
73
+ /**
74
+ * Converts a SemanticVersion to a MinimumVersionForCollab.
75
+ * @param semanticVersion - The version to convert.
76
+ * @returns The version as a MinimumVersionForCollab.
77
+ * @throws UsageError if the version is not a valid MinimumVersionForCollab.
78
+ *
79
+ * @internal
80
+ */
81
+ export declare function semanticVersionToMinimumVersionForCollab(semanticVersion: SemanticVersion): MinimumVersionForCollab;
73
82
  /**
74
83
  * Generic function to validate runtime options against the minVersionForCollab.
75
84
  *
@@ -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;AAU7D;;;;;;;GAOG;AACH,MAAM,MAAM,2BAA2B,GAAG,GAAG,MAAM,IAAI,MAAM,IAAI,GAAG,GAAG,MAAM,eAAe,CAAC;AAE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AC,CAAC,GACrB,OAAO,CAAC,CAAC,CAAC,CAuBZ;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACzC,mBAAmB,EAAE,uBAAuB,GAC1C,OAAO,CAMT;AAED;;;;;;;GAOG;AACH,wBAAgB,wCAAwC,CACvD,eAAe,EAAE,eAAe,GAC9B,uBAAuB,CASzB;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/E,mBAAmB,EAAE,eAAe,EACpC,cAAc,EAAE,OAAO,CAAC,CAAC,CAAC,EAC1B,aAAa,EAAE,mBAAmB,CAAC,CAAC,CAAC,GACnC,IAAI,CAyBN;AAED;;;;;GAKG;AACH,wBAAgB,gCAAgC,CAC/C,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,EACxD,GAAG,SAAS,SAAS,CAAC,CAAC,EAAE,eAAe,CAAC,EAAE,EAC1C,cAAc,EAAE,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC,KAAK,eAAe,GAAG,SAAS,CAoCtE"}
@@ -4,7 +4,7 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.configValueToMinVersionForCollab = exports.getValidationForRuntimeOptions = exports.isValidMinVersionForCollab = exports.getConfigsForMinVersionForCollab = exports.defaultMinVersionForCollab = void 0;
7
+ exports.configValueToMinVersionForCollab = exports.getValidationForRuntimeOptions = exports.semanticVersionToMinimumVersionForCollab = exports.isValidMinVersionForCollab = exports.getConfigsForMinVersionForCollab = exports.defaultMinVersionForCollab = void 0;
8
8
  const internal_1 = require("@fluidframework/core-utils/internal");
9
9
  const internal_2 = require("@fluidframework/telemetry-utils/internal");
10
10
  const semver_ts_1 = require("semver-ts");
@@ -80,6 +80,22 @@ function isValidMinVersionForCollab(minVersionForCollab) {
80
80
  (0, semver_ts_1.lte)(minVersionForCollab, packageVersion_js_1.pkgVersion));
81
81
  }
82
82
  exports.isValidMinVersionForCollab = isValidMinVersionForCollab;
83
+ /**
84
+ * Converts a SemanticVersion to a MinimumVersionForCollab.
85
+ * @param semanticVersion - The version to convert.
86
+ * @returns The version as a MinimumVersionForCollab.
87
+ * @throws UsageError if the version is not a valid MinimumVersionForCollab.
88
+ *
89
+ * @internal
90
+ */
91
+ function semanticVersionToMinimumVersionForCollab(semanticVersion) {
92
+ const minVersionForCollab = semanticVersion;
93
+ if (!isValidMinVersionForCollab(minVersionForCollab)) {
94
+ throw new internal_2.UsageError(`Version ${minVersionForCollab} is not a valid MinimumVersionForCollab.`);
95
+ }
96
+ return minVersionForCollab;
97
+ }
98
+ exports.semanticVersionToMinimumVersionForCollab = semanticVersionToMinimumVersionForCollab;
83
99
  /**
84
100
  * Generic function to validate runtime options against the minVersionForCollab.
85
101
  *
@@ -1 +1 @@
1
- {"version":3,"file":"compatibilityBase.js","sourceRoot":"","sources":["../src/compatibilityBase.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAE7D,uEAAsE;AACtE,yCAAyD;AAEzD,2DAAiD;AAEjD;;;;;;;;;;;;;;;;;;;GAmBG;AACU,QAAA,0BAA0B,GACtC,gBAA2D,CAAC;AAE7D;;;;;GAKG;AACH,MAAM,yBAAyB,GAAG,OAAkD,CAAC;AAyCrF;;;;GAIG;AACH,SAAgB,gCAAgC,CAC/C,mBAAoC,EACpC,SAAuB;IAEvB,MAAM,cAAc,GAAe,EAAE,CAAC;IACtC,gEAAgE;IAChE,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;QAC1C,kEAAkE;QAClE,MAAM,MAAM,GAAG,SAAS,CAAC,GAAc,CAAC,CAAC;QACzC,yEAAyE;QACzE,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,mBAAO,CAAC,CAAC;QACnD,sHAA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AAC,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 } 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 } from \"semver-ts\";\n\nimport { pkgVersion } from \"./packageVersion.js\";\n\n/**\n * Our policy is to support N/N-1 compatibility by default, where N is the most\n * recent public major release of the runtime.\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 */\nconst 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 * Generic type for runtimeOptionsAffectingDocSchemaConfigMap\n *\n * @internal\n */\nexport type ConfigMap<T extends Record<string, unknown>> = {\n\t[K in keyof T]-?: Record<MinimumMinorSemanticVersion, T[K]>;\n};\n\n/**\n * Generic type for runtimeOptionsAffectingDocSchemaConfigValidationMap\n *\n * @internal\n */\nexport type ConfigValidationMap<T extends Record<string, unknown>> = {\n\t[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 * @internal\n */\nexport function getConfigsForMinVersionForCollab<T extends Record<SemanticVersion, unknown>>(\n\tminVersionForCollab: SemanticVersion,\n\tconfigMap: ConfigMap<T>,\n): Partial<T> {\n\tconst defaultConfigs: Partial<T> = {};\n\t// Iterate over configMap to get default values for each option.\n\tfor (const key of Object.keys(configMap)) {\n\t\t// Type assertion is safe as key comes from Object.keys(configMap)\n\t\tconst config = configMap[key as keyof T];\n\t\t// Sort the versions in ascending order so we can short circuit the loop.\n\t\tconst versions = Object.keys(config).sort(compare);\n\t\t// For each config, we iterate over the keys and check if minVersionForCollab is greater than or equal to the version.\n\t\t// If so, we set it as the default value for the option. At the end of the loop we should have the most recent default\n\t\t// value that is compatible with the version specified as the minVersionForCollab.\n\t\tfor (const version of versions) {\n\t\t\tif (gte(minVersionForCollab, version)) {\n\t\t\t\t// Type assertion is safe as version is a key from the config object\n\t\t\t\tdefaultConfigs[key] = config[version as MinimumMinorSemanticVersion];\n\t\t\t} else {\n\t\t\t\t// If the minVersionForCollab is less than the version, we break out of the loop since we don't need to check\n\t\t\t\t// any later versions.\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn defaultConfigs;\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: MinimumVersionForCollab,\n): boolean {\n\treturn (\n\t\tvalid(minVersionForCollab) !== null &&\n\t\tgte(minVersionForCollab, lowestMinVersionForCollab) &&\n\t\tlte(minVersionForCollab, pkgVersion)\n\t);\n}\n\n/**\n * Generic function to validate runtime options against the minVersionForCollab.\n *\n * @internal\n */\nexport function getValidationForRuntimeOptions<T extends Record<string, unknown>>(\n\tminVersionForCollab: SemanticVersion,\n\truntimeOptions: 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\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(\n\t\truntimeOptions,\n\t) as [keyof T & string, T[keyof T & string]][]) {\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,kEAA6D;AAE7D,uEAAsE;AACtE,yCAAyD;AAEzD,2DAAiD;AAEjD;;;;;;;;;;;;;;;;;;;GAmBG;AACU,QAAA,0BAA0B,GACtC,gBAA2D,CAAC;AAE7D;;;;;GAKG;AACH,MAAM,yBAAyB,GAAG,OAAkD,CAAC;AAyCrF;;;;GAIG;AACH,SAAgB,gCAAgC,CAC/C,mBAAoC,EACpC,SAAuB;IAEvB,MAAM,cAAc,GAAe,EAAE,CAAC;IACtC,gEAAgE;IAChE,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;QAC1C,kEAAkE;QAClE,MAAM,MAAM,GAAG,SAAS,CAAC,GAAc,CAAC,CAAC;QACzC,yEAAyE;QACzE,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,mBAAO,CAAC,CAAC;QACnD,sHAAsH;QACtH,sHAAsH;QACtH,kFAAkF;QAClF,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAChC,IAAI,IAAA,eAAG,EAAC,mBAAmB,EAAE,OAAO,CAAC,EAAE,CAAC;gBACvC,oEAAoE;gBACpE,cAAc,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,OAAsC,CAAC,CAAC;YACtE,CAAC;iBAAM,CAAC;gBACP,6GAA6G;gBAC7G,sBAAsB;gBACtB,MAAM;YACP,CAAC;QACF,CAAC;IACF,CAAC;IACD,OAAO,cAAc,CAAC;AACvB,CAAC;AA1BD,4E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D,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 } 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 } from \"semver-ts\";\n\nimport { pkgVersion } from \"./packageVersion.js\";\n\n/**\n * Our policy is to support N/N-1 compatibility by default, where N is the most\n * recent public major release of the runtime.\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 */\nconst 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 * Generic type for runtimeOptionsAffectingDocSchemaConfigMap\n *\n * @internal\n */\nexport type ConfigMap<T extends Record<string, unknown>> = {\n\t[K in keyof T]-?: Record<MinimumMinorSemanticVersion, T[K]>;\n};\n\n/**\n * Generic type for runtimeOptionsAffectingDocSchemaConfigValidationMap\n *\n * @internal\n */\nexport type ConfigValidationMap<T extends Record<string, unknown>> = {\n\t[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 * @internal\n */\nexport function getConfigsForMinVersionForCollab<T extends Record<SemanticVersion, unknown>>(\n\tminVersionForCollab: SemanticVersion,\n\tconfigMap: ConfigMap<T>,\n): Partial<T> {\n\tconst defaultConfigs: Partial<T> = {};\n\t// Iterate over configMap to get default values for each option.\n\tfor (const key of Object.keys(configMap)) {\n\t\t// Type assertion is safe as key comes from Object.keys(configMap)\n\t\tconst config = configMap[key as keyof T];\n\t\t// Sort the versions in ascending order so we can short circuit the loop.\n\t\tconst versions = Object.keys(config).sort(compare);\n\t\t// For each config, we iterate over the keys and check if minVersionForCollab is greater than or equal to the version.\n\t\t// If so, we set it as the default value for the option. At the end of the loop we should have the most recent default\n\t\t// value that is compatible with the version specified as the minVersionForCollab.\n\t\tfor (const version of versions) {\n\t\t\tif (gte(minVersionForCollab, version)) {\n\t\t\t\t// Type assertion is safe as version is a key from the config object\n\t\t\t\tdefaultConfigs[key] = config[version as MinimumMinorSemanticVersion];\n\t\t\t} else {\n\t\t\t\t// If the minVersionForCollab is less than the version, we break out of the loop since we don't need to check\n\t\t\t\t// any later versions.\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn defaultConfigs;\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: MinimumVersionForCollab,\n): boolean {\n\treturn (\n\t\tvalid(minVersionForCollab) !== null &&\n\t\tgte(minVersionForCollab, lowestMinVersionForCollab) &&\n\t\tlte(minVersionForCollab, pkgVersion)\n\t);\n}\n\n/**\n * Converts a SemanticVersion to a MinimumVersionForCollab.\n * @param semanticVersion - The version to convert.\n * @returns The version as a MinimumVersionForCollab.\n * @throws UsageError if the version is not a valid MinimumVersionForCollab.\n *\n * @internal\n */\nexport function semanticVersionToMinimumVersionForCollab(\n\tsemanticVersion: SemanticVersion,\n): MinimumVersionForCollab {\n\tconst minVersionForCollab = semanticVersion as MinimumVersionForCollab;\n\tif (!isValidMinVersionForCollab(minVersionForCollab)) {\n\t\tthrow new UsageError(\n\t\t\t`Version ${minVersionForCollab} is not a valid MinimumVersionForCollab.`,\n\t\t);\n\t}\n\n\treturn minVersionForCollab;\n}\n\n/**\n * Generic function to validate runtime options against the minVersionForCollab.\n *\n * @internal\n */\nexport function getValidationForRuntimeOptions<T extends Record<string, unknown>>(\n\tminVersionForCollab: SemanticVersion,\n\truntimeOptions: 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\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(\n\t\truntimeOptions,\n\t) as [keyof T & string, T[keyof T & string]][]) {\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 +1 @@
1
- {"version":3,"file":"dataStoreHelpers.d.ts","sourceRoot":"","sources":["../src/dataStoreHelpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAyB3E;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,CA8B7D;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,GAAG,KAAK,CAiBjF;AAED;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,YAAa,QAAQ,KAAG,SACP,CAAC;AAEhD;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAClC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,QAAQ,EACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,SAAS,CAiBX"}
1
+ {"version":3,"file":"dataStoreHelpers.d.ts","sourceRoot":"","sources":["../src/dataStoreHelpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAyB3E;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,CA4B7D;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,GAAG,KAAK,CAkBjF;AAED;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,YAAa,QAAQ,KAAG,SACP,CAAC;AAEhD;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAClC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,QAAQ,EACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,SAAS,CAiBX"}
@@ -34,17 +34,16 @@ function exceptionToResponse(error) {
34
34
  headers: error.underlyingResponseHeaders,
35
35
  };
36
36
  }
37
- // Capture error objects, not stack itself, as stack retrieval is very expensive operation
38
- const errWithStack = (0, internal_2.generateErrorWithStack)();
37
+ // Both error generation, and accessing the stack value are expensive operations, so we only create an error if necessary, and then defer accessing the stack value until it is needed.
38
+ const errWithStack = typeof error === "object" && error !== null && "stack" in error
39
+ ? error
40
+ : (0, internal_2.generateErrorWithStack)();
39
41
  return {
40
42
  mimeType: "text/plain",
41
43
  status,
42
44
  value: `${error}`,
43
45
  get stack() {
44
- // Use type assertion after checking if error is an object with stack
45
- return ((typeof error === "object" && error !== null && "stack" in error
46
- ? error.stack
47
- : undefined) ?? errWithStack.stack);
46
+ return errWithStack.stack;
48
47
  },
49
48
  };
50
49
  }
@@ -60,14 +59,15 @@ function responseToException(response, request) {
60
59
  // As of 2025-08-20 the code seems to assume `response.value` is always a string.
61
60
  // This type assertion just encodes that assumption as we move to stricter linting rules, but it might need to be revisited.
62
61
  const message = response.value;
63
- const errWithStack = (0, internal_2.generateErrorWithStack)();
62
+ // Both error generation, and accessing the stack value are expensive operations, so we only create an error if necessary, and then defer accessing the stack value until it is needed.
63
+ const errWithStack = "stack" in response ? response : (0, internal_2.generateErrorWithStack)();
64
64
  const responseErr = {
65
65
  errorFromRequestFluidObject: true,
66
66
  message,
67
67
  name: "Error",
68
68
  code: response.status,
69
69
  get stack() {
70
- return response.stack ?? errWithStack.stack;
70
+ return errWithStack.stack;
71
71
  },
72
72
  underlyingResponseHeaders: response.headers,
73
73
  };
@@ -96,7 +96,7 @@ function createResponseError(status, value, request, headers) {
96
96
  (0, internal_1.assert)(status !== 200, 0x19b /* "Cannot not create response error on 200 status" */);
97
97
  // Omit query string which could contain personal data unfit for logging
98
98
  const urlNoQuery = request.url?.split("?")[0];
99
- // Capture error objects, not stack itself, as stack retrieval is very expensive operation, so we delay it
99
+ // Both error generation, and accessing the stack value are expensive operations, so we only create an error if necessary, and then defer accessing the stack value until it is needed.
100
100
  const errWithStack = (0, internal_2.generateErrorWithStack)();
101
101
  return {
102
102
  mimeType: "text/plain",
@@ -1 +1 @@
1
- {"version":3,"file":"dataStoreHelpers.js","sourceRoot":"","sources":["../src/dataStoreHelpers.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,kEAA6D;AAC7D,uEAAkF;AAUlF;;;GAGG;AACH,SAAS,mBAAmB,CAAC,GAAY;IACxC,OAAO,CACN,GAAG,KAAK,IAAI;QACZ,OAAO,GAAG,KAAK,QAAQ;QACvB,6BAA6B,IAAI,GAAG;QACnC,GAAgD,CAAC,2BAA2B,KAAK,IAAI,CACtF,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,SAAgB,mBAAmB,CAAC,KAAc;IACjD,MAAM,MAAM,GAAG,GAAG,CAAC;IACnB,IAAI,mBAAmB,CAAC,KAAK,CAAC,EAAE,CAAC;QAChC,OAAO;YACN,QAAQ,EAAE,YAAY;YACtB,MAAM,EAAE,KAAK,CAAC,IAAI;YAClB,KAAK,EAAE,KAAK,CAAC,OAAO;YACpB,IAAI,KAAK;gBACR,OAAO,KAAK,CAAC,KAAK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AAc,EACd,KAAa,EACb,OAAiB,EACjB,OAAiC;IAEjC,IAAA,iBAAM,EAAC,MAAM,KAAK,GAAG,EAAE,KAAK,CAAC,sDAAsD,CAAC,CAAC;IACrF,wEAAwE;IACxE,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAE9C,0GAA0G;IAC1G,MAAM,YAAY,GAAG,IAAA,iCAAsB,GAAE,CAAC;IAE9C,OAAO;QACN,QAAQ,EAAE,YAAY;QACtB,MAAM;QACN,KAAK,EAAE,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,KAAK,UAAU,EAAE;QACnE,IAAI,KAAK;YACR,OAAO,YAAY,CAAC,KAAK,CAAC;QAC3B,CAAC;QACD,OAAO;KACP,CAAC;AACH,CAAC;AAtBD,kDAsBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IRequest, IResponse } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { generateErrorWithStack } from \"@fluidframework/telemetry-utils/internal\";\n\ninterface IResponseException extends Error {\n\terrorFromRequestFluidObject: true;\n\tmessage: string;\n\tcode: number;\n\tstack?: string;\n\tunderlyingResponseHeaders?: Record<string, unknown>;\n}\n\n/**\n * Type guard for determining if an error is an {@link IResponseException}.\n * @internal\n */\nfunction isResponseException(err: unknown): err is IResponseException {\n\treturn (\n\t\terr !== null &&\n\t\ttypeof err === \"object\" &&\n\t\t\"errorFromRequestFluidObject\" in err &&\n\t\t(err as { errorFromRequestFluidObject: unknown }).errorFromRequestFluidObject === true\n\t);\n}\n\n/**\n * Converts an error object into an {@link @fluidframework/core-interfaces#IResponse}.\n * @internal\n */\nexport function exceptionToResponse(error: unknown): IResponse {\n\tconst status = 500;\n\tif (isResponseException(error)) {\n\t\treturn {\n\t\t\tmimeType: \"text/plain\",\n\t\t\tstatus: error.code,\n\t\t\tvalue: error.message,\n\t\t\tget stack() {\n\t\t\t\treturn error.stack;\n\t\t\t},\n\t\t\theaders: error.underlyingResponseHeaders,\n\t\t};\n\t}\n\n\t// Capture error objects, not stack itself, as stack retrieval is very expensive operation\n\tconst errWithStack = generateErrorWithStack();\n\n\treturn {\n\t\tmimeType: \"text/plain\",\n\t\tstatus,\n\t\tvalue: `${error}`,\n\t\tget stack() {\n\t\t\t// Use type assertion after checking if error is an object with stack\n\t\t\treturn (\n\t\t\t\t(typeof error === \"object\" && error !== null && \"stack\" in error\n\t\t\t\t\t? (error.stack as string | undefined)\n\t\t\t\t\t: undefined) ?? errWithStack.stack\n\t\t\t);\n\t\t},\n\t};\n}\n\n/**\n * Converts an {@link @fluidframework/core-interfaces#IResponse} back into an Error object that can be thrown.\n * @param response - The {@link @fluidframework/core-interfaces#IResponse} to convert.\n * @param request - The original {@link @fluidframework/core-interfaces#IRequest}.\n * @returns An Error object with additional properties from the response\n * @internal\n */\nexport function responseToException(response: IResponse, request: IRequest): Error {\n\t// As of 2025-08-20 the code seems to assume `response.value` is always a string.\n\t// This type assertion just encodes that assumption as we move to stricter linting rules, but it might need to be revisited.\n\tconst message = response.value as string;\n\tconst errWithStack = generateErrorWithStack();\n\tconst responseErr: Error & IResponseException = {\n\t\terrorFromRequestFluidObject: true,\n\t\tmessage,\n\t\tname: \"Error\",\n\t\tcode: response.status,\n\t\tget stack() {\n\t\t\treturn response.stack ?? errWithStack.stack;\n\t\t},\n\t\tunderlyingResponseHeaders: response.headers,\n\t};\n\n\treturn responseErr;\n}\n\n/**\n * Creates a 404 \"not found\" response for the given request\n * @param request - The request that resulted in the 404 response\n * @returns An {@link @fluidframework/core-interfaces#IResponse} with 404 status code.\n * @legacy\n * @beta\n */\nexport const create404Response = (request: IRequest): IResponse =>\n\tcreateResponseError(404, \"not found\", request);\n\n/**\n * Creates an error response with the specified status code and message\n * @param status - HTTP status code for the error (must not be 200)\n * @param value - Error message or description\n * @param request - The request that resulted in this error\n * @param headers - Optional headers to include in the response\n * @returns An {@link @fluidframework/core-interfaces#IResponse} representing the error\n * @internal\n */\nexport function createResponseError(\n\tstatus: number,\n\tvalue: string,\n\trequest: IRequest,\n\theaders?: Record<string, unknown>,\n): IResponse {\n\tassert(status !== 200, 0x19b /* \"Cannot not create response error on 200 status\" */);\n\t// Omit query string which could contain personal data unfit for logging\n\tconst urlNoQuery = request.url?.split(\"?\")[0];\n\n\t// Capture error objects, not stack itself, as stack retrieval is very expensive operation, so we delay it\n\tconst errWithStack = generateErrorWithStack();\n\n\treturn {\n\t\tmimeType: \"text/plain\",\n\t\tstatus,\n\t\tvalue: urlNoQuery === undefined ? value : `${value}: ${urlNoQuery}`,\n\t\tget stack() {\n\t\t\treturn errWithStack.stack;\n\t\t},\n\t\theaders,\n\t};\n}\n"]}
1
+ {"version":3,"file":"dataStoreHelpers.js","sourceRoot":"","sources":["../src/dataStoreHelpers.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,kEAA6D;AAC7D,uEAAkF;AAUlF;;;GAGG;AACH,SAAS,mBAAmB,CAAC,GAAY;IACxC,OAAO,CACN,GAAG,KAAK,IAAI;QACZ,OAAO,GAAG,KAAK,QAAQ;QACvB,6BAA6B,IAAI,GAAG;QACnC,GAAgD,CAAC,2BAA2B,KAAK,IAAI,CACtF,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,SAAgB,mBAAmB,CAAC,KAAc;IACjD,MAAM,MAAM,GAAG,GAAG,CAAC;IACnB,IAAI,mBAAmB,CAAC,KAAK,CAAC,EAAE,CAAC;QAChC,OAAO;YACN,QAAQ,EAAE,YAAY;YACtB,MAAM,EAAE,KAAK,CAAC,IAAI;YAClB,KAAK,EAAE,KAAK,CAAC,OAAO;YACpB,IAAI,KAAK;gBACR,OAAO,KAAK,CAAC,KAAK,CAAC;YACpB,CAAC;YACD,OAAO,EAAE,KAAK,CAAC,yBAAyB;SACxC,CAAC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K,GAAG,EAAE,KAAK,CAAC,sDAAsD,CAAC,CAAC;IACrF,wEAAwE;IACxE,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAE9C,uLAAuL;IACvL,MAAM,YAAY,GAAG,IAAA,iCAAsB,GAAE,CAAC;IAE9C,OAAO;QACN,QAAQ,EAAE,YAAY;QACtB,MAAM;QACN,KAAK,EAAE,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,KAAK,UAAU,EAAE;QACnE,IAAI,KAAK;YACR,OAAO,YAAY,CAAC,KAAK,CAAC;QAC3B,CAAC;QACD,OAAO;KACP,CAAC;AACH,CAAC;AAtBD,kDAsBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IRequest, IResponse } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { generateErrorWithStack } from \"@fluidframework/telemetry-utils/internal\";\n\ninterface IResponseException extends Error {\n\terrorFromRequestFluidObject: true;\n\tmessage: string;\n\tcode: number;\n\tstack?: string;\n\tunderlyingResponseHeaders?: Record<string, unknown>;\n}\n\n/**\n * Type guard for determining if an error is an {@link IResponseException}.\n * @internal\n */\nfunction isResponseException(err: unknown): err is IResponseException {\n\treturn (\n\t\terr !== null &&\n\t\ttypeof err === \"object\" &&\n\t\t\"errorFromRequestFluidObject\" in err &&\n\t\t(err as { errorFromRequestFluidObject: unknown }).errorFromRequestFluidObject === true\n\t);\n}\n\n/**\n * Converts an error object into an {@link @fluidframework/core-interfaces#IResponse}.\n * @internal\n */\nexport function exceptionToResponse(error: unknown): IResponse {\n\tconst status = 500;\n\tif (isResponseException(error)) {\n\t\treturn {\n\t\t\tmimeType: \"text/plain\",\n\t\t\tstatus: error.code,\n\t\t\tvalue: error.message,\n\t\t\tget stack() {\n\t\t\t\treturn error.stack;\n\t\t\t},\n\t\t\theaders: error.underlyingResponseHeaders,\n\t\t};\n\t}\n\n\t// Both error generation, and accessing the stack value are expensive operations, so we only create an error if necessary, and then defer accessing the stack value until it is needed.\n\tconst errWithStack =\n\t\ttypeof error === \"object\" && error !== null && \"stack\" in error\n\t\t\t? (error as { stack: string })\n\t\t\t: generateErrorWithStack();\n\n\treturn {\n\t\tmimeType: \"text/plain\",\n\t\tstatus,\n\t\tvalue: `${error}`,\n\t\tget stack() {\n\t\t\treturn errWithStack.stack;\n\t\t},\n\t};\n}\n\n/**\n * Converts an {@link @fluidframework/core-interfaces#IResponse} back into an Error object that can be thrown.\n * @param response - The {@link @fluidframework/core-interfaces#IResponse} to convert.\n * @param request - The original {@link @fluidframework/core-interfaces#IRequest}.\n * @returns An Error object with additional properties from the response\n * @internal\n */\nexport function responseToException(response: IResponse, request: IRequest): Error {\n\t// As of 2025-08-20 the code seems to assume `response.value` is always a string.\n\t// This type assertion just encodes that assumption as we move to stricter linting rules, but it might need to be revisited.\n\tconst message = response.value as string;\n\t// Both error generation, and accessing the stack value are expensive operations, so we only create an error if necessary, and then defer accessing the stack value until it is needed.\n\tconst errWithStack = \"stack\" in response ? response : generateErrorWithStack();\n\tconst responseErr: Error & IResponseException = {\n\t\terrorFromRequestFluidObject: true,\n\t\tmessage,\n\t\tname: \"Error\",\n\t\tcode: response.status,\n\t\tget stack() {\n\t\t\treturn errWithStack.stack;\n\t\t},\n\t\tunderlyingResponseHeaders: response.headers,\n\t};\n\n\treturn responseErr;\n}\n\n/**\n * Creates a 404 \"not found\" response for the given request\n * @param request - The request that resulted in the 404 response\n * @returns An {@link @fluidframework/core-interfaces#IResponse} with 404 status code.\n * @legacy\n * @beta\n */\nexport const create404Response = (request: IRequest): IResponse =>\n\tcreateResponseError(404, \"not found\", request);\n\n/**\n * Creates an error response with the specified status code and message\n * @param status - HTTP status code for the error (must not be 200)\n * @param value - Error message or description\n * @param request - The request that resulted in this error\n * @param headers - Optional headers to include in the response\n * @returns An {@link @fluidframework/core-interfaces#IResponse} representing the error\n * @internal\n */\nexport function createResponseError(\n\tstatus: number,\n\tvalue: string,\n\trequest: IRequest,\n\theaders?: Record<string, unknown>,\n): IResponse {\n\tassert(status !== 200, 0x19b /* \"Cannot not create response error on 200 status\" */);\n\t// Omit query string which could contain personal data unfit for logging\n\tconst urlNoQuery = request.url?.split(\"?\")[0];\n\n\t// Both error generation, and accessing the stack value are expensive operations, so we only create an error if necessary, and then defer accessing the stack value until it is needed.\n\tconst errWithStack = generateErrorWithStack();\n\n\treturn {\n\t\tmimeType: \"text/plain\",\n\t\tstatus,\n\t\tvalue: urlNoQuery === undefined ? value : `${value}: ${urlNoQuery}`,\n\t\tget stack() {\n\t\t\treturn errWithStack.stack;\n\t\t},\n\t\theaders,\n\t};\n}\n"]}
package/dist/handles.d.ts CHANGED
@@ -2,6 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
+ import type { IContainerRuntime } from "@fluidframework/container-runtime-definitions/internal";
5
6
  import type { IFluidHandleErased } from "@fluidframework/core-interfaces";
6
7
  import { IFluidHandle, fluidHandleSymbol } from "@fluidframework/core-interfaces";
7
8
  import type { IFluidHandleInternal, IFluidHandleInternalPayloadPending, IFluidHandlePayloadPending, ILocalFluidHandle } from "@fluidframework/core-interfaces/internal";
@@ -93,4 +94,22 @@ export declare abstract class FluidHandleBase<T> implements IFluidHandleInternal
93
94
  get IFluidHandle(): IFluidHandleInternal;
94
95
  get [fluidHandleSymbol](): IFluidHandleErased<T>;
95
96
  }
97
+ /**
98
+ * Lookup the blob storage ID for a blob handle.
99
+ * @param containerRuntime - The container runtime instance
100
+ * @param handle - The blob handle to lookup the storage ID for
101
+ * @returns The storage ID if found and the blob is not pending, undefined otherwise
102
+ * @remarks
103
+ * This is a legacy+alpha helper function that provides access to blob storage IDs.
104
+ * For blobs with pending payloads (localId exists but upload hasn't finished), this is expected to return undefined.
105
+ * Consumers should use the observability APIs on the handle (handle.payloadState, payloadShared event)
106
+ * to understand/wait for storage ID availability.
107
+ * Similarly, when the runtime is detached, this will return undefined as no blobs have been uploaded to storage.
108
+ *
109
+ * Warning: the returned blob URL may expire and does not support permalinks.
110
+ * This API is intended for temporary integration scenarios only.
111
+ * @legacy
112
+ * @alpha
113
+ */
114
+ export declare function lookupTemporaryBlobStorageId(containerRuntime: IContainerRuntime, handle: IFluidHandle): string | undefined;
96
115
  //# sourceMappingURL=handles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"handles.d.ts","sourceRoot":"","sources":["../src/handles.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAClF,OAAO,KAAK,EACX,oBAAoB,EACpB,kCAAkC,EAClC,0BAA0B,EAC1B,iBAAiB,EACjB,MAAM,0CAA0C,CAAC;AAElD;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAEjC,IAAI,EAAE,kBAAkB,CAAC;IAGzB,GAAG,EAAE,MAAM,CAAC;IAEZ;;;;;;;;OAQG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,IAAI,CAAC;CAC/B;AAED;;;GAGG;AACH,eAAO,MAAM,kBAAkB,UAAW,OAAO,+BAEqB,CAAC;AAEvE;;;GAGG;AACH,eAAO,MAAM,mCAAmC,wBAC1B,oBAAoB,uEAE6C,CAAC;AAExF;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B,cAC/B,aAAa,CAAC,CAAC,4CAGgD,CAAC;AAEzE;;;GAGG;AACH,eAAO,MAAM,kBAAkB,cACtB,aAAa,CAAC,CAAC,mCAE6C,CAAC;AACtE;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,oBAAoB,GAAG,iBAAiB,CAW5F;AAcD;;;;;G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BAAoB,CAE9C;IAED,IAAW,CAAC,iBAAiB,CAAC,IAAI,kBAAkB,CAAC,CAAC,CAAC,CAEtD;CACD;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,4BAA4B,CAC3C,gBAAgB,EAAE,iBAAiB,EACnC,MAAM,EAAE,YAAY,GAClB,MAAM,GAAG,SAAS,CA2BpB"}
package/dist/handles.js CHANGED
@@ -4,7 +4,7 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.FluidHandleBase = exports.toFluidHandleErased = exports.toFluidHandleInternal = exports.compareFluidHandles = exports.isFluidHandle = exports.encodeHandleForSerialization = exports.isLocalFluidHandle = exports.isFluidHandlePayloadPending = exports.isFluidHandleInternalPayloadPending = exports.isSerializedHandle = void 0;
7
+ exports.lookupTemporaryBlobStorageId = exports.FluidHandleBase = exports.toFluidHandleErased = exports.toFluidHandleInternal = exports.compareFluidHandles = exports.isFluidHandle = exports.encodeHandleForSerialization = exports.isLocalFluidHandle = exports.isFluidHandlePayloadPending = exports.isFluidHandleInternalPayloadPending = exports.isSerializedHandle = void 0;
8
8
  const core_interfaces_1 = require("@fluidframework/core-interfaces");
9
9
  /**
10
10
  * Narrow a value to {@link ISerializedHandle} by checking its type property.
@@ -149,4 +149,42 @@ class FluidHandleBase {
149
149
  }
150
150
  }
151
151
  exports.FluidHandleBase = FluidHandleBase;
152
+ /**
153
+ * Lookup the blob storage ID for a blob handle.
154
+ * @param containerRuntime - The container runtime instance
155
+ * @param handle - The blob handle to lookup the storage ID for
156
+ * @returns The storage ID if found and the blob is not pending, undefined otherwise
157
+ * @remarks
158
+ * This is a legacy+alpha helper function that provides access to blob storage IDs.
159
+ * For blobs with pending payloads (localId exists but upload hasn't finished), this is expected to return undefined.
160
+ * Consumers should use the observability APIs on the handle (handle.payloadState, payloadShared event)
161
+ * to understand/wait for storage ID availability.
162
+ * Similarly, when the runtime is detached, this will return undefined as no blobs have been uploaded to storage.
163
+ *
164
+ * Warning: the returned blob URL may expire and does not support permalinks.
165
+ * This API is intended for temporary integration scenarios only.
166
+ * @legacy
167
+ * @alpha
168
+ */
169
+ function lookupTemporaryBlobStorageId(containerRuntime, handle) {
170
+ // Verify that the handle points to a blob by checking its path format
171
+ const absolutePath = toFluidHandleInternal(handle).absolutePath;
172
+ // Blob handles have paths in the format "/_blobs/{localId}"
173
+ if (!absolutePath?.startsWith("/_blobs/")) {
174
+ throw new Error("Handle does not point to a blob - expected path to start with '/_blobs/'");
175
+ }
176
+ // Extract the local ID from the path
177
+ const pathParts = absolutePath.split("/");
178
+ if (pathParts.length !== 3 ||
179
+ pathParts[1] !== "_blobs" ||
180
+ pathParts[2] === undefined ||
181
+ pathParts[2] === "") {
182
+ throw new Error("Invalid blob handle path format");
183
+ }
184
+ const localId = pathParts[2];
185
+ // Cast the runtime to the internal interface and call the lookup method
186
+ const internalRuntime = containerRuntime;
187
+ return internalRuntime.lookupTemporaryBlobStorageId(localId);
188
+ }
189
+ exports.lookupTemporaryBlobStorageId = lookupTemporaryBlobStorageId;
152
190
  //# sourceMappingURL=handles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"handles.js","sourceRoot":"","sources":["../src/handles.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,qEAAkF;AA+BlF;;;GAGG;AACI,MAAM,kBAAkB,GAAG,CAAC,KAAc,EAA8B,EAAE;AAChF,uFAAuF;AACtF,KAAuC,EAAE,IAAI,KAAK,kBAAkB,CAAC;AAF1D,QAAA,kBAAkB,sBAEwC;AAEvE;;;GAGG;AACI,MAAM,mCAAmC,GAAG,CAClD,mBAAyC,EACmB,EAAE,CAC9D,gBAAgB,IAAI,mBAAmB,IAAI,mBAAmB,CAAC,cAAc,KAAK,IAAI,CAAC;AAH3E,QAAA,mCAAmC,uCAGwC;AAExF;;;;;;GAMG;AACI,MAAM,2BAA2B,GAAG,CAC1C,MAAuB,EACmB,EAAE,CAC5C,cAAc,IAAI,MAAM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IACD,OAAO,KAAK,CAAC;AACd,CAAC;AAnBD,sCAmBC;AAED;;;;;GAKG;AACH,SAAgB,mBAAmB,CAAC,CAAe,EAAE,CAAe;IACnE,MAAM,SAAS,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAAC;IAC3C,MAAM,SAAS,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAAC;IAC3C,OAAO,SAAS,CAAC,YAAY,KAAK,SAAS,CAAC,YAAY,CAAC;AAC1D,CAAC;AAJD,kDAIC;AAED;;;GAGG;AACH,SAAgB,qBAAqB,CAAI,MAAuB;IAC/D,IAAI,CAAC,CAAC,mCAAiB,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,mCAAiB,IAAI,MAAM,CAAC,mCAAiB,CAAC,CAAC,EAAE,CAAC;QACzF,IAAI,4BAA4B,IAAI,8BAAY,IAAI,MAAM,EAAE,CAAC;YAC5D,0EAA0E;YAC1E,OAAO,MAAM,CAAC,8BAAY,CAA4B,CAAC;QACxD,CAAC;QACD,MAAM,IAAI,SAAS,CAAC,sBAAsB,CAAC,CAAC;IAC7C,CAAC;IAED,kGAAkG;IAClG,6FAA6F;IAC7F,+FAA+F;IAC/F,OAAO,MAAM,CAAC,mCAAiB,CAAuC,CAAC;AACxE,CAAC;AAbD,sDAaC;AAED;;;GAGG;AACH,SAAgB,mBAAmB,CAClC,MAA+B;IAE/B,kFAAkF;IAClF,OAAO,MAA0C,CAAC;AACnD,CAAC;AALD,kDAKC;AAED;;;GAGG;AACH,MAAsB,eAAe;IAMpC;;OAEG;IACH,IAAW,YAAY;QACtB,OAAO,IAAI,CAAC;IACb,CAAC;IAED,IAAW,CAAC,mCAAiB,CAAC;QAC7B,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;CACD;AAhBD,0CAgBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidHandleErased } from \"@fluidframework/core-interfaces\";\nimport { IFluidHandle, fluidHandleSymbol } from \"@fluidframework/core-interfaces\";\nimport type {\n\tIFluidHandleInternal,\n\tIFluidHandleInternalPayloadPending,\n\tIFluidHandlePayloadPending,\n\tILocalFluidHandle,\n} from \"@fluidframework/core-interfaces/internal\";\n\n/**\n * JSON serialized form of an IFluidHandle\n * @internal\n */\nexport interface ISerializedHandle {\n\t// Marker to indicate to JSON.parse that the object is a Fluid handle\n\ttype: \"__fluid_handle__\";\n\n\t// URL to the object. Relative URLs are relative to the handle context passed to the stringify.\n\turl: string;\n\n\t/**\n\t * The handle may have a pending payload, as determined by and resolvable by the subsystem that\n\t * the handle relates to. For instance, the BlobManager uses this to distinguish blob handles\n\t * which may not yet have an attached blob yet.\n\t *\n\t * @remarks\n\t * Will only exist if the handle was created with a pending payload, will be omitted entirely from\n\t * the serialized format if the handle was created with an already-shared payload.\n\t */\n\treadonly payloadPending?: true;\n}\n\n/**\n * Narrow a value to {@link ISerializedHandle} by checking its type property.\n * @internal\n */\nexport const isSerializedHandle = (value: unknown): value is ISerializedHandle =>\n\t// Type assertion is safe as we're only checking for the existence of the type property\n\t(value as { type?: string } | undefined)?.type === \"__fluid_handle__\";\n\n/**\n * Checks if a Fluid handle's internal payload is pending.\n * @internal\n */\nexport const isFluidHandleInternalPayloadPending = (\n\tfluidHandleInternal: IFluidHandleInternal,\n): fluidHandleInternal is IFluidHandleInternalPayloadPending =>\n\t\"payloadPending\" in fluidHandleInternal && fluidHandleInternal.payloadPending === true;\n\n/**\n * Check if the handle is an IFluidHandlePayloadPending.\n * @privateRemarks\n * This should be true for locally-created BlobHandles currently. When IFluidHandlePayloadPending is merged\n * to IFluidHandle, this type guard will no longer be necessary.\n * @legacy @beta\n */\nexport const isFluidHandlePayloadPending = <T>(\n\thandle: IFluidHandle<T>,\n): handle is IFluidHandlePayloadPending<T> =>\n\t\"payloadState\" in handle &&\n\t(handle.payloadState === \"shared\" || handle.payloadState === \"pending\");\n\n/**\n * Check if the handle is an ILocalFluidHandle.\n * @legacy @beta\n */\nexport const isLocalFluidHandle = <T>(\n\thandle: IFluidHandle<T>,\n): handle is ILocalFluidHandle<T> =>\n\tisFluidHandlePayloadPending(handle) && \"payloadShareError\" in handle;\n/**\n * Encodes the given IFluidHandle into a JSON-serializable form,\n * @param handle - The IFluidHandle to serialize.\n * @returns The serialized handle.\n *\n * @internal\n */\nexport function encodeHandleForSerialization(handle: IFluidHandleInternal): ISerializedHandle {\n\treturn isFluidHandleInternalPayloadPending(handle)\n\t\t? {\n\t\t\t\ttype: \"__fluid_handle__\",\n\t\t\t\turl: handle.absolutePath,\n\t\t\t\tpayloadPending: true,\n\t\t\t}\n\t\t: {\n\t\t\t\ttype: \"__fluid_handle__\",\n\t\t\t\turl: handle.absolutePath,\n\t\t\t};\n}\n\n/**\n * Setting to opt into compatibility with handles from before {@link fluidHandleSymbol} existed (Fluid Framework client 2.0.0-rc.3.0.0 and earlier).\n *\n * Some code which uses this library might dynamically load multiple versions of it,\n * as well as old or duplicated versions of packages which produce or implement handles.\n * To correctly interoperate with this old packages and object produced by them, the old in-memory format for handles, without the symbol, are explicitly supported.\n *\n * This setting mostly exists as a way to easily find any code that only exists to provide this compatibility and clarify how to remove that compatibility.\n * At some point this might be removed or turned into an actual configuration option, but for now its really just documentation.\n */\nconst enableBackwardsCompatibility = true;\n\n/**\n * Check if a value is an {@link @fluidframework/core-interfaces#IFluidHandle}.\n * @remarks\n * Objects which have a field named `IFluidHandle` can in some cases produce a false positive.\n * @public\n */\nexport function isFluidHandle(value: unknown): value is IFluidHandle {\n\t// `in` gives a type error on non-objects and null, so filter them out\n\tif (typeof value !== \"object\" || value === null) {\n\t\treturn false;\n\t}\n\tif (fluidHandleSymbol in value) {\n\t\treturn true;\n\t}\n\t// If enableBackwardsCompatibility, run check for FluidHandles predating use of fluidHandleSymbol.\n\tif (enableBackwardsCompatibility && IFluidHandle in value) {\n\t\t// Since this check can have false positives, make it a bit more robust by checking value[IFluidHandle][IFluidHandle]\n\t\t// Type assertion is needed for backward compatibility with old FluidHandle format\n\t\tconst inner = value[IFluidHandle] as IFluidHandle;\n\t\tif (typeof inner !== \"object\" || inner === null) {\n\t\t\treturn false;\n\t\t}\n\t\treturn IFluidHandle in inner;\n\t}\n\treturn false;\n}\n\n/**\n * Compare two {@link @fluidframework/core-interfaces#IFluidHandle|IFluidHandles}.\n * @remarks\n * Returns true iff both handles have the same internal `absolutePath`.\n * @public\n */\nexport function compareFluidHandles(a: IFluidHandle, b: IFluidHandle): boolean {\n\tconst aInternal = toFluidHandleInternal(a);\n\tconst bInternal = toFluidHandleInternal(b);\n\treturn aInternal.absolutePath === bInternal.absolutePath;\n}\n\n/**\n * Downcast an IFluidHandle to an IFluidHandleInternal.\n * @legacy @beta\n */\nexport function toFluidHandleInternal<T>(handle: IFluidHandle<T>): IFluidHandleInternal<T> {\n\tif (!(fluidHandleSymbol in handle) || !(fluidHandleSymbol in handle[fluidHandleSymbol])) {\n\t\tif (enableBackwardsCompatibility && IFluidHandle in handle) {\n\t\t\t// Type assertion needed for backward compatibility with old handle format\n\t\t\treturn handle[IFluidHandle] as IFluidHandleInternal<T>;\n\t\t}\n\t\tthrow new TypeError(\"Invalid IFluidHandle\");\n\t}\n\n\t// This casts the IFluidHandleErased from the symbol instead of `handle` to ensure that if someone\n\t// implements their own IFluidHandle in terms of an existing handle, it won't break anything.\n\t// Type assertion is safe as fluidHandleSymbol is guaranteed to contain an IFluidHandleInternal\n\treturn handle[fluidHandleSymbol] as unknown as IFluidHandleInternal<T>;\n}\n\n/**\n * Type erase IFluidHandleInternal for use with {@link @fluidframework/core-interfaces#fluidHandleSymbol}.\n * @legacy @beta\n */\nexport function toFluidHandleErased<T>(\n\thandle: IFluidHandleInternal<T>,\n): IFluidHandleErased<T> {\n\t// Type assertion is safe as we're intentionally erasing internal type information\n\treturn handle as unknown as IFluidHandleErased<T>;\n}\n\n/**\n * Base class which can be uses to assist implementing IFluidHandleInternal.\n * @legacy @beta\n */\nexport abstract class FluidHandleBase<T> implements IFluidHandleInternal<T> {\n\tpublic abstract absolutePath: string;\n\tpublic abstract attachGraph(): void;\n\tpublic abstract readonly isAttached: boolean;\n\tpublic abstract get(): Promise<T>;\n\n\t/**\n\t * {@inheritDoc @fluidframework/core-interfaces#IProvideFluidHandle.IFluidHandle}\n\t */\n\tpublic get IFluidHandle(): IFluidHandleInternal {\n\t\treturn this;\n\t}\n\n\tpublic get [fluidHandleSymbol](): IFluidHandleErased<T> {\n\t\treturn toFluidHandleErased(this);\n\t}\n}\n"]}
1
+ {"version":3,"file":"handles.js","sourceRoot":"","sources":["../src/handles.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAOH,qEAAkF;AA+BlF;;;GAGG;AACI,MAAM,kBAAkB,GAAG,CAAC,KAAc,EAA8B,EAAE;AAChF,uFAAuF;AACtF,KAAuC,EAAE,IAAI,KAAK,kBAAkB,CAAC;AAF1D,QAAA,kBAAkB,sBAEwC;AAEvE;;;GAGG;AACI,MAAM,mCAAmC,GAAG,CAClD,mBAAyC,EACmB,EAAE,CAC9D,gBAAgB,IAAI,mBAAmB,IAAI,mBAAmB,CAAC,cAAc,KAAK,IAAI,CAAC;AAH3E,QAAA,mCAAmC,uCAGwC;AAExF;;;;;;GAMG;AACI,MAAM,2BAA2B,GAAG,CAC1C,MAAuB,EACmB,EAAE,CAC5C,cAAc,IAAI,MAAM;IACxB,CAAC,MAAM,CAAC,YAAY,KAAK,QAAQ,IAAI,MAAM,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC;AAJ5D,QAAA,2BAA2B,+BAIiC;AAEzE;;;GAGG;AACI,MAAM,kBAAkB,GAAG,CACjC,MAAuB,EACU,EAAE,CACnC,IAAA,mCAA2B,EAAC,MAAM,CAAC,IAAI,mBAAmB,IAAI,MAAM,CAAC;AAHzD,QAAA,kBAAkB,sBAGuC;AACtE;;;;;;GAMG;AACH,SAAgB,4BAA4B,CAAC,MAA4B;IACxE,OAAO,IAAA,2CAAmC,EAAC,MAAM,CAAC;QACjD,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K,SAAS;QAC1B,SAAS,CAAC,CAAC,CAAC,KAAK,EAAE,EAClB,CAAC;QACF,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;IACpD,CAAC;IAED,MAAM,OAAO,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;IAE7B,wEAAwE;IACxE,MAAM,eAAe,GAAG,gBAA6C,CAAC;IACtE,OAAO,eAAe,CAAC,4BAA4B,CAAC,OAAO,CAAC,CAAC;AAC9D,CAAC;AA9BD,oEA8BC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tIContainerRuntime,\n\tIContainerRuntimeInternal,\n} from \"@fluidframework/container-runtime-definitions/internal\";\nimport type { IFluidHandleErased } from \"@fluidframework/core-interfaces\";\nimport { IFluidHandle, fluidHandleSymbol } from \"@fluidframework/core-interfaces\";\nimport type {\n\tIFluidHandleInternal,\n\tIFluidHandleInternalPayloadPending,\n\tIFluidHandlePayloadPending,\n\tILocalFluidHandle,\n} from \"@fluidframework/core-interfaces/internal\";\n\n/**\n * JSON serialized form of an IFluidHandle\n * @internal\n */\nexport interface ISerializedHandle {\n\t// Marker to indicate to JSON.parse that the object is a Fluid handle\n\ttype: \"__fluid_handle__\";\n\n\t// URL to the object. Relative URLs are relative to the handle context passed to the stringify.\n\turl: string;\n\n\t/**\n\t * The handle may have a pending payload, as determined by and resolvable by the subsystem that\n\t * the handle relates to. For instance, the BlobManager uses this to distinguish blob handles\n\t * which may not yet have an attached blob yet.\n\t *\n\t * @remarks\n\t * Will only exist if the handle was created with a pending payload, will be omitted entirely from\n\t * the serialized format if the handle was created with an already-shared payload.\n\t */\n\treadonly payloadPending?: true;\n}\n\n/**\n * Narrow a value to {@link ISerializedHandle} by checking its type property.\n * @internal\n */\nexport const isSerializedHandle = (value: unknown): value is ISerializedHandle =>\n\t// Type assertion is safe as we're only checking for the existence of the type property\n\t(value as { type?: string } | undefined)?.type === \"__fluid_handle__\";\n\n/**\n * Checks if a Fluid handle's internal payload is pending.\n * @internal\n */\nexport const isFluidHandleInternalPayloadPending = (\n\tfluidHandleInternal: IFluidHandleInternal,\n): fluidHandleInternal is IFluidHandleInternalPayloadPending =>\n\t\"payloadPending\" in fluidHandleInternal && fluidHandleInternal.payloadPending === true;\n\n/**\n * Check if the handle is an IFluidHandlePayloadPending.\n * @privateRemarks\n * This should be true for locally-created BlobHandles currently. When IFluidHandlePayloadPending is merged\n * to IFluidHandle, this type guard will no longer be necessary.\n * @legacy @beta\n */\nexport const isFluidHandlePayloadPending = <T>(\n\thandle: IFluidHandle<T>,\n): handle is IFluidHandlePayloadPending<T> =>\n\t\"payloadState\" in handle &&\n\t(handle.payloadState === \"shared\" || handle.payloadState === \"pending\");\n\n/**\n * Check if the handle is an ILocalFluidHandle.\n * @legacy @beta\n */\nexport const isLocalFluidHandle = <T>(\n\thandle: IFluidHandle<T>,\n): handle is ILocalFluidHandle<T> =>\n\tisFluidHandlePayloadPending(handle) && \"payloadShareError\" in handle;\n/**\n * Encodes the given IFluidHandle into a JSON-serializable form,\n * @param handle - The IFluidHandle to serialize.\n * @returns The serialized handle.\n *\n * @internal\n */\nexport function encodeHandleForSerialization(handle: IFluidHandleInternal): ISerializedHandle {\n\treturn isFluidHandleInternalPayloadPending(handle)\n\t\t? {\n\t\t\t\ttype: \"__fluid_handle__\",\n\t\t\t\turl: handle.absolutePath,\n\t\t\t\tpayloadPending: true,\n\t\t\t}\n\t\t: {\n\t\t\t\ttype: \"__fluid_handle__\",\n\t\t\t\turl: handle.absolutePath,\n\t\t\t};\n}\n\n/**\n * Setting to opt into compatibility with handles from before {@link fluidHandleSymbol} existed (Fluid Framework client 2.0.0-rc.3.0.0 and earlier).\n *\n * Some code which uses this library might dynamically load multiple versions of it,\n * as well as old or duplicated versions of packages which produce or implement handles.\n * To correctly interoperate with this old packages and object produced by them, the old in-memory format for handles, without the symbol, are explicitly supported.\n *\n * This setting mostly exists as a way to easily find any code that only exists to provide this compatibility and clarify how to remove that compatibility.\n * At some point this might be removed or turned into an actual configuration option, but for now its really just documentation.\n */\nconst enableBackwardsCompatibility = true;\n\n/**\n * Check if a value is an {@link @fluidframework/core-interfaces#IFluidHandle}.\n * @remarks\n * Objects which have a field named `IFluidHandle` can in some cases produce a false positive.\n * @public\n */\nexport function isFluidHandle(value: unknown): value is IFluidHandle {\n\t// `in` gives a type error on non-objects and null, so filter them out\n\tif (typeof value !== \"object\" || value === null) {\n\t\treturn false;\n\t}\n\tif (fluidHandleSymbol in value) {\n\t\treturn true;\n\t}\n\t// If enableBackwardsCompatibility, run check for FluidHandles predating use of fluidHandleSymbol.\n\tif (enableBackwardsCompatibility && IFluidHandle in value) {\n\t\t// Since this check can have false positives, make it a bit more robust by checking value[IFluidHandle][IFluidHandle]\n\t\t// Type assertion is needed for backward compatibility with old FluidHandle format\n\t\tconst inner = value[IFluidHandle] as IFluidHandle;\n\t\tif (typeof inner !== \"object\" || inner === null) {\n\t\t\treturn false;\n\t\t}\n\t\treturn IFluidHandle in inner;\n\t}\n\treturn false;\n}\n\n/**\n * Compare two {@link @fluidframework/core-interfaces#IFluidHandle|IFluidHandles}.\n * @remarks\n * Returns true iff both handles have the same internal `absolutePath`.\n * @public\n */\nexport function compareFluidHandles(a: IFluidHandle, b: IFluidHandle): boolean {\n\tconst aInternal = toFluidHandleInternal(a);\n\tconst bInternal = toFluidHandleInternal(b);\n\treturn aInternal.absolutePath === bInternal.absolutePath;\n}\n\n/**\n * Downcast an IFluidHandle to an IFluidHandleInternal.\n * @legacy @beta\n */\nexport function toFluidHandleInternal<T>(handle: IFluidHandle<T>): IFluidHandleInternal<T> {\n\tif (!(fluidHandleSymbol in handle) || !(fluidHandleSymbol in handle[fluidHandleSymbol])) {\n\t\tif (enableBackwardsCompatibility && IFluidHandle in handle) {\n\t\t\t// Type assertion needed for backward compatibility with old handle format\n\t\t\treturn handle[IFluidHandle] as IFluidHandleInternal<T>;\n\t\t}\n\t\tthrow new TypeError(\"Invalid IFluidHandle\");\n\t}\n\n\t// This casts the IFluidHandleErased from the symbol instead of `handle` to ensure that if someone\n\t// implements their own IFluidHandle in terms of an existing handle, it won't break anything.\n\t// Type assertion is safe as fluidHandleSymbol is guaranteed to contain an IFluidHandleInternal\n\treturn handle[fluidHandleSymbol] as unknown as IFluidHandleInternal<T>;\n}\n\n/**\n * Type erase IFluidHandleInternal for use with {@link @fluidframework/core-interfaces#fluidHandleSymbol}.\n * @legacy @beta\n */\nexport function toFluidHandleErased<T>(\n\thandle: IFluidHandleInternal<T>,\n): IFluidHandleErased<T> {\n\t// Type assertion is safe as we're intentionally erasing internal type information\n\treturn handle as unknown as IFluidHandleErased<T>;\n}\n\n/**\n * Base class which can be uses to assist implementing IFluidHandleInternal.\n * @legacy @beta\n */\nexport abstract class FluidHandleBase<T> implements IFluidHandleInternal<T> {\n\tpublic abstract absolutePath: string;\n\tpublic abstract attachGraph(): void;\n\tpublic abstract readonly isAttached: boolean;\n\tpublic abstract get(): Promise<T>;\n\n\t/**\n\t * {@inheritDoc @fluidframework/core-interfaces#IProvideFluidHandle.IFluidHandle}\n\t */\n\tpublic get IFluidHandle(): IFluidHandleInternal {\n\t\treturn this;\n\t}\n\n\tpublic get [fluidHandleSymbol](): IFluidHandleErased<T> {\n\t\treturn toFluidHandleErased(this);\n\t}\n}\n\n/**\n * Lookup the blob storage ID for a blob handle.\n * @param containerRuntime - The container runtime instance\n * @param handle - The blob handle to lookup the storage ID for\n * @returns The storage ID if found and the blob is not pending, undefined otherwise\n * @remarks\n * This is a legacy+alpha helper function that provides access to blob storage IDs.\n * For blobs with pending payloads (localId exists but upload hasn't finished), this is expected to return undefined.\n * Consumers should use the observability APIs on the handle (handle.payloadState, payloadShared event)\n * to understand/wait for storage ID availability.\n * Similarly, when the runtime is detached, this will return undefined as no blobs have been uploaded to storage.\n *\n * Warning: the returned blob URL may expire and does not support permalinks.\n * This API is intended for temporary integration scenarios only.\n * @legacy\n * @alpha\n */\nexport function lookupTemporaryBlobStorageId(\n\tcontainerRuntime: IContainerRuntime,\n\thandle: IFluidHandle,\n): string | undefined {\n\t// Verify that the handle points to a blob by checking its path format\n\tconst absolutePath: string | undefined = toFluidHandleInternal(handle).absolutePath;\n\n\t// Blob handles have paths in the format \"/_blobs/{localId}\"\n\tif (!absolutePath?.startsWith(\"/_blobs/\")) {\n\t\tthrow new Error(\n\t\t\t\"Handle does not point to a blob - expected path to start with '/_blobs/'\",\n\t\t);\n\t}\n\n\t// Extract the local ID from the path\n\tconst pathParts = absolutePath.split(\"/\");\n\tif (\n\t\tpathParts.length !== 3 ||\n\t\tpathParts[1] !== \"_blobs\" ||\n\t\tpathParts[2] === undefined ||\n\t\tpathParts[2] === \"\"\n\t) {\n\t\tthrow new Error(\"Invalid blob handle path format\");\n\t}\n\n\tconst localId = pathParts[2];\n\n\t// Cast the runtime to the internal interface and call the lookup method\n\tconst internalRuntime = containerRuntime as IContainerRuntimeInternal;\n\treturn internalRuntime.lookupTemporaryBlobStorageId(localId);\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  */
5
5
  export { generateHandleContextPath } from "./dataStoreHandleContextUtils.js";
6
6
  export { create404Response, createResponseError, exceptionToResponse, responseToException, } from "./dataStoreHelpers.js";
7
- export { compareFluidHandles, encodeHandleForSerialization, FluidHandleBase, isFluidHandle, isFluidHandleInternalPayloadPending, isFluidHandlePayloadPending, isLocalFluidHandle, isSerializedHandle, toFluidHandleErased, toFluidHandleInternal, } from "./handles.js";
7
+ export { compareFluidHandles, encodeHandleForSerialization, FluidHandleBase, isFluidHandle, isFluidHandleInternalPayloadPending, isFluidHandlePayloadPending, isLocalFluidHandle, isSerializedHandle, lookupTemporaryBlobStorageId, toFluidHandleErased, toFluidHandleInternal, } from "./handles.js";
8
8
  export type { ISerializedHandle } from "./handles.js";
9
9
  export { ObjectStoragePartition } from "./objectstoragepartition.js";
10
10
  export { getNormalizedObjectStoragePathParts, listBlobsAtTreePath, } from "./objectstorageutils.js";
@@ -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, getValidationForRuntimeOptions, getConfigsForMinVersionForCollab, isValidMinVersionForCollab, } from "./compatibilityBase.js";
20
+ export { configValueToMinVersionForCollab, defaultMinVersionForCollab, getValidationForRuntimeOptions, getConfigsForMinVersionForCollab, isValidMinVersionForCollab, semanticVersionToMinimumVersionForCollab, } from "./compatibilityBase.js";
21
21
  export type { ConfigMap, 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,GACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACN,mBAAmB,EACnB,4BAA4B,EAC5B,eAAe,EACf,aAAa,EACb,mCAAmC,EACnC,2BAA2B,EAC3B,kBAAkB,EAClB,kBAAkB,EAClB,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,MAA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E,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EACN,mCAAmC,EACnC,mBAAmB,GACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EACN,gBAAgB,EAChB,2BAA2B,EAC3B,cAAc,EACd,gCAAgC,EAChC,yBAAyB,EACzB,oBAAoB,EACpB,6BAA6B,EAC7B,aAAa,EACb,WAAW,EACX,UAAU,EACV,0BAA0B,EAC1B,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,GACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EACN,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,8BAA8B,EAC9B,gCAAgC,EAChC,0BAA0B,EAC1B,wCAAwC,GACxC,MAAM,wBAAwB,CAAC;AAChC,YAAY,EACX,SAAS,EACT,mBAAmB,EACnB,2BAA2B,EAC3B,eAAe,GACf,MAAM,wBAAwB,CAAC"}
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.isValidMinVersionForCollab = exports.getConfigsForMinVersionForCollab = exports.getValidationForRuntimeOptions = 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.isSerializedHandle = exports.isLocalFluidHandle = exports.isFluidHandlePayloadPending = exports.isFluidHandleInternalPayloadPending = exports.isFluidHandle = exports.FluidHandleBase = exports.encodeHandleForSerialization = exports.compareFluidHandles = exports.responseToException = exports.exceptionToResponse = exports.createResponseError = exports.create404Response = exports.generateHandleContextPath = void 0;
7
+ exports.semanticVersionToMinimumVersionForCollab = exports.isValidMinVersionForCollab = exports.getConfigsForMinVersionForCollab = exports.getValidationForRuntimeOptions = 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.responseToException = exports.exceptionToResponse = exports.createResponseError = exports.create404Response = exports.generateHandleContextPath = void 0;
8
8
  var dataStoreHandleContextUtils_js_1 = require("./dataStoreHandleContextUtils.js");
9
9
  Object.defineProperty(exports, "generateHandleContextPath", { enumerable: true, get: function () { return dataStoreHandleContextUtils_js_1.generateHandleContextPath; } });
10
10
  var dataStoreHelpers_js_1 = require("./dataStoreHelpers.js");
@@ -21,6 +21,7 @@ Object.defineProperty(exports, "isFluidHandleInternalPayloadPending", { enumerab
21
21
  Object.defineProperty(exports, "isFluidHandlePayloadPending", { enumerable: true, get: function () { return handles_js_1.isFluidHandlePayloadPending; } });
22
22
  Object.defineProperty(exports, "isLocalFluidHandle", { enumerable: true, get: function () { return handles_js_1.isLocalFluidHandle; } });
23
23
  Object.defineProperty(exports, "isSerializedHandle", { enumerable: true, get: function () { return handles_js_1.isSerializedHandle; } });
24
+ Object.defineProperty(exports, "lookupTemporaryBlobStorageId", { enumerable: true, get: function () { return handles_js_1.lookupTemporaryBlobStorageId; } });
24
25
  Object.defineProperty(exports, "toFluidHandleErased", { enumerable: true, get: function () { return handles_js_1.toFluidHandleErased; } });
25
26
  Object.defineProperty(exports, "toFluidHandleInternal", { enumerable: true, get: function () { return handles_js_1.toFluidHandleInternal; } });
26
27
  var objectstoragepartition_js_1 = require("./objectstoragepartition.js");
@@ -66,4 +67,5 @@ Object.defineProperty(exports, "defaultMinVersionForCollab", { enumerable: true,
66
67
  Object.defineProperty(exports, "getValidationForRuntimeOptions", { enumerable: true, get: function () { return compatibilityBase_js_1.getValidationForRuntimeOptions; } });
67
68
  Object.defineProperty(exports, "getConfigsForMinVersionForCollab", { enumerable: true, get: function () { return compatibilityBase_js_1.getConfigsForMinVersionForCollab; } });
68
69
  Object.defineProperty(exports, "isValidMinVersionForCollab", { enumerable: true, get: function () { return compatibilityBase_js_1.isValidMinVersionForCollab; } });
70
+ Object.defineProperty(exports, "semanticVersionToMinimumVersionForCollab", { enumerable: true, get: function () { return compatibilityBase_js_1.semanticVersionToMinimumVersionForCollab; } });
69
71
  //# 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,6DAK+B;AAJ9B,wHAAA,iBAAiB,OAAA;AACjB,0HAAA,mBAAmB,OAAA;AACnB,0HAAA,mBAAmB,OAAA;AACnB,0HAAA,mBAAmB,OAAA;AAEpB,2CAWsB;AAVrB,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,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,+DAMgC;AAL/B,wIAAA,gCAAgC,OAAA;AAChC,kIAAA,0BAA0B,OAAA;AAC1B,sIAAA,8BAA8B,OAAA;AAC9B,wIAAA,gCAAgC,OAAA;AAChC,kIAAA,0BAA0B,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} from \"./dataStoreHelpers.js\";\nexport {\n\tcompareFluidHandles,\n\tencodeHandleForSerialization,\n\tFluidHandleBase,\n\tisFluidHandle,\n\tisFluidHandleInternalPayloadPending,\n\tisFluidHandlePayloadPending,\n\tisLocalFluidHandle,\n\tisSerializedHandle,\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\tgetValidationForRuntimeOptions,\n\tgetConfigsForMinVersionForCollab,\n\tisValidMinVersionForCollab,\n} from \"./compatibilityBase.js\";\nexport type {\n\tConfigMap,\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,6DAK+B;AAJ9B,wHAAA,iBAAiB,OAAA;AACjB,0HAAA,mBAAmB,OAAA;AACnB,0HAAA,mBAAmB,OAAA;AACnB,0HAAA,mBAAmB,OAAA;AAEpB,2CAYsB;AAXrB,iHA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A,0BAA0B,OAAA;AAC1B,sIAAA,8BAA8B,OAAA;AAC9B,wIAAA,gCAAgC,OAAA;AAChC,kIAAA,0BAA0B,OAAA;AAC1B,gJAAA,wCAAwC,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} 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\tgetValidationForRuntimeOptions,\n\tgetConfigsForMinVersionForCollab,\n\tisValidMinVersionForCollab,\n\tsemanticVersionToMinimumVersionForCollab,\n} from \"./compatibilityBase.js\";\nexport type {\n\tConfigMap,\n\tConfigValidationMap,\n\tMinimumMinorSemanticVersion,\n\tSemanticVersion,\n} from \"./compatibilityBase.js\";\n"]}
package/dist/legacy.d.ts CHANGED
@@ -9,11 +9,12 @@
9
9
  */
10
10
 
11
11
  export {
12
- // @public APIs
12
+ // #region @public APIs
13
13
  compareFluidHandles,
14
14
  isFluidHandle,
15
+ // #endregion
15
16
 
16
- // @legacy APIs
17
+ // #region @legacyBeta APIs
17
18
  FluidHandleBase,
18
19
  RequestParser,
19
20
  RuntimeFactoryHelper,
@@ -25,4 +26,5 @@ export {
25
26
  toDeltaManagerInternal,
26
27
  toFluidHandleErased,
27
28
  toFluidHandleInternal
29
+ // #endregion
28
30
  } from "./index.js";
@@ -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.60.0";
8
+ export declare const pkgVersion = "2.61.0-355516";
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,WAAW,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,kBAAkB,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.60.0";
11
+ exports.pkgVersion = "2.61.0-355516";
12
12
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,+BAA+B,CAAC;AAC1C,QAAA,UAAU,GAAG,QAAQ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/runtime-utils\";\nexport const pkgVersion = \"2.60.0\";\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,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.61.0-355516\";\n"]}
package/dist/public.d.ts CHANGED
@@ -9,7 +9,8 @@
9
9
  */
10
10
 
11
11
  export {
12
- // @public APIs
12
+ // #region @public APIs
13
13
  compareFluidHandles,
14
14
  isFluidHandle
15
+ // #endregion
15
16
  } from "./index.js";
@@ -70,6 +70,15 @@ export declare function getConfigsForMinVersionForCollab<T extends Record<Semant
70
70
  * @internal
71
71
  */
72
72
  export declare function isValidMinVersionForCollab(minVersionForCollab: MinimumVersionForCollab): boolean;
73
+ /**
74
+ * Converts a SemanticVersion to a MinimumVersionForCollab.
75
+ * @param semanticVersion - The version to convert.
76
+ * @returns The version as a MinimumVersionForCollab.
77
+ * @throws UsageError if the version is not a valid MinimumVersionForCollab.
78
+ *
79
+ * @internal
80
+ */
81
+ export declare function semanticVersionToMinimumVersionForCollab(semanticVersion: SemanticVersion): MinimumVersionForCollab;
73
82
  /**
74
83
  * Generic function to validate runtime options against the minVersionForCollab.
75
84
  *
@@ -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;AAU7D;;;;;;;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;;;;GAIG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI;KACzD,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,2BAA2B,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;CAC3D,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI;KACnE,CAAC,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/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"}
@@ -75,6 +75,21 @@ export function isValidMinVersionForCollab(minVersionForCollab) {
75
75
  gte(minVersionForCollab, lowestMinVersionForCollab) &&
76
76
  lte(minVersionForCollab, pkgVersion));
77
77
  }
78
+ /**
79
+ * Converts a SemanticVersion to a MinimumVersionForCollab.
80
+ * @param semanticVersion - The version to convert.
81
+ * @returns The version as a MinimumVersionForCollab.
82
+ * @throws UsageError if the version is not a valid MinimumVersionForCollab.
83
+ *
84
+ * @internal
85
+ */
86
+ export function semanticVersionToMinimumVersionForCollab(semanticVersion) {
87
+ const minVersionForCollab = semanticVersion;
88
+ if (!isValidMinVersionForCollab(minVersionForCollab)) {
89
+ throw new UsageError(`Version ${minVersionForCollab} is not a valid MinimumVersionForCollab.`);
90
+ }
91
+ return minVersionForCollab;
92
+ }
78
93
  /**
79
94
  * Generic function to validate runtime options against the minVersionForCollab.
80
95
  *