@fluidframework/runtime-utils 2.74.0 → 2.81.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/compatibilityBase.d.ts +22 -0
  3. package/dist/compatibilityBase.d.ts.map +1 -1
  4. package/dist/compatibilityBase.js +39 -10
  5. package/dist/compatibilityBase.js.map +1 -1
  6. package/dist/index.d.ts +1 -1
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +3 -1
  9. package/dist/index.js.map +1 -1
  10. package/dist/packageVersion.d.ts +1 -1
  11. package/dist/packageVersion.js +1 -1
  12. package/dist/packageVersion.js.map +1 -1
  13. package/dist/requestParser.d.ts.map +1 -1
  14. package/dist/requestParser.js +1 -0
  15. package/dist/requestParser.js.map +1 -1
  16. package/dist/summaryUtils.d.ts +8 -2
  17. package/dist/summaryUtils.d.ts.map +1 -1
  18. package/dist/summaryUtils.js +12 -2
  19. package/dist/summaryUtils.js.map +1 -1
  20. package/eslint.config.mts +4 -4
  21. package/lib/compatibilityBase.d.ts +22 -0
  22. package/lib/compatibilityBase.d.ts.map +1 -1
  23. package/lib/compatibilityBase.js +35 -8
  24. package/lib/compatibilityBase.js.map +1 -1
  25. package/lib/index.d.ts +1 -1
  26. package/lib/index.d.ts.map +1 -1
  27. package/lib/index.js +1 -1
  28. package/lib/index.js.map +1 -1
  29. package/lib/packageVersion.d.ts +1 -1
  30. package/lib/packageVersion.js +1 -1
  31. package/lib/packageVersion.js.map +1 -1
  32. package/lib/requestParser.d.ts.map +1 -1
  33. package/lib/requestParser.js +1 -0
  34. package/lib/requestParser.js.map +1 -1
  35. package/lib/summaryUtils.d.ts +8 -2
  36. package/lib/summaryUtils.d.ts.map +1 -1
  37. package/lib/summaryUtils.js +13 -3
  38. package/lib/summaryUtils.js.map +1 -1
  39. package/package.json +22 -22
  40. package/src/compatibilityBase.ts +47 -8
  41. package/src/index.ts +2 -0
  42. package/src/packageVersion.ts +1 -1
  43. package/src/requestParser.ts +1 -0
  44. package/src/summaryUtils.ts +19 -3
  45. package/.eslintrc.cjs +0 -14
@@ -7,7 +7,7 @@ import { assert, unreachableCase } from "@fluidframework/core-utils/internal";
7
7
  import { SummaryType } from "@fluidframework/driver-definitions";
8
8
  import { TreeEntry } from "@fluidframework/driver-definitions/internal";
9
9
  import { AttachmentTreeEntry, BlobTreeEntry, TreeTreeEntry, } from "@fluidframework/driver-utils/internal";
10
- import { gcDataBlobKey } from "@fluidframework/runtime-definitions/internal";
10
+ import { currentSummarizeStepPrefix, currentSummarizeStepPropertyName, gcDataBlobKey, } from "@fluidframework/runtime-definitions/internal";
11
11
  /**
12
12
  * Combines summary stats by adding their totals together.
13
13
  * Returns empty stats if called without args.
@@ -412,13 +412,17 @@ export class TelemetryContext {
412
412
  }
413
413
  }
414
414
  /**
415
- * {@inheritDoc @fluidframework/runtime-definitions#ITelemetryContext.get}
415
+ * Get the telemetry data being tracked
416
+ * @param prefix - unique prefix to tag this data with (ex: "fluid:map:")
417
+ * @param property - property name of the telemetry data being tracked (ex: "DirectoryCount")
418
+ * @returns undefined if item not found
416
419
  */
417
420
  get(prefix, property) {
418
421
  return this.telemetry.get(`${prefix}${property}`);
419
422
  }
420
423
  /**
421
- * {@inheritDoc @fluidframework/runtime-definitions#ITelemetryContext.serialize}
424
+ * Returns a serialized version of all the telemetry data.
425
+ * Should be used when logging in telemetry events.
422
426
  */
423
427
  serialize() {
424
428
  const jsonObject = {};
@@ -427,6 +431,12 @@ export class TelemetryContext {
427
431
  }
428
432
  return JSON.stringify(jsonObject);
429
433
  }
434
+ getCurrentSummarizeStep() {
435
+ return this.get(currentSummarizeStepPrefix, currentSummarizeStepPropertyName);
436
+ }
437
+ setCurrentSummarizeStep(value) {
438
+ this.set(currentSummarizeStepPrefix, currentSummarizeStepPropertyName, value);
439
+ }
430
440
  }
431
441
  /**
432
442
  * Trims the leading slashes from the given string.
@@ -1 +1 @@
1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AAS;QACf,OAAO;YACN,OAAO,EAAE,IAAI,CAAC,OAAO;SACrB,CAAC;IACH,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIsoBuffer,\n\tUint8ArrayToString,\n\tbufferToString,\n\tfromBase64ToUtf8,\n} from \"@fluid-internal/client-utils\";\nimport type { ISnapshotTreeWithBlobContents } from \"@fluidframework/container-definitions/internal\";\nimport { assert, unreachableCase } from \"@fluidframework/core-utils/internal\";\nimport type {\n\tISummaryBlob,\n\tISummaryTree,\n\tSummaryObject,\n} from \"@fluidframework/driver-definitions\";\nimport { SummaryType } from \"@fluidframework/driver-definitions\";\nimport type { ITree, ITreeEntry } from \"@fluidframework/driver-definitions/internal\";\nimport { TreeEntry } from \"@fluidframework/driver-definitions/internal\";\nimport {\n\tAttachmentTreeEntry,\n\tBlobTreeEntry,\n\tTreeTreeEntry,\n} from \"@fluidframework/driver-utils/internal\";\nimport type {\n\tISummaryStats,\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n\tIGarbageCollectionData,\n\tISummarizeResult,\n\tITelemetryContextExt,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { gcDataBlobKey } from \"@fluidframework/runtime-definitions/internal\";\nimport type { TelemetryEventPropertyTypeExt } from \"@fluidframework/telemetry-utils/internal\";\n\n/**\n * Combines summary stats by adding their totals together.\n * Returns empty stats if called without args.\n * @param stats - stats to merge\n * @internal\n */\nexport function mergeStats(...stats: ISummaryStats[]): ISummaryStats {\n\tconst results = {\n\t\ttreeNodeCount: 0,\n\t\tblobNodeCount: 0,\n\t\thandleNodeCount: 0,\n\t\ttotalBlobSize: 0,\n\t\tunreferencedBlobSize: 0,\n\t};\n\tfor (const stat of stats) {\n\t\tresults.treeNodeCount += stat.treeNodeCount;\n\t\tresults.blobNodeCount += stat.blobNodeCount;\n\t\tresults.handleNodeCount += stat.handleNodeCount;\n\t\tresults.totalBlobSize += stat.totalBlobSize;\n\t\tresults.unreferencedBlobSize += stat.unreferencedBlobSize;\n\t}\n\treturn results;\n}\n\n/**\n * Calculates the byte length of an UTF-8 encoded string\n * @param str - The string to calculate the byte length of\n * @returns The byte length of the string\n * @internal\n */\nexport function utf8ByteLength(str: string): number {\n\t// returns the byte length of an utf8 string\n\tlet s = str.length;\n\tfor (let i = str.length - 1; i >= 0; i--) {\n\t\tconst code = str.codePointAt(i);\n\t\tif (code !== undefined) {\n\t\t\tif (code > 0x7f && code <= 0x7ff) {\n\t\t\t\ts++;\n\t\t\t} else if (code > 0x7ff && code <= 0xffff) {\n\t\t\t\ts += 2;\n\t\t\t}\n\t\t\tif (code >= 0xdc00 && code <= 0xdfff) {\n\t\t\t\ti--; // trail surrogate\n\t\t\t}\n\t\t}\n\t}\n\treturn s;\n}\n\n/**\n * Gets the size of a blob\n * @param content - The content of the blob\n * @returns The size of the blob in bytes\n * @internal\n */\nexport function getBlobSize(content: ISummaryBlob[\"content\"]): number {\n\treturn typeof content === \"string\" ? utf8ByteLength(content) : content.byteLength;\n}\n\nfunction calculateStatsCore(summaryObject: SummaryObject, stats: ISummaryStats): void {\n\tswitch (summaryObject.type) {\n\t\tcase SummaryType.Tree: {\n\t\t\tstats.treeNodeCount++;\n\t\t\tfor (const value of Object.values(summaryObject.tree)) {\n\t\t\t\tcalculateStatsCore(value, stats);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tcase SummaryType.Handle: {\n\t\t\tstats.handleNodeCount++;\n\t\t\treturn;\n\t\t}\n\t\tcase SummaryType.Blob: {\n\t\t\tstats.blobNodeCount++;\n\t\t\tstats.totalBlobSize += getBlobSize(summaryObject.content);\n\t\t\treturn;\n\t\t}\n\t\tdefault: {\n\t\t\treturn;\n\t\t}\n\t}\n}\n\n/**\n * Calculates the stats for a summary object\n * @param summary - The summary object to calculate stats for\n * @returns The calculated stats\n * @internal\n */\nexport function calculateStats(summary: SummaryObject): ISummaryStats {\n\tconst stats = mergeStats();\n\tcalculateStatsCore(summary, stats);\n\treturn stats;\n}\n\n/**\n * Adds a blob to the summary tree\n * @param summary - The summary tree to add the blob to\n * @param key - The key to store the blob at\n * @param content - The content of the blob to be added\n * @internal\n */\nexport function addBlobToSummary(\n\tsummary: ISummaryTreeWithStats,\n\tkey: string,\n\tcontent: string | Uint8Array,\n): void {\n\tconst blob: ISummaryBlob = {\n\t\ttype: SummaryType.Blob,\n\t\tcontent,\n\t};\n\tsummary.summary.tree[key] = blob;\n\tsummary.stats.blobNodeCount++;\n\tsummary.stats.totalBlobSize += getBlobSize(content);\n}\n\n/**\n * Adds a summarize result to the summary tree\n * @param summary - The summary tree to add the summarize result to\n * @param key - The key to store the summarize result at\n * @param summarizeResult - The summarize result to be added\n * @internal\n */\nexport function addSummarizeResultToSummary(\n\tsummary: ISummaryTreeWithStats,\n\tkey: string,\n\tsummarizeResult: ISummarizeResult,\n): void {\n\tsummary.summary.tree[key] = summarizeResult.summary;\n\tsummary.stats = mergeStats(summary.stats, summarizeResult.stats);\n}\n\n/**\n * An object who's properties are used to initialize a {@link SummaryTreeBuilder}\n * @legacy @beta\n */\nexport interface SummaryTreeBuilderParams {\n\t/**\n\t * This value will become the {@link @fluidframework/driver-definitions#ISummaryTree.groupId}\n\t * of the {@link @fluidframework/driver-definitions#ISummaryTree} built by the {@link SummaryTreeBuilder}.\n\t */\n\tgroupId?: string;\n}\n/**\n * A helper class for building summary trees.\n * @remarks Uses the builder pattern.\n * @legacy @beta\n */\nexport class SummaryTreeBuilder implements ISummaryTreeWithStats {\n\tprivate attachmentCounter: number = 0;\n\tprivate readonly groupId?: string;\n\n\tpublic get summary(): ISummaryTree {\n\t\tconst summary: ISummaryTree = {\n\t\t\ttype: SummaryType.Tree,\n\t\t\ttree: { ...this.summaryTree },\n\t\t};\n\t\tif (this.groupId !== undefined) {\n\t\t\tsummary.groupId = this.groupId;\n\t\t}\n\t\treturn summary;\n\t}\n\n\tpublic get stats(): Readonly<ISummaryStats> {\n\t\treturn { ...this.summaryStats };\n\t}\n\n\tpublic constructor(params?: { groupId?: string }) {\n\t\tthis.summaryStats = mergeStats();\n\t\tthis.summaryStats.treeNodeCount++;\n\t\tthis.groupId = params?.groupId;\n\t}\n\n\tprivate readonly summaryTree: Record<string, SummaryObject> = {};\n\tprivate summaryStats: ISummaryStats;\n\n\t/**\n\t * Add a blob to the summary tree. This blob will be stored at the given key in the summary tree.\n\t * @param key - The key to store the blob at in the current summary tree being generated. Should not contain any \"/\" characters.\n\t * @param content - The content of the blob to be added to the summary tree.\n\t */\n\tpublic addBlob(key: string, content: string | Uint8Array): void {\n\t\t// Prevent cloning by directly referencing underlying private properties\n\t\taddBlobToSummary(\n\t\t\t{\n\t\t\t\tsummary: {\n\t\t\t\t\ttype: SummaryType.Tree,\n\t\t\t\t\ttree: this.summaryTree,\n\t\t\t\t},\n\t\t\t\tstats: this.summaryStats,\n\t\t\t},\n\t\t\tkey,\n\t\t\tcontent,\n\t\t);\n\t}\n\n\t/**\n\t * Adds an {@link @fluidframework/driver-definitions#ISummaryHandle} that references a subtree, blob, or attachment in a previous summary.\n\t *\n\t * @param key - The key to store the handle at in the current summary tree being generated. Should not contain any \"/\" characters.\n\t * @param handleType - the type of {@link @fluidframework/driver-definitions#SummaryObject} besides a SummaryHandle, i.e. {@link @fluidframework/driver-definitions#SummaryType.Tree}, {@link @fluidframework/driver-definitions#SummaryType.Blob}, {@link @fluidframework/driver-definitions#SummaryType.Attachment}\n\t * @param handle - The path pointing to the part of the previous summary being used to duplicate the data. Use {@link @fluidframework/driver-definitions#ISummaryHandle.handle} to help generate proper handle strings. Should not contain any \"/\" characters.\n\t */\n\tpublic addHandle(\n\t\tkey: string,\n\t\thandleType: SummaryType.Tree | SummaryType.Blob | SummaryType.Attachment,\n\t\thandle: string,\n\t): void {\n\t\tthis.summaryTree[key] = {\n\t\t\ttype: SummaryType.Handle,\n\t\t\thandleType,\n\t\t\thandle,\n\t\t};\n\t\tthis.summaryStats.handleNodeCount++;\n\t}\n\n\t/**\n\t * Adds a child and updates the stats accordingly.\n\t * @param key - The key to store the handle at in the current summary tree being generated. Should not contain any \"/\" characters.\n\t * The key should be unique within the current summary tree, and not transform when encodeURIComponent is called.\n\t * @param summarizeResult - Similar to {@link @fluidframework/runtime-definitions#ISummaryTreeWithStats}. The provided summary can be either a {@link @fluidframework/driver-definitions#ISummaryHandle} or {@link @fluidframework/driver-definitions#ISummaryTree}.\n\t */\n\tpublic addWithStats(key: string, summarizeResult: ISummarizeResult): void {\n\t\tthis.summaryTree[key] = summarizeResult.summary;\n\t\tthis.summaryStats = mergeStats(this.summaryStats, summarizeResult.stats);\n\t}\n\n\t/**\n\t * Adds an {@link @fluidframework/driver-definitions#ISummaryAttachment} to the summary. This blob needs to already be uploaded to storage.\n\t * @param id - The id of the uploaded attachment to be added to the summary tree.\n\t */\n\tpublic addAttachment(id: string): void {\n\t\tthis.summaryTree[this.attachmentCounter++] = { id, type: SummaryType.Attachment };\n\t}\n\n\t/**\n\t * Gives you the in-memory summary tree with stats built by the SummaryTreeBuilder.\n\t *\n\t * @remarks\n\t * Use this once you're done building the summary tree, the stats should automatically be generated.\n\t * @returns The summary tree and stats built by the SummaryTreeBuilder.\n\t */\n\tpublic getSummaryTree(): ISummaryTreeWithStats {\n\t\treturn { summary: this.summary, stats: this.stats };\n\t}\n}\n\n/**\n * Converts snapshot ITree to ISummaryTree format and tracks stats.\n * @param snapshot - snapshot in ITree format\n * @param fullTree - true to never use handles, even if id is specified\n * @legacy @beta\n */\nexport function convertToSummaryTreeWithStats(\n\tsnapshot: ITree,\n\tfullTree: boolean = false,\n): ISummaryTreeWithStats {\n\tconst builder = new SummaryTreeBuilder();\n\tfor (const entry of snapshot.entries) {\n\t\tswitch (entry.type) {\n\t\t\tcase TreeEntry.Blob: {\n\t\t\t\tconst blob = entry.value;\n\t\t\t\tconst content =\n\t\t\t\t\tblob.encoding === \"base64\" ? IsoBuffer.from(blob.contents, \"base64\") : blob.contents;\n\t\t\t\tbuilder.addBlob(entry.path, content);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase TreeEntry.Tree: {\n\t\t\t\tconst subtree = convertToSummaryTree(entry.value, fullTree);\n\t\t\t\tbuilder.addWithStats(entry.path, subtree);\n\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase TreeEntry.Attachment: {\n\t\t\t\tconst id = entry.value.id;\n\t\t\t\tbuilder.addAttachment(id);\n\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tdefault: {\n\t\t\t\tthrow new Error(\"Unexpected TreeEntry type\");\n\t\t\t}\n\t\t}\n\t}\n\n\tconst summaryTree = builder.getSummaryTree();\n\tsummaryTree.summary.unreferenced = snapshot.unreferenced;\n\tsummaryTree.summary.groupId = snapshot.groupId;\n\treturn summaryTree;\n}\n\n/**\n * Converts snapshot ITree to ISummaryTree format and tracks stats.\n * @param snapshot - snapshot in ITree format\n * @param fullTree - true to never use handles, even if id is specified\n * @internal\n */\nexport function convertToSummaryTree(\n\tsnapshot: ITree,\n\tfullTree: boolean = false,\n): ISummarizeResult {\n\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\tif (snapshot.id && !fullTree) {\n\t\tconst stats = mergeStats();\n\t\tstats.handleNodeCount++;\n\t\treturn {\n\t\t\tsummary: {\n\t\t\t\thandle: snapshot.id,\n\t\t\t\thandleType: SummaryType.Tree,\n\t\t\t\ttype: SummaryType.Handle,\n\t\t\t},\n\t\t\tstats,\n\t\t};\n\t} else {\n\t\treturn convertToSummaryTreeWithStats(snapshot, fullTree);\n\t}\n}\n\n/**\n * Converts ISnapshotTree to ISummaryTree format and tracks stats. This snapshot tree was\n * was taken by serialize api in detached container.\n * @param snapshot - snapshot in ISnapshotTree format\n * @internal\n */\nexport function convertSnapshotTreeToSummaryTree(\n\tsnapshot: ISnapshotTreeWithBlobContents,\n): ISummaryTreeWithStats {\n\tconst builder = new SummaryTreeBuilder();\n\tfor (const [path, id] of Object.entries(snapshot.blobs)) {\n\t\tlet decoded: string | undefined;\n\t\tif (snapshot.blobsContents !== undefined) {\n\t\t\t// TODO Why are we non null asserting here?\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tconst content: ArrayBufferLike = snapshot.blobsContents[id]!;\n\t\t\tif (content !== undefined) {\n\t\t\t\t// Cannot change \"utf-8\" to \"utf8\" as this encoding value is stored in summaries and would be a breaking change which needs to be done first before changing to utf8.\n\t\t\t\t// eslint-disable-next-line unicorn/text-encoding-identifier-case -- External on-disk format is 'utf-8'.\n\t\t\t\tdecoded = bufferToString(content, \"utf-8\");\n\t\t\t}\n\t\t\t// 0.44 back-compat We still put contents in same blob for back-compat so need to add blob\n\t\t\t// only for blobPath -> blobId mapping and not for blobId -> blob value contents.\n\t\t} else if (snapshot.blobs[id] !== undefined) {\n\t\t\t// Non null asserting here because of the undefined check above\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tdecoded = fromBase64ToUtf8(snapshot.blobs[id]!);\n\t\t}\n\t\tif (decoded !== undefined) {\n\t\t\tbuilder.addBlob(path, decoded);\n\t\t}\n\t}\n\n\tfor (const [key, tree] of Object.entries(snapshot.trees)) {\n\t\tconst subtree = convertSnapshotTreeToSummaryTree(tree);\n\t\tbuilder.addWithStats(key, subtree);\n\t}\n\n\tconst summaryTree = builder.getSummaryTree();\n\tsummaryTree.summary.unreferenced = snapshot.unreferenced;\n\tsummaryTree.summary.groupId = snapshot.groupId;\n\treturn summaryTree;\n}\n\n/**\n * Converts ISummaryTree to ITree format. This is needed for back-compat while we get rid of snapshot.\n * @param summaryTree - summary tree in ISummaryTree format\n * @internal\n */\nexport function convertSummaryTreeToITree(summaryTree: ISummaryTree): ITree {\n\tconst entries: ITreeEntry[] = [];\n\tfor (const [key, value] of Object.entries(summaryTree.tree)) {\n\t\tswitch (value.type) {\n\t\t\tcase SummaryType.Blob: {\n\t\t\t\tlet parsedContent: string;\n\t\t\t\t// Cannot change \"utf-8\" to \"utf8\" as this encoding value is stored in summaries and would be a breaking change which needs to be done first before changing to utf8.\n\t\t\t\t// eslint-disable-next-line unicorn/text-encoding-identifier-case -- external contract uses 'utf-8'.\n\t\t\t\tlet encoding: \"utf-8\" | \"base64\" = \"utf-8\";\n\t\t\t\tif (typeof value.content === \"string\") {\n\t\t\t\t\tparsedContent = value.content;\n\t\t\t\t} else {\n\t\t\t\t\tparsedContent = Uint8ArrayToString(value.content, \"base64\");\n\t\t\t\t\tencoding = \"base64\";\n\t\t\t\t}\n\t\t\t\tentries.push(new BlobTreeEntry(key, parsedContent, encoding));\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase SummaryType.Tree: {\n\t\t\t\tentries.push(new TreeTreeEntry(key, convertSummaryTreeToITree(value)));\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase SummaryType.Attachment: {\n\t\t\t\tentries.push(new AttachmentTreeEntry(key, value.id));\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase SummaryType.Handle: {\n\t\t\t\tthrow new Error(\"Should not have Handle type in summary tree\");\n\t\t\t}\n\n\t\t\tdefault: {\n\t\t\t\tunreachableCase(value, \"Unexpected summary tree type\");\n\t\t\t}\n\t\t}\n\t}\n\treturn {\n\t\tentries,\n\t\tunreferenced: summaryTree.unreferenced,\n\t\tgroupId: summaryTree.groupId,\n\t};\n}\n\n/**\n * Looks in the given attach message snapshot for the .gcdata blob, which would\n * contain the initial GC Data for the node being attached.\n * If it finds it, it notifies GC of all the new outbound routes being added by the attach.\n *\n * @param snapshot - The snapshot from the attach message\n * @param addedGCOutboundRoute - Callback to notify GC of a new outbound route.\n * IMPORTANT: addedGCOutboundRoute's param nodeId is \"/\" for the attaching node itself, or \"/<id>\" for its children.\n *\n * @returns true if it found/processed GC Data, false otherwise\n *\n * @internal\n */\nexport function processAttachMessageGCData(\n\tsnapshot: ITree | undefined,\n\taddedGCOutboundRoute: (fromNodeId: string, toPath: string) => void,\n): boolean {\n\tconst gcDataEntry = snapshot?.entries.find((e) => e.path === gcDataBlobKey);\n\n\t// Old attach messages won't have GC Data\n\t// (And REALLY old DataStore Attach messages won't even have a snapshot!)\n\tif (gcDataEntry === undefined) {\n\t\treturn false;\n\t}\n\n\tassert(\n\t\t// Cannot change \"utf-8\" to \"utf8\" as this encoding value is stored in summaries and would be a breaking change which needs to be done first before changing to utf8.\n\t\t// eslint-disable-next-line unicorn/text-encoding-identifier-case -- external contract uses 'utf-8'.\n\t\tgcDataEntry.type === TreeEntry.Blob && gcDataEntry.value.encoding === \"utf-8\",\n\t\t0x8ff /* GC data should be a utf-8-encoded blob */,\n\t);\n\n\t// Type assertion is safe as we expect the GC data to conform to IGarbageCollectionData schema\n\tconst gcData = JSON.parse(gcDataEntry.value.contents) as IGarbageCollectionData;\n\tfor (const [nodeId, outboundRoutes] of Object.entries(gcData.gcNodes)) {\n\t\tfor (const toPath of outboundRoutes) {\n\t\t\taddedGCOutboundRoute(nodeId, toPath);\n\t\t}\n\t}\n\treturn true;\n}\n\n/**\n * @internal\n */\nexport class TelemetryContext implements ITelemetryContext, ITelemetryContextExt {\n\tprivate readonly telemetry = new Map<string, TelemetryEventPropertyTypeExt>();\n\n\t/**\n\t * {@inheritDoc @fluidframework/runtime-definitions#ITelemetryContext.set}\n\t */\n\tpublic set(prefix: string, property: string, value: TelemetryEventPropertyTypeExt): void {\n\t\tthis.telemetry.set(`${prefix}${property}`, value);\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/runtime-definitions#ITelemetryContext.setMultiple}\n\t */\n\tpublic setMultiple(\n\t\tprefix: string,\n\t\tproperty: string,\n\t\tvalues: Record<string, TelemetryEventPropertyTypeExt>,\n\t): void {\n\t\t// Set the values individually so that they are logged as a flat list along with other properties.\n\t\tfor (const key of Object.keys(values)) {\n\t\t\tthis.set(prefix, `${property}_${key}`, values[key]);\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/runtime-definitions#ITelemetryContext.get}\n\t */\n\tpublic get(prefix: string, property: string): TelemetryEventPropertyTypeExt {\n\t\treturn this.telemetry.get(`${prefix}${property}`);\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/runtime-definitions#ITelemetryContext.serialize}\n\t */\n\tpublic serialize(): string {\n\t\tconst jsonObject = {};\n\t\tfor (const [key, value] of this.telemetry.entries()) {\n\t\t\tjsonObject[key] = value;\n\t\t}\n\t\treturn JSON.stringify(jsonObject);\n\t}\n}\n\n/**\n * Trims the leading slashes from the given string.\n * @param str - A string that may contain leading slashes.\n * @returns A new string without leading slashes.\n */\nfunction trimLeadingSlashes(str: string): string {\n\treturn str.replace(/^\\/+/g, \"\");\n}\n\n/**\n * Trims the trailing slashes from the given string.\n * @param str - A string that may contain trailing slashes.\n * @returns A new string without trailing slashes.\n */\nfunction trimTrailingSlashes(str: string): string {\n\treturn str.replace(/\\/+$/g, \"\");\n}\n\n/**\n * Helper class to build the garbage collection data of a node by combining the data from multiple nodes.\n * @internal\n */\nexport class GCDataBuilder implements IGarbageCollectionData {\n\tprivate readonly gcNodesSet: Record<string, Set<string>> = {};\n\tpublic get gcNodes(): Record<string, string[]> {\n\t\tconst gcNodes = {};\n\t\tfor (const [nodeId, outboundRoutes] of Object.entries(this.gcNodesSet)) {\n\t\t\tgcNodes[nodeId] = [...outboundRoutes];\n\t\t}\n\t\treturn gcNodes;\n\t}\n\n\tpublic addNode(id: string, outboundRoutes: string[]): void {\n\t\tthis.gcNodesSet[id] = new Set(outboundRoutes);\n\t}\n\n\t/**\n\t * Adds the given GC nodes. It does the following:\n\t * - Normalizes the ids of the given nodes.\n\t * - Prefixes the given `prefixId` to the given nodes' ids.\n\t * - Adds the outbound routes of the nodes against the normalized and prefixed id.\n\t */\n\tpublic prefixAndAddNodes(prefixId: string, gcNodes: Record<string, string[]>): void {\n\t\tfor (const [id, outboundRoutes] of Object.entries(gcNodes)) {\n\t\t\t// Remove any leading slashes from the id.\n\t\t\tlet normalizedId = trimLeadingSlashes(id);\n\t\t\t// Prefix the given id to the normalized id.\n\t\t\tnormalizedId = `/${prefixId}/${normalizedId}`;\n\t\t\t// Remove any trailing slashes from the normalized id. Note that the trailing slashes are removed after\n\t\t\t// adding the prefix for handling the special case where id is \"/\".\n\t\t\tnormalizedId = trimTrailingSlashes(normalizedId);\n\n\t\t\t// Add the outbound routes against the normalized and prefixed id without duplicates.\n\t\t\tthis.gcNodesSet[normalizedId] = new Set(outboundRoutes);\n\t\t}\n\t}\n\n\tpublic addNodes(gcNodes: Record<string, string[]>): void {\n\t\tfor (const [id, outboundRoutes] of Object.entries(gcNodes)) {\n\t\t\tthis.gcNodesSet[id] = new Set(outboundRoutes);\n\t\t}\n\t}\n\n\t/**\n\t * Adds the given outbound route to the outbound routes of all GC nodes.\n\t */\n\tpublic addRouteToAllNodes(outboundRoute: string): void {\n\t\tfor (const outboundRoutes of Object.values(this.gcNodesSet)) {\n\t\t\toutboundRoutes.add(outboundRoute);\n\t\t}\n\t}\n\n\tpublic getGCData(): IGarbageCollectionData {\n\t\treturn {\n\t\t\tgcNodes: this.gcNodes,\n\t\t};\n\t}\n}\n"]}
1
+ {"version":3,"file":"summaryUtils.js","sourceRoot":"","sources":["../src/summaryUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,SAAS,EACT,kBAAkB,EAClB,cAAc,EACd,gBAAgB,GAChB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAM9E,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAEjE,OAAO,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAC;AACxE,OAAO,EACN,mBAAmB,EACnB,aAAa,EACb,aAAa,GACb,MAAM,uCAAuC,CAAC;AAS/C,OAAO,EACN,0BAA0B,EAC1B,gCAAgC,EAChC,aAAa,GACb,MAAM,8CAA8C,CAAC;AAGtD;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,GAAG,KAAsB;IACnD,MAAM,OAA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EAAE,OAAiC;QAC3E,KAAK,MAAM,CAAC,EAAE,EAAE,cAAc,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;YAC5D,0CAA0C;YAC1C,IAAI,YAAY,GAAG,kBAAkB,CAAC,EAAE,CAAC,CAAC;YAC1C,4CAA4C;YAC5C,YAAY,GAAG,IAAI,QAAQ,IAAI,YAAY,EAAE,CAAC;YAC9C,uGAAuG;YACvG,mEAAmE;YACnE,YAAY,GAAG,mBAAmB,CAAC,YAAY,CAAC,CAAC;YAEjD,qFAAqF;YACrF,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,GAAG,IAAI,GAAG,CAAC,cAAc,CAAC,CAAC;QACzD,CAAC;IACF,CAAC;IAEM,QAAQ,CAAC,OAAiC;QAChD,KAAK,MAAM,CAAC,EAAE,EAAE,cAAc,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;YAC5D,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC,cAAc,CAAC,CAAC;QAC/C,CAAC;IACF,CAAC;IAED;;OAEG;IACI,kBAAkB,CAAC,aAAqB;QAC9C,KAAK,MAAM,cAAc,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;YAC7D,cAAc,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QACnC,CAAC;IACF,CAAC;IAEM,SAAS;QACf,OAAO;YACN,OAAO,EAAE,IAAI,CAAC,OAAO;SACrB,CAAC;IACH,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIsoBuffer,\n\tUint8ArrayToString,\n\tbufferToString,\n\tfromBase64ToUtf8,\n} from \"@fluid-internal/client-utils\";\nimport type { ISnapshotTreeWithBlobContents } from \"@fluidframework/container-definitions/internal\";\nimport { assert, unreachableCase } from \"@fluidframework/core-utils/internal\";\nimport type {\n\tISummaryBlob,\n\tISummaryTree,\n\tSummaryObject,\n} from \"@fluidframework/driver-definitions\";\nimport { SummaryType } from \"@fluidframework/driver-definitions\";\nimport type { ITree, ITreeEntry } from \"@fluidframework/driver-definitions/internal\";\nimport { TreeEntry } from \"@fluidframework/driver-definitions/internal\";\nimport {\n\tAttachmentTreeEntry,\n\tBlobTreeEntry,\n\tTreeTreeEntry,\n} from \"@fluidframework/driver-utils/internal\";\nimport type {\n\tISummaryStats,\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n\tIGarbageCollectionData,\n\tISummarizeResult,\n\tITelemetryContextExt,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport {\n\tcurrentSummarizeStepPrefix,\n\tcurrentSummarizeStepPropertyName,\n\tgcDataBlobKey,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport type { TelemetryEventPropertyTypeExt } from \"@fluidframework/telemetry-utils/internal\";\n\n/**\n * Combines summary stats by adding their totals together.\n * Returns empty stats if called without args.\n * @param stats - stats to merge\n * @internal\n */\nexport function mergeStats(...stats: ISummaryStats[]): ISummaryStats {\n\tconst results = {\n\t\ttreeNodeCount: 0,\n\t\tblobNodeCount: 0,\n\t\thandleNodeCount: 0,\n\t\ttotalBlobSize: 0,\n\t\tunreferencedBlobSize: 0,\n\t};\n\tfor (const stat of stats) {\n\t\tresults.treeNodeCount += stat.treeNodeCount;\n\t\tresults.blobNodeCount += stat.blobNodeCount;\n\t\tresults.handleNodeCount += stat.handleNodeCount;\n\t\tresults.totalBlobSize += stat.totalBlobSize;\n\t\tresults.unreferencedBlobSize += stat.unreferencedBlobSize;\n\t}\n\treturn results;\n}\n\n/**\n * Calculates the byte length of an UTF-8 encoded string\n * @param str - The string to calculate the byte length of\n * @returns The byte length of the string\n * @internal\n */\nexport function utf8ByteLength(str: string): number {\n\t// returns the byte length of an utf8 string\n\tlet s = str.length;\n\tfor (let i = str.length - 1; i >= 0; i--) {\n\t\tconst code = str.codePointAt(i);\n\t\tif (code !== undefined) {\n\t\t\tif (code > 0x7f && code <= 0x7ff) {\n\t\t\t\ts++;\n\t\t\t} else if (code > 0x7ff && code <= 0xffff) {\n\t\t\t\ts += 2;\n\t\t\t}\n\t\t\tif (code >= 0xdc00 && code <= 0xdfff) {\n\t\t\t\ti--; // trail surrogate\n\t\t\t}\n\t\t}\n\t}\n\treturn s;\n}\n\n/**\n * Gets the size of a blob\n * @param content - The content of the blob\n * @returns The size of the blob in bytes\n * @internal\n */\nexport function getBlobSize(content: ISummaryBlob[\"content\"]): number {\n\treturn typeof content === \"string\" ? utf8ByteLength(content) : content.byteLength;\n}\n\nfunction calculateStatsCore(summaryObject: SummaryObject, stats: ISummaryStats): void {\n\tswitch (summaryObject.type) {\n\t\tcase SummaryType.Tree: {\n\t\t\tstats.treeNodeCount++;\n\t\t\tfor (const value of Object.values(summaryObject.tree)) {\n\t\t\t\tcalculateStatsCore(value, stats);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tcase SummaryType.Handle: {\n\t\t\tstats.handleNodeCount++;\n\t\t\treturn;\n\t\t}\n\t\tcase SummaryType.Blob: {\n\t\t\tstats.blobNodeCount++;\n\t\t\tstats.totalBlobSize += getBlobSize(summaryObject.content);\n\t\t\treturn;\n\t\t}\n\t\tdefault: {\n\t\t\treturn;\n\t\t}\n\t}\n}\n\n/**\n * Calculates the stats for a summary object\n * @param summary - The summary object to calculate stats for\n * @returns The calculated stats\n * @internal\n */\nexport function calculateStats(summary: SummaryObject): ISummaryStats {\n\tconst stats = mergeStats();\n\tcalculateStatsCore(summary, stats);\n\treturn stats;\n}\n\n/**\n * Adds a blob to the summary tree\n * @param summary - The summary tree to add the blob to\n * @param key - The key to store the blob at\n * @param content - The content of the blob to be added\n * @internal\n */\nexport function addBlobToSummary(\n\tsummary: ISummaryTreeWithStats,\n\tkey: string,\n\tcontent: string | Uint8Array,\n): void {\n\tconst blob: ISummaryBlob = {\n\t\ttype: SummaryType.Blob,\n\t\tcontent,\n\t};\n\tsummary.summary.tree[key] = blob;\n\tsummary.stats.blobNodeCount++;\n\tsummary.stats.totalBlobSize += getBlobSize(content);\n}\n\n/**\n * Adds a summarize result to the summary tree\n * @param summary - The summary tree to add the summarize result to\n * @param key - The key to store the summarize result at\n * @param summarizeResult - The summarize result to be added\n * @internal\n */\nexport function addSummarizeResultToSummary(\n\tsummary: ISummaryTreeWithStats,\n\tkey: string,\n\tsummarizeResult: ISummarizeResult,\n): void {\n\tsummary.summary.tree[key] = summarizeResult.summary;\n\tsummary.stats = mergeStats(summary.stats, summarizeResult.stats);\n}\n\n/**\n * An object who's properties are used to initialize a {@link SummaryTreeBuilder}\n * @legacy @beta\n */\nexport interface SummaryTreeBuilderParams {\n\t/**\n\t * This value will become the {@link @fluidframework/driver-definitions#ISummaryTree.groupId}\n\t * of the {@link @fluidframework/driver-definitions#ISummaryTree} built by the {@link SummaryTreeBuilder}.\n\t */\n\tgroupId?: string;\n}\n/**\n * A helper class for building summary trees.\n * @remarks Uses the builder pattern.\n * @legacy @beta\n */\nexport class SummaryTreeBuilder implements ISummaryTreeWithStats {\n\tprivate attachmentCounter: number = 0;\n\tprivate readonly groupId?: string;\n\n\tpublic get summary(): ISummaryTree {\n\t\tconst summary: ISummaryTree = {\n\t\t\ttype: SummaryType.Tree,\n\t\t\ttree: { ...this.summaryTree },\n\t\t};\n\t\tif (this.groupId !== undefined) {\n\t\t\tsummary.groupId = this.groupId;\n\t\t}\n\t\treturn summary;\n\t}\n\n\tpublic get stats(): Readonly<ISummaryStats> {\n\t\treturn { ...this.summaryStats };\n\t}\n\n\tpublic constructor(params?: { groupId?: string }) {\n\t\tthis.summaryStats = mergeStats();\n\t\tthis.summaryStats.treeNodeCount++;\n\t\tthis.groupId = params?.groupId;\n\t}\n\n\tprivate readonly summaryTree: Record<string, SummaryObject> = {};\n\tprivate summaryStats: ISummaryStats;\n\n\t/**\n\t * Add a blob to the summary tree. This blob will be stored at the given key in the summary tree.\n\t * @param key - The key to store the blob at in the current summary tree being generated. Should not contain any \"/\" characters.\n\t * @param content - The content of the blob to be added to the summary tree.\n\t */\n\tpublic addBlob(key: string, content: string | Uint8Array): void {\n\t\t// Prevent cloning by directly referencing underlying private properties\n\t\taddBlobToSummary(\n\t\t\t{\n\t\t\t\tsummary: {\n\t\t\t\t\ttype: SummaryType.Tree,\n\t\t\t\t\ttree: this.summaryTree,\n\t\t\t\t},\n\t\t\t\tstats: this.summaryStats,\n\t\t\t},\n\t\t\tkey,\n\t\t\tcontent,\n\t\t);\n\t}\n\n\t/**\n\t * Adds an {@link @fluidframework/driver-definitions#ISummaryHandle} that references a subtree, blob, or attachment in a previous summary.\n\t *\n\t * @param key - The key to store the handle at in the current summary tree being generated. Should not contain any \"/\" characters.\n\t * @param handleType - the type of {@link @fluidframework/driver-definitions#SummaryObject} besides a SummaryHandle, i.e. {@link @fluidframework/driver-definitions#SummaryType.Tree}, {@link @fluidframework/driver-definitions#SummaryType.Blob}, {@link @fluidframework/driver-definitions#SummaryType.Attachment}\n\t * @param handle - The path pointing to the part of the previous summary being used to duplicate the data. Use {@link @fluidframework/driver-definitions#ISummaryHandle.handle} to help generate proper handle strings. Should not contain any \"/\" characters.\n\t */\n\tpublic addHandle(\n\t\tkey: string,\n\t\thandleType: SummaryType.Tree | SummaryType.Blob | SummaryType.Attachment,\n\t\thandle: string,\n\t): void {\n\t\tthis.summaryTree[key] = {\n\t\t\ttype: SummaryType.Handle,\n\t\t\thandleType,\n\t\t\thandle,\n\t\t};\n\t\tthis.summaryStats.handleNodeCount++;\n\t}\n\n\t/**\n\t * Adds a child and updates the stats accordingly.\n\t * @param key - The key to store the handle at in the current summary tree being generated. Should not contain any \"/\" characters.\n\t * The key should be unique within the current summary tree, and not transform when encodeURIComponent is called.\n\t * @param summarizeResult - Similar to {@link @fluidframework/runtime-definitions#ISummaryTreeWithStats}. The provided summary can be either a {@link @fluidframework/driver-definitions#ISummaryHandle} or {@link @fluidframework/driver-definitions#ISummaryTree}.\n\t */\n\tpublic addWithStats(key: string, summarizeResult: ISummarizeResult): void {\n\t\tthis.summaryTree[key] = summarizeResult.summary;\n\t\tthis.summaryStats = mergeStats(this.summaryStats, summarizeResult.stats);\n\t}\n\n\t/**\n\t * Adds an {@link @fluidframework/driver-definitions#ISummaryAttachment} to the summary. This blob needs to already be uploaded to storage.\n\t * @param id - The id of the uploaded attachment to be added to the summary tree.\n\t */\n\tpublic addAttachment(id: string): void {\n\t\tthis.summaryTree[this.attachmentCounter++] = { id, type: SummaryType.Attachment };\n\t}\n\n\t/**\n\t * Gives you the in-memory summary tree with stats built by the SummaryTreeBuilder.\n\t *\n\t * @remarks\n\t * Use this once you're done building the summary tree, the stats should automatically be generated.\n\t * @returns The summary tree and stats built by the SummaryTreeBuilder.\n\t */\n\tpublic getSummaryTree(): ISummaryTreeWithStats {\n\t\treturn { summary: this.summary, stats: this.stats };\n\t}\n}\n\n/**\n * Converts snapshot ITree to ISummaryTree format and tracks stats.\n * @param snapshot - snapshot in ITree format\n * @param fullTree - true to never use handles, even if id is specified\n * @legacy @beta\n */\nexport function convertToSummaryTreeWithStats(\n\tsnapshot: ITree,\n\tfullTree: boolean = false,\n): ISummaryTreeWithStats {\n\tconst builder = new SummaryTreeBuilder();\n\tfor (const entry of snapshot.entries) {\n\t\tswitch (entry.type) {\n\t\t\tcase TreeEntry.Blob: {\n\t\t\t\tconst blob = entry.value;\n\t\t\t\tconst content =\n\t\t\t\t\tblob.encoding === \"base64\" ? IsoBuffer.from(blob.contents, \"base64\") : blob.contents;\n\t\t\t\tbuilder.addBlob(entry.path, content);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase TreeEntry.Tree: {\n\t\t\t\tconst subtree = convertToSummaryTree(entry.value, fullTree);\n\t\t\t\tbuilder.addWithStats(entry.path, subtree);\n\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase TreeEntry.Attachment: {\n\t\t\t\tconst id = entry.value.id;\n\t\t\t\tbuilder.addAttachment(id);\n\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tdefault: {\n\t\t\t\tthrow new Error(\"Unexpected TreeEntry type\");\n\t\t\t}\n\t\t}\n\t}\n\n\tconst summaryTree = builder.getSummaryTree();\n\tsummaryTree.summary.unreferenced = snapshot.unreferenced;\n\tsummaryTree.summary.groupId = snapshot.groupId;\n\treturn summaryTree;\n}\n\n/**\n * Converts snapshot ITree to ISummaryTree format and tracks stats.\n * @param snapshot - snapshot in ITree format\n * @param fullTree - true to never use handles, even if id is specified\n * @internal\n */\nexport function convertToSummaryTree(\n\tsnapshot: ITree,\n\tfullTree: boolean = false,\n): ISummarizeResult {\n\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\tif (snapshot.id && !fullTree) {\n\t\tconst stats = mergeStats();\n\t\tstats.handleNodeCount++;\n\t\treturn {\n\t\t\tsummary: {\n\t\t\t\thandle: snapshot.id,\n\t\t\t\thandleType: SummaryType.Tree,\n\t\t\t\ttype: SummaryType.Handle,\n\t\t\t},\n\t\t\tstats,\n\t\t};\n\t} else {\n\t\treturn convertToSummaryTreeWithStats(snapshot, fullTree);\n\t}\n}\n\n/**\n * Converts ISnapshotTree to ISummaryTree format and tracks stats. This snapshot tree was\n * was taken by serialize api in detached container.\n * @param snapshot - snapshot in ISnapshotTree format\n * @internal\n */\nexport function convertSnapshotTreeToSummaryTree(\n\tsnapshot: ISnapshotTreeWithBlobContents,\n): ISummaryTreeWithStats {\n\tconst builder = new SummaryTreeBuilder();\n\tfor (const [path, id] of Object.entries(snapshot.blobs)) {\n\t\tlet decoded: string | undefined;\n\t\tif (snapshot.blobsContents !== undefined) {\n\t\t\t// TODO Why are we non null asserting here?\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tconst content: ArrayBufferLike = snapshot.blobsContents[id]!;\n\t\t\tif (content !== undefined) {\n\t\t\t\t// Cannot change \"utf-8\" to \"utf8\" as this encoding value is stored in summaries and would be a breaking change which needs to be done first before changing to utf8.\n\t\t\t\t// eslint-disable-next-line unicorn/text-encoding-identifier-case -- External on-disk format is 'utf-8'.\n\t\t\t\tdecoded = bufferToString(content, \"utf-8\");\n\t\t\t}\n\t\t\t// 0.44 back-compat We still put contents in same blob for back-compat so need to add blob\n\t\t\t// only for blobPath -> blobId mapping and not for blobId -> blob value contents.\n\t\t} else if (snapshot.blobs[id] !== undefined) {\n\t\t\t// Non null asserting here because of the undefined check above\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tdecoded = fromBase64ToUtf8(snapshot.blobs[id]!);\n\t\t}\n\t\tif (decoded !== undefined) {\n\t\t\tbuilder.addBlob(path, decoded);\n\t\t}\n\t}\n\n\tfor (const [key, tree] of Object.entries(snapshot.trees)) {\n\t\tconst subtree = convertSnapshotTreeToSummaryTree(tree);\n\t\tbuilder.addWithStats(key, subtree);\n\t}\n\n\tconst summaryTree = builder.getSummaryTree();\n\tsummaryTree.summary.unreferenced = snapshot.unreferenced;\n\tsummaryTree.summary.groupId = snapshot.groupId;\n\treturn summaryTree;\n}\n\n/**\n * Converts ISummaryTree to ITree format. This is needed for back-compat while we get rid of snapshot.\n * @param summaryTree - summary tree in ISummaryTree format\n * @internal\n */\nexport function convertSummaryTreeToITree(summaryTree: ISummaryTree): ITree {\n\tconst entries: ITreeEntry[] = [];\n\tfor (const [key, value] of Object.entries(summaryTree.tree)) {\n\t\tswitch (value.type) {\n\t\t\tcase SummaryType.Blob: {\n\t\t\t\tlet parsedContent: string;\n\t\t\t\t// Cannot change \"utf-8\" to \"utf8\" as this encoding value is stored in summaries and would be a breaking change which needs to be done first before changing to utf8.\n\t\t\t\t// eslint-disable-next-line unicorn/text-encoding-identifier-case -- external contract uses 'utf-8'.\n\t\t\t\tlet encoding: \"utf-8\" | \"base64\" = \"utf-8\";\n\t\t\t\tif (typeof value.content === \"string\") {\n\t\t\t\t\tparsedContent = value.content;\n\t\t\t\t} else {\n\t\t\t\t\tparsedContent = Uint8ArrayToString(value.content, \"base64\");\n\t\t\t\t\tencoding = \"base64\";\n\t\t\t\t}\n\t\t\t\tentries.push(new BlobTreeEntry(key, parsedContent, encoding));\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase SummaryType.Tree: {\n\t\t\t\tentries.push(new TreeTreeEntry(key, convertSummaryTreeToITree(value)));\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase SummaryType.Attachment: {\n\t\t\t\tentries.push(new AttachmentTreeEntry(key, value.id));\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase SummaryType.Handle: {\n\t\t\t\tthrow new Error(\"Should not have Handle type in summary tree\");\n\t\t\t}\n\n\t\t\tdefault: {\n\t\t\t\tunreachableCase(value, \"Unexpected summary tree type\");\n\t\t\t}\n\t\t}\n\t}\n\treturn {\n\t\tentries,\n\t\tunreferenced: summaryTree.unreferenced,\n\t\tgroupId: summaryTree.groupId,\n\t};\n}\n\n/**\n * Looks in the given attach message snapshot for the .gcdata blob, which would\n * contain the initial GC Data for the node being attached.\n * If it finds it, it notifies GC of all the new outbound routes being added by the attach.\n *\n * @param snapshot - The snapshot from the attach message\n * @param addedGCOutboundRoute - Callback to notify GC of a new outbound route.\n * IMPORTANT: addedGCOutboundRoute's param nodeId is \"/\" for the attaching node itself, or \"/<id>\" for its children.\n *\n * @returns true if it found/processed GC Data, false otherwise\n *\n * @internal\n */\nexport function processAttachMessageGCData(\n\tsnapshot: ITree | undefined,\n\taddedGCOutboundRoute: (fromNodeId: string, toPath: string) => void,\n): boolean {\n\tconst gcDataEntry = snapshot?.entries.find((e) => e.path === gcDataBlobKey);\n\n\t// Old attach messages won't have GC Data\n\t// (And REALLY old DataStore Attach messages won't even have a snapshot!)\n\tif (gcDataEntry === undefined) {\n\t\treturn false;\n\t}\n\n\tassert(\n\t\t// Cannot change \"utf-8\" to \"utf8\" as this encoding value is stored in summaries and would be a breaking change which needs to be done first before changing to utf8.\n\t\t// eslint-disable-next-line unicorn/text-encoding-identifier-case -- external contract uses 'utf-8'.\n\t\tgcDataEntry.type === TreeEntry.Blob && gcDataEntry.value.encoding === \"utf-8\",\n\t\t0x8ff /* GC data should be a utf-8-encoded blob */,\n\t);\n\n\t// Type assertion is safe as we expect the GC data to conform to IGarbageCollectionData schema\n\tconst gcData = JSON.parse(gcDataEntry.value.contents) as IGarbageCollectionData;\n\tfor (const [nodeId, outboundRoutes] of Object.entries(gcData.gcNodes)) {\n\t\tfor (const toPath of outboundRoutes) {\n\t\t\taddedGCOutboundRoute(nodeId, toPath);\n\t\t}\n\t}\n\treturn true;\n}\n\n/**\n * @internal\n */\nexport class TelemetryContext implements ITelemetryContext, ITelemetryContextExt {\n\tprivate readonly telemetry = new Map<string, TelemetryEventPropertyTypeExt>();\n\n\t/**\n\t * {@inheritDoc @fluidframework/runtime-definitions#ITelemetryContext.set}\n\t */\n\tpublic set(prefix: string, property: string, value: TelemetryEventPropertyTypeExt): void {\n\t\tthis.telemetry.set(`${prefix}${property}`, value);\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/runtime-definitions#ITelemetryContext.setMultiple}\n\t */\n\tpublic setMultiple(\n\t\tprefix: string,\n\t\tproperty: string,\n\t\tvalues: Record<string, TelemetryEventPropertyTypeExt>,\n\t): void {\n\t\t// Set the values individually so that they are logged as a flat list along with other properties.\n\t\tfor (const key of Object.keys(values)) {\n\t\t\tthis.set(prefix, `${property}_${key}`, values[key]);\n\t\t}\n\t}\n\n\t/**\n\t * Get the telemetry data being tracked\n\t * @param prefix - unique prefix to tag this data with (ex: \"fluid:map:\")\n\t * @param property - property name of the telemetry data being tracked (ex: \"DirectoryCount\")\n\t * @returns undefined if item not found\n\t */\n\tpublic get(prefix: string, property: string): TelemetryEventPropertyTypeExt {\n\t\treturn this.telemetry.get(`${prefix}${property}`);\n\t}\n\n\t/**\n\t * Returns a serialized version of all the telemetry data.\n\t * Should be used when logging in telemetry events.\n\t */\n\tpublic serialize(): string {\n\t\tconst jsonObject = {};\n\t\tfor (const [key, value] of this.telemetry.entries()) {\n\t\t\tjsonObject[key] = value;\n\t\t}\n\t\treturn JSON.stringify(jsonObject);\n\t}\n\n\tpublic getCurrentSummarizeStep(): TelemetryEventPropertyTypeExt {\n\t\treturn this.get(currentSummarizeStepPrefix, currentSummarizeStepPropertyName);\n\t}\n\n\tpublic setCurrentSummarizeStep(value: TelemetryEventPropertyTypeExt): void {\n\t\tthis.set(currentSummarizeStepPrefix, currentSummarizeStepPropertyName, value);\n\t}\n}\n\n/**\n * Trims the leading slashes from the given string.\n * @param str - A string that may contain leading slashes.\n * @returns A new string without leading slashes.\n */\nfunction trimLeadingSlashes(str: string): string {\n\treturn str.replace(/^\\/+/g, \"\");\n}\n\n/**\n * Trims the trailing slashes from the given string.\n * @param str - A string that may contain trailing slashes.\n * @returns A new string without trailing slashes.\n */\nfunction trimTrailingSlashes(str: string): string {\n\treturn str.replace(/\\/+$/g, \"\");\n}\n\n/**\n * Helper class to build the garbage collection data of a node by combining the data from multiple nodes.\n * @internal\n */\nexport class GCDataBuilder implements IGarbageCollectionData {\n\tprivate readonly gcNodesSet: Record<string, Set<string>> = {};\n\tpublic get gcNodes(): Record<string, string[]> {\n\t\tconst gcNodes = {};\n\t\tfor (const [nodeId, outboundRoutes] of Object.entries(this.gcNodesSet)) {\n\t\t\tgcNodes[nodeId] = [...outboundRoutes];\n\t\t}\n\t\treturn gcNodes;\n\t}\n\n\tpublic addNode(id: string, outboundRoutes: string[]): void {\n\t\tthis.gcNodesSet[id] = new Set(outboundRoutes);\n\t}\n\n\t/**\n\t * Adds the given GC nodes. It does the following:\n\t * - Normalizes the ids of the given nodes.\n\t * - Prefixes the given `prefixId` to the given nodes' ids.\n\t * - Adds the outbound routes of the nodes against the normalized and prefixed id.\n\t */\n\tpublic prefixAndAddNodes(prefixId: string, gcNodes: Record<string, string[]>): void {\n\t\tfor (const [id, outboundRoutes] of Object.entries(gcNodes)) {\n\t\t\t// Remove any leading slashes from the id.\n\t\t\tlet normalizedId = trimLeadingSlashes(id);\n\t\t\t// Prefix the given id to the normalized id.\n\t\t\tnormalizedId = `/${prefixId}/${normalizedId}`;\n\t\t\t// Remove any trailing slashes from the normalized id. Note that the trailing slashes are removed after\n\t\t\t// adding the prefix for handling the special case where id is \"/\".\n\t\t\tnormalizedId = trimTrailingSlashes(normalizedId);\n\n\t\t\t// Add the outbound routes against the normalized and prefixed id without duplicates.\n\t\t\tthis.gcNodesSet[normalizedId] = new Set(outboundRoutes);\n\t\t}\n\t}\n\n\tpublic addNodes(gcNodes: Record<string, string[]>): void {\n\t\tfor (const [id, outboundRoutes] of Object.entries(gcNodes)) {\n\t\t\tthis.gcNodesSet[id] = new Set(outboundRoutes);\n\t\t}\n\t}\n\n\t/**\n\t * Adds the given outbound route to the outbound routes of all GC nodes.\n\t */\n\tpublic addRouteToAllNodes(outboundRoute: string): void {\n\t\tfor (const outboundRoutes of Object.values(this.gcNodesSet)) {\n\t\t\toutboundRoutes.add(outboundRoute);\n\t\t}\n\t}\n\n\tpublic getGCData(): IGarbageCollectionData {\n\t\treturn {\n\t\t\tgcNodes: this.gcNodes,\n\t\t};\n\t}\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/runtime-utils",
3
- "version": "2.74.0",
3
+ "version": "2.81.0",
4
4
  "description": "Collection of utility functions for Fluid Runtime",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -79,42 +79,42 @@
79
79
  "temp-directory": "nyc/.nyc_output"
80
80
  },
81
81
  "dependencies": {
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",
82
+ "@fluid-internal/client-utils": "~2.81.0",
83
+ "@fluidframework/container-definitions": "~2.81.0",
84
+ "@fluidframework/container-runtime-definitions": "~2.81.0",
85
+ "@fluidframework/core-interfaces": "~2.81.0",
86
+ "@fluidframework/core-utils": "~2.81.0",
87
+ "@fluidframework/datastore-definitions": "~2.81.0",
88
+ "@fluidframework/driver-definitions": "~2.81.0",
89
+ "@fluidframework/driver-utils": "~2.81.0",
90
+ "@fluidframework/runtime-definitions": "~2.81.0",
91
+ "@fluidframework/telemetry-utils": "~2.81.0",
92
92
  "semver-ts": "^1.0.3"
93
93
  },
94
94
  "devDependencies": {
95
- "@arethetypeswrong/cli": "^0.17.1",
95
+ "@arethetypeswrong/cli": "^0.18.2",
96
96
  "@biomejs/biome": "~1.9.3",
97
- "@fluid-internal/mocha-test-setup": "~2.74.0",
98
- "@fluid-tools/build-cli": "^0.61.0",
97
+ "@fluid-internal/mocha-test-setup": "~2.81.0",
98
+ "@fluid-tools/build-cli": "^0.63.0",
99
99
  "@fluidframework/build-common": "^2.0.3",
100
- "@fluidframework/build-tools": "^0.61.0",
101
- "@fluidframework/eslint-config-fluid": "~2.74.0",
102
- "@fluidframework/runtime-utils-previous": "npm:@fluidframework/runtime-utils@2.73.0",
100
+ "@fluidframework/build-tools": "^0.63.0",
101
+ "@fluidframework/eslint-config-fluid": "~2.81.0",
102
+ "@fluidframework/runtime-utils-previous": "npm:@fluidframework/runtime-utils@2.80.0",
103
103
  "@microsoft/api-extractor": "7.52.11",
104
104
  "@types/mocha": "^10.0.10",
105
105
  "@types/node": "^18.19.0",
106
106
  "@types/sinon": "^17.0.3",
107
107
  "c8": "^10.1.3",
108
- "concurrently": "^8.2.1",
108
+ "concurrently": "^9.2.1",
109
109
  "copyfiles": "^2.4.1",
110
- "cross-env": "^7.0.3",
111
- "eslint": "~8.57.1",
110
+ "cross-env": "^10.1.0",
111
+ "eslint": "~9.39.1",
112
112
  "jiti": "^2.6.1",
113
113
  "mocha": "^10.8.2",
114
114
  "mocha-multi-reporters": "^1.5.1",
115
- "rimraf": "^4.4.0",
115
+ "rimraf": "^6.1.2",
116
116
  "sinon": "^18.0.1",
117
- "ts-node": "^10.9.1",
117
+ "ts-node": "^10.9.2",
118
118
  "typescript": "~5.4.5"
119
119
  },
120
120
  "typeValidation": {
@@ -143,23 +143,62 @@ export function getConfigForMinVersionForCollab<T>(
143
143
  minVersionForCollab: MinimumVersionForCollab,
144
144
  config: ConfigMapEntry<T>,
145
145
  ): T {
146
- const entries: [string, unknown][] = Object.entries(config); // Assigning this to a typed variable to convert the "any" into unknown.
146
+ return getConfigForMinVersionForCollabIterable(
147
+ minVersionForCollab,
148
+ Object.entries(config) as [MinimumMinorSemanticVersion, T][],
149
+ );
150
+ }
151
+
152
+ /**
153
+ * Returns a default configuration given minVersionForCollab and the contents of a {@link ConfigMapEntry} in an Iterable.
154
+ * @remarks
155
+ * See also {@link getConfigForMinVersionForCollab} for consuming a ConfigMapEntry directly.
156
+ *
157
+ * `ConfigMapEntry` is a nice type safe format for developers to directly author this data,
158
+ * but it is messy and less type safe to work with it in this format programmatically.
159
+ * Thus this function exists to help meet the needs of programmatic use cases,
160
+ * like cases which transform a ConfigMapEntry before selecting a value from it.
161
+ * @internal
162
+ */
163
+ export function getConfigForMinVersionForCollabIterable<T>(
164
+ minVersionForCollab: MinimumVersionForCollab,
165
+ entries: Iterable<readonly [MinimumMinorSemanticVersion | MinimumVersionForCollab, T]>, // [[typeof lowestMinVersionForCollab, T], ...[MinimumVersionForCollab, T][]],
166
+ ): T {
147
167
  // Validate and strongly type the versions from the configMap.
148
- const versions: [MinimumVersionForCollab, unknown][] = entries.map(([version, value]) => {
168
+ const versions: [MinimumVersionForCollab, T][] = Array.from(entries, ([version, value]) => {
149
169
  validateMinimumVersionForCollab(version);
150
170
  return [version, value];
151
171
  });
152
- // Sort the versions in descending order to find the largest compatible entry.
153
- // TODO: Enforcing a sorted order might be a good idea. For now tolerates any order.
172
+ return (selectVersionRoundedDown(minVersionForCollab, versions) ??
173
+ fail(0xcb8 /* No config map entry for version */))[1];
174
+ }
175
+
176
+ /**
177
+ * Finds the entry for the highest version that is less than or equal to the provided minVersionForCollab.
178
+ * @remarks
179
+ * If none is found, returns undefined.
180
+ *
181
+ * When used with Fluid client versions, use the stricter {@link getConfigForMinVersionForCollabIterable} instead.
182
+ *
183
+ * @internal
184
+ */
185
+ export function selectVersionRoundedDown<T>(
186
+ minVersionForCollab: string,
187
+ entries: Iterable<readonly [string, T]>,
188
+ ): readonly [string, T] | undefined {
189
+ // Sort a copy of the iterable in descending order
190
+ const versions: (readonly [string, T])[] = [...entries];
154
191
  versions.sort((a, b) => compare(b[0], a[0]));
192
+
155
193
  // For each config, we iterate over the keys and check if minVersionForCollab is greater than or equal to the version.
156
194
  // If so, we set it as the default value for the option.
157
- for (const [version, value] of versions) {
195
+ for (const pair of versions) {
196
+ const [version, _] = pair;
158
197
  if (gte(minVersionForCollab, version)) {
159
- return value as T;
198
+ return pair;
160
199
  }
161
200
  }
162
- fail("No config map entry for version");
201
+ return undefined;
163
202
  }
164
203
 
165
204
  /**
@@ -199,7 +238,7 @@ export function isValidMinVersionForCollab(
199
238
  return isValidSemver && isGteLowestMinVersion && isLtePkgVersion;
200
239
  }
201
240
 
202
- const parsedPackageVersion = parse(pkgVersion) ?? fail("Invalid package version");
241
+ const parsedPackageVersion = parse(pkgVersion) ?? fail(0xcb9 /* Invalid package version */);
203
242
 
204
243
  /**
205
244
  * `pkgVersion` version without pre-release.
package/src/index.ts CHANGED
@@ -70,7 +70,9 @@ export {
70
70
  isValidMinVersionForCollab,
71
71
  validateMinimumVersionForCollab,
72
72
  lowestMinVersionForCollab,
73
+ getConfigForMinVersionForCollabIterable,
73
74
  cleanedPackageVersion,
75
+ selectVersionRoundedDown,
74
76
  } from "./compatibilityBase.js";
75
77
  export type {
76
78
  ConfigMap,
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/runtime-utils";
9
- export const pkgVersion = "2.74.0";
9
+ export const pkgVersion = "2.81.0";
@@ -57,6 +57,7 @@ export class RequestParser implements IRequest {
57
57
  * Returns the decoded path parts of the request's url
58
58
  */
59
59
  public get pathParts(): readonly string[] {
60
+ // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- using ??= could change behavior if value is falsy
60
61
  if (this.requestPathParts === undefined) {
61
62
  this.requestPathParts = RequestParser.getPathParts(this.url);
62
63
  }
@@ -32,7 +32,11 @@ import type {
32
32
  ISummarizeResult,
33
33
  ITelemetryContextExt,
34
34
  } from "@fluidframework/runtime-definitions/internal";
35
- import { gcDataBlobKey } from "@fluidframework/runtime-definitions/internal";
35
+ import {
36
+ currentSummarizeStepPrefix,
37
+ currentSummarizeStepPropertyName,
38
+ gcDataBlobKey,
39
+ } from "@fluidframework/runtime-definitions/internal";
36
40
  import type { TelemetryEventPropertyTypeExt } from "@fluidframework/telemetry-utils/internal";
37
41
 
38
42
  /**
@@ -520,14 +524,18 @@ export class TelemetryContext implements ITelemetryContext, ITelemetryContextExt
520
524
  }
521
525
 
522
526
  /**
523
- * {@inheritDoc @fluidframework/runtime-definitions#ITelemetryContext.get}
527
+ * Get the telemetry data being tracked
528
+ * @param prefix - unique prefix to tag this data with (ex: "fluid:map:")
529
+ * @param property - property name of the telemetry data being tracked (ex: "DirectoryCount")
530
+ * @returns undefined if item not found
524
531
  */
525
532
  public get(prefix: string, property: string): TelemetryEventPropertyTypeExt {
526
533
  return this.telemetry.get(`${prefix}${property}`);
527
534
  }
528
535
 
529
536
  /**
530
- * {@inheritDoc @fluidframework/runtime-definitions#ITelemetryContext.serialize}
537
+ * Returns a serialized version of all the telemetry data.
538
+ * Should be used when logging in telemetry events.
531
539
  */
532
540
  public serialize(): string {
533
541
  const jsonObject = {};
@@ -536,6 +544,14 @@ export class TelemetryContext implements ITelemetryContext, ITelemetryContextExt
536
544
  }
537
545
  return JSON.stringify(jsonObject);
538
546
  }
547
+
548
+ public getCurrentSummarizeStep(): TelemetryEventPropertyTypeExt {
549
+ return this.get(currentSummarizeStepPrefix, currentSummarizeStepPropertyName);
550
+ }
551
+
552
+ public setCurrentSummarizeStep(value: TelemetryEventPropertyTypeExt): void {
553
+ this.set(currentSummarizeStepPrefix, currentSummarizeStepPropertyName, value);
554
+ }
539
555
  }
540
556
 
541
557
  /**
package/.eslintrc.cjs DELETED
@@ -1,14 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
-
6
- module.exports = {
7
- extends: [require.resolve("@fluidframework/eslint-config-fluid/strict"), "prettier"],
8
- parserOptions: {
9
- project: ["./tsconfig.json", "./src/test/tsconfig.json"],
10
- },
11
- rules: {
12
- "@fluid-internal/fluid/no-unchecked-record-access": "warn",
13
- },
14
- };