@fluid-experimental/tree 2.12.0 → 2.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @fluid-experimental/tree
2
2
 
3
+ ## 2.20.0
4
+
5
+ Dependency updates only.
6
+
7
+ ## 2.13.0
8
+
9
+ Dependency updates only.
10
+
3
11
  ## 2.12.0
4
12
 
5
13
  Dependency updates only.
@@ -1 +1 @@
1
- {"version":3,"file":"SummaryBackCompatibility.js","sourceRoot":"","sources":["../src/SummaryBackCompatibility.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH,2CAAmC;AACnC,6CAAoE;AACpE,yDAKoC;AAEpC;;;;;;;;;GASG;AACH,SAAgB,WAAW,CAAC,WAAmB,EAAE,UAA4B;IAC5E,IAAI,OAAuC,CAAC;IAC5C,IAAI,CAAC;QACJ,OAAO,GAAG,UAAU,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IACzC,CAAC;IAAC,MAAM,CAAC;QACR,IAAA,gBAAI,EAAC,8BAA8B,CAAC,CAAC;IACtC,CAAC;IAED,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QACjC,IAAA,gBAAI,EAAC,0BAA0B,CAAC,CAAC;IAClC,CAAC;IAED,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAE5B,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC3B,OAAO,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,CAAC;IAChC,CAAC;IAED,IAAA,gBAAI,EAAC,2BAA2B,CAAC,CAAC;AACnC,CAAC;AAnBD,kCAmBC;AAgBD;;;GAGG;AACH,SAAgB,oBAAoB,CAAC,OAA8B;IAClE,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAE5B,IAAI,OAAO,KAAK,sBAAW,CAAC,MAAM,EAAE,CAAC;QACpC,MAAM,EAAE,WAAW,EAAE,GAAG,OAA4B,CAAC;QAErD,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;YAC/B,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE,CAAC;gBACrC,IAAA,gBAAI,EAAC,+BAA+B,CAAC,CAAC;YACvC,CAAC;YAED,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,WAAW,CAAC;YAE5C,oHAAoH;YACpH,IAAI,UAAU,KAAK,SAAS,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;gBACvD,OAAO;oBACN,aAAa,EAAE,OAAO;oBACtB,WAAW,EAAE,OAAO,CAAC,MAAM;oBAC3B,mBAAmB,EAAE,UAAU,CAAC,MAAM;oBACtC,cAAc,EAAE,IAAA,iDAAoC,EAAC,WAAW,CAAC;iBACjE,CAAC;YACH,CAAC;YAED,IAAA,gBAAI,EAAC,oCAAoC,CAAC,CAAC;QAC5C,CAAC;IACF,CAAC;SAAM,IAAI,OAAO,KAAK,sBAAW,CAAC,MAAM,EAAE,CAAC;QAC3C,MAAM,EAAE,cAAc,EAAE,GAAG,OAAkC,CAAC;QAE9D,OAAO;YACN,aAAa,EAAE,OAAO;YACtB,WAAW,EAAE,cAAc,CAAC,MAAM;SAClC,CAAC;IACH,CAAC;SAAM,CAAC;QACP,IAAA,gBAAI,EAAC,iCAAiC,CAAC,CAAC;IACzC,CAAC;IAED,IAAA,gBAAI,EAAC,2BAA2B,CAAC,CAAC;AACnC,CAAC;AArCD,oDAqCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ITelemetryBaseProperties } from '@fluidframework/core-interfaces';\nimport type { IFluidSerializer } from '@fluidframework/shared-object-base/internal';\n\nimport { fail } from './Common.js';\nimport { getNumberOfHandlesFromEditLogSummary } from './EditLog.js';\nimport {\n\tSharedTreeSummary,\n\tSharedTreeSummaryBase,\n\tSharedTreeSummary_0_0_2,\n\tWriteFormat,\n} from './persisted-types/index.js';\n\n/**\n * Deserializes a JSON object produced by `serialize()` and uses it to initialize the tree with the encoded state.\n * Also constructs handle objects from their serialized form.\n *\n * @param jsonSummary - The string to deserialize.\n * @param serializer - The serializer required to deserialize handles in the string.\n * @returns A SharedTree summary.\n * @throws If the summary could not be interpreted.\n *\n */\nexport function deserialize(jsonSummary: string, serializer: IFluidSerializer): SharedTreeSummaryBase {\n\tlet summary: Partial<SharedTreeSummaryBase>;\n\ttry {\n\t\tsummary = serializer.parse(jsonSummary);\n\t} catch {\n\t\tfail('Json syntax error in Summary');\n\t}\n\n\tif (typeof summary !== 'object') {\n\t\tfail('Summary is not an object');\n\t}\n\n\tconst { version } = summary;\n\n\tif (version !== undefined) {\n\t\treturn { version, ...summary };\n\t}\n\n\tfail('Missing fields on summary');\n}\n\n/**\n * General statistics about summaries.\n */\nexport interface SummaryStatistics extends ITelemetryBaseProperties {\n\t/** Format version the summary is written in. */\n\treadonly formatVersion: string;\n\t/** Number of edits. */\n\treadonly historySize: number;\n\t/** Number of edit chunks in the history. */\n\treadonly totalNumberOfChunks?: number;\n\t/** Number of chunks in the summary that have handles stored. */\n\treadonly uploadedChunks?: number;\n}\n\n/**\n * @returns SummaryStatistics.\n * @throws If statistics could not be obtained from the summary.\n */\nexport function getSummaryStatistics(summary: SharedTreeSummaryBase): SummaryStatistics {\n\tconst { version } = summary;\n\n\tif (version === WriteFormat.v0_1_1) {\n\t\tconst { editHistory } = summary as SharedTreeSummary;\n\n\t\tif (editHistory !== undefined) {\n\t\t\tif (typeof editHistory !== 'object') {\n\t\t\t\tfail('Edit history is not an object');\n\t\t\t}\n\n\t\t\tconst { editChunks, editIds } = editHistory;\n\n\t\t\t// TODO:#45414: Add more robust validation of the summary's fields. Even if they are present, they may be malformed.\n\t\t\tif (editChunks !== undefined && editIds !== undefined) {\n\t\t\t\treturn {\n\t\t\t\t\tformatVersion: version,\n\t\t\t\t\thistorySize: editIds.length,\n\t\t\t\t\ttotalNumberOfChunks: editChunks.length,\n\t\t\t\t\tuploadedChunks: getNumberOfHandlesFromEditLogSummary(editHistory),\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tfail('Missing fields on edit log summary');\n\t\t}\n\t} else if (version === WriteFormat.v0_0_2) {\n\t\tconst { sequencedEdits } = summary as SharedTreeSummary_0_0_2;\n\n\t\treturn {\n\t\t\tformatVersion: version,\n\t\t\thistorySize: sequencedEdits.length,\n\t\t};\n\t} else {\n\t\tfail('Format version is not supported');\n\t}\n\n\tfail('Missing fields on summary');\n}\n"]}
1
+ {"version":3,"file":"SummaryBackCompatibility.js","sourceRoot":"","sources":["../src/SummaryBackCompatibility.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH,2CAAmC;AACnC,6CAAoE;AACpE,yDAKoC;AAEpC;;;;;;;;;GASG;AACH,SAAgB,WAAW,CAAC,WAAmB,EAAE,UAA4B;IAC5E,IAAI,OAAuC,CAAC;IAC5C,IAAI,CAAC;QACJ,OAAO,GAAG,UAAU,CAAC,KAAK,CAAC,WAAW,CAAmC,CAAC;IAC3E,CAAC;IAAC,MAAM,CAAC;QACR,IAAA,gBAAI,EAAC,8BAA8B,CAAC,CAAC;IACtC,CAAC;IAED,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QACjC,IAAA,gBAAI,EAAC,0BAA0B,CAAC,CAAC;IAClC,CAAC;IAED,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAE5B,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC3B,OAAO,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,CAAC;IAChC,CAAC;IAED,IAAA,gBAAI,EAAC,2BAA2B,CAAC,CAAC;AACnC,CAAC;AAnBD,kCAmBC;AAgBD;;;GAGG;AACH,SAAgB,oBAAoB,CAAC,OAA8B;IAClE,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAE5B,IAAI,OAAO,KAAK,sBAAW,CAAC,MAAM,EAAE,CAAC;QACpC,MAAM,EAAE,WAAW,EAAE,GAAG,OAA4B,CAAC;QAErD,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;YAC/B,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE,CAAC;gBACrC,IAAA,gBAAI,EAAC,+BAA+B,CAAC,CAAC;YACvC,CAAC;YAED,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,WAAW,CAAC;YAE5C,oHAAoH;YACpH,IAAI,UAAU,KAAK,SAAS,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;gBACvD,OAAO;oBACN,aAAa,EAAE,OAAO;oBACtB,WAAW,EAAE,OAAO,CAAC,MAAM;oBAC3B,mBAAmB,EAAE,UAAU,CAAC,MAAM;oBACtC,cAAc,EAAE,IAAA,iDAAoC,EAAC,WAAW,CAAC;iBACjE,CAAC;YACH,CAAC;YAED,IAAA,gBAAI,EAAC,oCAAoC,CAAC,CAAC;QAC5C,CAAC;IACF,CAAC;SAAM,IAAI,OAAO,KAAK,sBAAW,CAAC,MAAM,EAAE,CAAC;QAC3C,MAAM,EAAE,cAAc,EAAE,GAAG,OAAkC,CAAC;QAE9D,OAAO;YACN,aAAa,EAAE,OAAO;YACtB,WAAW,EAAE,cAAc,CAAC,MAAM;SAClC,CAAC;IACH,CAAC;SAAM,CAAC;QACP,IAAA,gBAAI,EAAC,iCAAiC,CAAC,CAAC;IACzC,CAAC;IAED,IAAA,gBAAI,EAAC,2BAA2B,CAAC,CAAC;AACnC,CAAC;AArCD,oDAqCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ITelemetryBaseProperties } from '@fluidframework/core-interfaces';\nimport type { IFluidSerializer } from '@fluidframework/shared-object-base/internal';\n\nimport { fail } from './Common.js';\nimport { getNumberOfHandlesFromEditLogSummary } from './EditLog.js';\nimport {\n\tSharedTreeSummary,\n\tSharedTreeSummaryBase,\n\tSharedTreeSummary_0_0_2,\n\tWriteFormat,\n} from './persisted-types/index.js';\n\n/**\n * Deserializes a JSON object produced by `serialize()` and uses it to initialize the tree with the encoded state.\n * Also constructs handle objects from their serialized form.\n *\n * @param jsonSummary - The string to deserialize.\n * @param serializer - The serializer required to deserialize handles in the string.\n * @returns A SharedTree summary.\n * @throws If the summary could not be interpreted.\n *\n */\nexport function deserialize(jsonSummary: string, serializer: IFluidSerializer): SharedTreeSummaryBase {\n\tlet summary: Partial<SharedTreeSummaryBase>;\n\ttry {\n\t\tsummary = serializer.parse(jsonSummary) as Partial<SharedTreeSummaryBase>;\n\t} catch {\n\t\tfail('Json syntax error in Summary');\n\t}\n\n\tif (typeof summary !== 'object') {\n\t\tfail('Summary is not an object');\n\t}\n\n\tconst { version } = summary;\n\n\tif (version !== undefined) {\n\t\treturn { version, ...summary };\n\t}\n\n\tfail('Missing fields on summary');\n}\n\n/**\n * General statistics about summaries.\n */\nexport interface SummaryStatistics extends ITelemetryBaseProperties {\n\t/** Format version the summary is written in. */\n\treadonly formatVersion: string;\n\t/** Number of edits. */\n\treadonly historySize: number;\n\t/** Number of edit chunks in the history. */\n\treadonly totalNumberOfChunks?: number;\n\t/** Number of chunks in the summary that have handles stored. */\n\treadonly uploadedChunks?: number;\n}\n\n/**\n * @returns SummaryStatistics.\n * @throws If statistics could not be obtained from the summary.\n */\nexport function getSummaryStatistics(summary: SharedTreeSummaryBase): SummaryStatistics {\n\tconst { version } = summary;\n\n\tif (version === WriteFormat.v0_1_1) {\n\t\tconst { editHistory } = summary as SharedTreeSummary;\n\n\t\tif (editHistory !== undefined) {\n\t\t\tif (typeof editHistory !== 'object') {\n\t\t\t\tfail('Edit history is not an object');\n\t\t\t}\n\n\t\t\tconst { editChunks, editIds } = editHistory;\n\n\t\t\t// TODO:#45414: Add more robust validation of the summary's fields. Even if they are present, they may be malformed.\n\t\t\tif (editChunks !== undefined && editIds !== undefined) {\n\t\t\t\treturn {\n\t\t\t\t\tformatVersion: version,\n\t\t\t\t\thistorySize: editIds.length,\n\t\t\t\t\ttotalNumberOfChunks: editChunks.length,\n\t\t\t\t\tuploadedChunks: getNumberOfHandlesFromEditLogSummary(editHistory),\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tfail('Missing fields on edit log summary');\n\t\t}\n\t} else if (version === WriteFormat.v0_0_2) {\n\t\tconst { sequencedEdits } = summary as SharedTreeSummary_0_0_2;\n\n\t\treturn {\n\t\t\tformatVersion: version,\n\t\t\thistorySize: sequencedEdits.length,\n\t\t};\n\t} else {\n\t\tfail('Format version is not supported');\n\t}\n\n\tfail('Missing fields on summary');\n}\n"]}
package/dist/package.json CHANGED
@@ -1,3 +1,4 @@
1
1
  {
2
- "type": "commonjs"
2
+ "type": "commonjs",
3
+ "sideEffects": false
3
4
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SummaryBackCompatibility.js","sourceRoot":"","sources":["../src/SummaryBackCompatibility.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,oCAAoC,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EAIN,WAAW,GACX,MAAM,4BAA4B,CAAC;AAEpC;;;;;;;;;GASG;AACH,MAAM,UAAU,WAAW,CAAC,WAAmB,EAAE,UAA4B;IAC5E,IAAI,OAAuC,CAAC;IAC5C,IAAI,CAAC;QACJ,OAAO,GAAG,UAAU,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IACzC,CAAC;IAAC,MAAM,CAAC;QACR,IAAI,CAAC,8BAA8B,CAAC,CAAC;IACtC,CAAC;IAED,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QACjC,IAAI,CAAC,0BAA0B,CAAC,CAAC;IAClC,CAAC;IAED,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAE5B,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC3B,OAAO,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,CAAC;IAChC,CAAC;IAED,IAAI,CAAC,2BAA2B,CAAC,CAAC;AACnC,CAAC;AAgBD;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAA8B;IAClE,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAE5B,IAAI,OAAO,KAAK,WAAW,CAAC,MAAM,EAAE,CAAC;QACpC,MAAM,EAAE,WAAW,EAAE,GAAG,OAA4B,CAAC;QAErD,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;YAC/B,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE,CAAC;gBACrC,IAAI,CAAC,+BAA+B,CAAC,CAAC;YACvC,CAAC;YAED,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,WAAW,CAAC;YAE5C,oHAAoH;YACpH,IAAI,UAAU,KAAK,SAAS,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;gBACvD,OAAO;oBACN,aAAa,EAAE,OAAO;oBACtB,WAAW,EAAE,OAAO,CAAC,MAAM;oBAC3B,mBAAmB,EAAE,UAAU,CAAC,MAAM;oBACtC,cAAc,EAAE,oCAAoC,CAAC,WAAW,CAAC;iBACjE,CAAC;YACH,CAAC;YAED,IAAI,CAAC,oCAAoC,CAAC,CAAC;QAC5C,CAAC;IACF,CAAC;SAAM,IAAI,OAAO,KAAK,WAAW,CAAC,MAAM,EAAE,CAAC;QAC3C,MAAM,EAAE,cAAc,EAAE,GAAG,OAAkC,CAAC;QAE9D,OAAO;YACN,aAAa,EAAE,OAAO;YACtB,WAAW,EAAE,cAAc,CAAC,MAAM;SAClC,CAAC;IACH,CAAC;SAAM,CAAC;QACP,IAAI,CAAC,iCAAiC,CAAC,CAAC;IACzC,CAAC;IAED,IAAI,CAAC,2BAA2B,CAAC,CAAC;AACnC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ITelemetryBaseProperties } from '@fluidframework/core-interfaces';\nimport type { IFluidSerializer } from '@fluidframework/shared-object-base/internal';\n\nimport { fail } from './Common.js';\nimport { getNumberOfHandlesFromEditLogSummary } from './EditLog.js';\nimport {\n\tSharedTreeSummary,\n\tSharedTreeSummaryBase,\n\tSharedTreeSummary_0_0_2,\n\tWriteFormat,\n} from './persisted-types/index.js';\n\n/**\n * Deserializes a JSON object produced by `serialize()` and uses it to initialize the tree with the encoded state.\n * Also constructs handle objects from their serialized form.\n *\n * @param jsonSummary - The string to deserialize.\n * @param serializer - The serializer required to deserialize handles in the string.\n * @returns A SharedTree summary.\n * @throws If the summary could not be interpreted.\n *\n */\nexport function deserialize(jsonSummary: string, serializer: IFluidSerializer): SharedTreeSummaryBase {\n\tlet summary: Partial<SharedTreeSummaryBase>;\n\ttry {\n\t\tsummary = serializer.parse(jsonSummary);\n\t} catch {\n\t\tfail('Json syntax error in Summary');\n\t}\n\n\tif (typeof summary !== 'object') {\n\t\tfail('Summary is not an object');\n\t}\n\n\tconst { version } = summary;\n\n\tif (version !== undefined) {\n\t\treturn { version, ...summary };\n\t}\n\n\tfail('Missing fields on summary');\n}\n\n/**\n * General statistics about summaries.\n */\nexport interface SummaryStatistics extends ITelemetryBaseProperties {\n\t/** Format version the summary is written in. */\n\treadonly formatVersion: string;\n\t/** Number of edits. */\n\treadonly historySize: number;\n\t/** Number of edit chunks in the history. */\n\treadonly totalNumberOfChunks?: number;\n\t/** Number of chunks in the summary that have handles stored. */\n\treadonly uploadedChunks?: number;\n}\n\n/**\n * @returns SummaryStatistics.\n * @throws If statistics could not be obtained from the summary.\n */\nexport function getSummaryStatistics(summary: SharedTreeSummaryBase): SummaryStatistics {\n\tconst { version } = summary;\n\n\tif (version === WriteFormat.v0_1_1) {\n\t\tconst { editHistory } = summary as SharedTreeSummary;\n\n\t\tif (editHistory !== undefined) {\n\t\t\tif (typeof editHistory !== 'object') {\n\t\t\t\tfail('Edit history is not an object');\n\t\t\t}\n\n\t\t\tconst { editChunks, editIds } = editHistory;\n\n\t\t\t// TODO:#45414: Add more robust validation of the summary's fields. Even if they are present, they may be malformed.\n\t\t\tif (editChunks !== undefined && editIds !== undefined) {\n\t\t\t\treturn {\n\t\t\t\t\tformatVersion: version,\n\t\t\t\t\thistorySize: editIds.length,\n\t\t\t\t\ttotalNumberOfChunks: editChunks.length,\n\t\t\t\t\tuploadedChunks: getNumberOfHandlesFromEditLogSummary(editHistory),\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tfail('Missing fields on edit log summary');\n\t\t}\n\t} else if (version === WriteFormat.v0_0_2) {\n\t\tconst { sequencedEdits } = summary as SharedTreeSummary_0_0_2;\n\n\t\treturn {\n\t\t\tformatVersion: version,\n\t\t\thistorySize: sequencedEdits.length,\n\t\t};\n\t} else {\n\t\tfail('Format version is not supported');\n\t}\n\n\tfail('Missing fields on summary');\n}\n"]}
1
+ {"version":3,"file":"SummaryBackCompatibility.js","sourceRoot":"","sources":["../src/SummaryBackCompatibility.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,oCAAoC,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EAIN,WAAW,GACX,MAAM,4BAA4B,CAAC;AAEpC;;;;;;;;;GASG;AACH,MAAM,UAAU,WAAW,CAAC,WAAmB,EAAE,UAA4B;IAC5E,IAAI,OAAuC,CAAC;IAC5C,IAAI,CAAC;QACJ,OAAO,GAAG,UAAU,CAAC,KAAK,CAAC,WAAW,CAAmC,CAAC;IAC3E,CAAC;IAAC,MAAM,CAAC;QACR,IAAI,CAAC,8BAA8B,CAAC,CAAC;IACtC,CAAC;IAED,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QACjC,IAAI,CAAC,0BAA0B,CAAC,CAAC;IAClC,CAAC;IAED,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAE5B,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC3B,OAAO,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,CAAC;IAChC,CAAC;IAED,IAAI,CAAC,2BAA2B,CAAC,CAAC;AACnC,CAAC;AAgBD;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAA8B;IAClE,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAE5B,IAAI,OAAO,KAAK,WAAW,CAAC,MAAM,EAAE,CAAC;QACpC,MAAM,EAAE,WAAW,EAAE,GAAG,OAA4B,CAAC;QAErD,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;YAC/B,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE,CAAC;gBACrC,IAAI,CAAC,+BAA+B,CAAC,CAAC;YACvC,CAAC;YAED,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,WAAW,CAAC;YAE5C,oHAAoH;YACpH,IAAI,UAAU,KAAK,SAAS,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;gBACvD,OAAO;oBACN,aAAa,EAAE,OAAO;oBACtB,WAAW,EAAE,OAAO,CAAC,MAAM;oBAC3B,mBAAmB,EAAE,UAAU,CAAC,MAAM;oBACtC,cAAc,EAAE,oCAAoC,CAAC,WAAW,CAAC;iBACjE,CAAC;YACH,CAAC;YAED,IAAI,CAAC,oCAAoC,CAAC,CAAC;QAC5C,CAAC;IACF,CAAC;SAAM,IAAI,OAAO,KAAK,WAAW,CAAC,MAAM,EAAE,CAAC;QAC3C,MAAM,EAAE,cAAc,EAAE,GAAG,OAAkC,CAAC;QAE9D,OAAO;YACN,aAAa,EAAE,OAAO;YACtB,WAAW,EAAE,cAAc,CAAC,MAAM;SAClC,CAAC;IACH,CAAC;SAAM,CAAC;QACP,IAAI,CAAC,iCAAiC,CAAC,CAAC;IACzC,CAAC;IAED,IAAI,CAAC,2BAA2B,CAAC,CAAC;AACnC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ITelemetryBaseProperties } from '@fluidframework/core-interfaces';\nimport type { IFluidSerializer } from '@fluidframework/shared-object-base/internal';\n\nimport { fail } from './Common.js';\nimport { getNumberOfHandlesFromEditLogSummary } from './EditLog.js';\nimport {\n\tSharedTreeSummary,\n\tSharedTreeSummaryBase,\n\tSharedTreeSummary_0_0_2,\n\tWriteFormat,\n} from './persisted-types/index.js';\n\n/**\n * Deserializes a JSON object produced by `serialize()` and uses it to initialize the tree with the encoded state.\n * Also constructs handle objects from their serialized form.\n *\n * @param jsonSummary - The string to deserialize.\n * @param serializer - The serializer required to deserialize handles in the string.\n * @returns A SharedTree summary.\n * @throws If the summary could not be interpreted.\n *\n */\nexport function deserialize(jsonSummary: string, serializer: IFluidSerializer): SharedTreeSummaryBase {\n\tlet summary: Partial<SharedTreeSummaryBase>;\n\ttry {\n\t\tsummary = serializer.parse(jsonSummary) as Partial<SharedTreeSummaryBase>;\n\t} catch {\n\t\tfail('Json syntax error in Summary');\n\t}\n\n\tif (typeof summary !== 'object') {\n\t\tfail('Summary is not an object');\n\t}\n\n\tconst { version } = summary;\n\n\tif (version !== undefined) {\n\t\treturn { version, ...summary };\n\t}\n\n\tfail('Missing fields on summary');\n}\n\n/**\n * General statistics about summaries.\n */\nexport interface SummaryStatistics extends ITelemetryBaseProperties {\n\t/** Format version the summary is written in. */\n\treadonly formatVersion: string;\n\t/** Number of edits. */\n\treadonly historySize: number;\n\t/** Number of edit chunks in the history. */\n\treadonly totalNumberOfChunks?: number;\n\t/** Number of chunks in the summary that have handles stored. */\n\treadonly uploadedChunks?: number;\n}\n\n/**\n * @returns SummaryStatistics.\n * @throws If statistics could not be obtained from the summary.\n */\nexport function getSummaryStatistics(summary: SharedTreeSummaryBase): SummaryStatistics {\n\tconst { version } = summary;\n\n\tif (version === WriteFormat.v0_1_1) {\n\t\tconst { editHistory } = summary as SharedTreeSummary;\n\n\t\tif (editHistory !== undefined) {\n\t\t\tif (typeof editHistory !== 'object') {\n\t\t\t\tfail('Edit history is not an object');\n\t\t\t}\n\n\t\t\tconst { editChunks, editIds } = editHistory;\n\n\t\t\t// TODO:#45414: Add more robust validation of the summary's fields. Even if they are present, they may be malformed.\n\t\t\tif (editChunks !== undefined && editIds !== undefined) {\n\t\t\t\treturn {\n\t\t\t\t\tformatVersion: version,\n\t\t\t\t\thistorySize: editIds.length,\n\t\t\t\t\ttotalNumberOfChunks: editChunks.length,\n\t\t\t\t\tuploadedChunks: getNumberOfHandlesFromEditLogSummary(editHistory),\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tfail('Missing fields on edit log summary');\n\t\t}\n\t} else if (version === WriteFormat.v0_0_2) {\n\t\tconst { sequencedEdits } = summary as SharedTreeSummary_0_0_2;\n\n\t\treturn {\n\t\t\tformatVersion: version,\n\t\t\thistorySize: sequencedEdits.length,\n\t\t};\n\t} else {\n\t\tfail('Format version is not supported');\n\t}\n\n\tfail('Missing fields on summary');\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-experimental/tree",
3
- "version": "2.12.0",
3
+ "version": "2.20.0",
4
4
  "description": "Distributed tree",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -37,18 +37,18 @@
37
37
  "main": "lib/index.js",
38
38
  "types": "lib/index.d.ts",
39
39
  "dependencies": {
40
- "@fluid-internal/client-utils": "~2.12.0",
41
- "@fluidframework/container-definitions": "~2.12.0",
42
- "@fluidframework/core-interfaces": "~2.12.0",
43
- "@fluidframework/core-utils": "~2.12.0",
44
- "@fluidframework/datastore-definitions": "~2.12.0",
45
- "@fluidframework/driver-definitions": "~2.12.0",
46
- "@fluidframework/id-compressor": "~2.12.0",
47
- "@fluidframework/runtime-definitions": "~2.12.0",
48
- "@fluidframework/runtime-utils": "~2.12.0",
49
- "@fluidframework/shared-object-base": "~2.12.0",
50
- "@fluidframework/telemetry-utils": "~2.12.0",
51
- "@fluidframework/tree": "~2.12.0",
40
+ "@fluid-internal/client-utils": "~2.20.0",
41
+ "@fluidframework/container-definitions": "~2.20.0",
42
+ "@fluidframework/core-interfaces": "~2.20.0",
43
+ "@fluidframework/core-utils": "~2.20.0",
44
+ "@fluidframework/datastore-definitions": "~2.20.0",
45
+ "@fluidframework/driver-definitions": "~2.20.0",
46
+ "@fluidframework/id-compressor": "~2.20.0",
47
+ "@fluidframework/runtime-definitions": "~2.20.0",
48
+ "@fluidframework/runtime-utils": "~2.20.0",
49
+ "@fluidframework/shared-object-base": "~2.20.0",
50
+ "@fluidframework/telemetry-utils": "~2.20.0",
51
+ "@fluidframework/tree": "~2.20.0",
52
52
  "@tylerbu/sorted-btree-es6": "^1.8.0",
53
53
  "buffer": "^6.0.3",
54
54
  "denque": "^1.5.1",
@@ -58,24 +58,24 @@
58
58
  "devDependencies": {
59
59
  "@arethetypeswrong/cli": "^0.17.1",
60
60
  "@biomejs/biome": "~1.9.3",
61
- "@fluid-internal/mocha-test-setup": "~2.12.0",
62
- "@fluid-private/stochastic-test-utils": "~2.12.0",
63
- "@fluid-private/test-drivers": "~2.12.0",
61
+ "@fluid-internal/mocha-test-setup": "~2.20.0",
62
+ "@fluid-private/stochastic-test-utils": "~2.20.0",
63
+ "@fluid-private/test-drivers": "~2.20.0",
64
64
  "@fluid-tools/benchmark": "^0.50.0",
65
65
  "@fluidframework/build-common": "^2.0.3",
66
66
  "@fluidframework/build-tools": "^0.51.0",
67
- "@fluidframework/container-definitions": "~2.12.0",
68
- "@fluidframework/container-loader": "~2.12.0",
69
- "@fluidframework/container-runtime": "~2.12.0",
67
+ "@fluidframework/container-definitions": "~2.20.0",
68
+ "@fluidframework/container-loader": "~2.20.0",
69
+ "@fluidframework/container-runtime": "~2.20.0",
70
70
  "@fluidframework/eslint-config-fluid": "^5.6.0",
71
- "@fluidframework/runtime-utils": "~2.12.0",
72
- "@fluidframework/test-runtime-utils": "~2.12.0",
73
- "@fluidframework/test-utils": "~2.12.0",
74
- "@fluidframework/undo-redo": "~2.12.0",
71
+ "@fluidframework/runtime-utils": "~2.20.0",
72
+ "@fluidframework/test-runtime-utils": "~2.20.0",
73
+ "@fluidframework/test-utils": "~2.20.0",
74
+ "@fluidframework/undo-redo": "~2.20.0",
75
75
  "@microsoft/api-extractor": "7.47.8",
76
76
  "@types/chai": "^4.0.0",
77
77
  "@types/lru-cache": "^5.1.0",
78
- "@types/mocha": "^9.1.1",
78
+ "@types/mocha": "^10.0.10",
79
79
  "@types/uuid": "^9.0.2",
80
80
  "c8": "^8.0.1",
81
81
  "chai": "^4.2.0",
@@ -28,7 +28,7 @@ import {
28
28
  export function deserialize(jsonSummary: string, serializer: IFluidSerializer): SharedTreeSummaryBase {
29
29
  let summary: Partial<SharedTreeSummaryBase>;
30
30
  try {
31
- summary = serializer.parse(jsonSummary);
31
+ summary = serializer.parse(jsonSummary) as Partial<SharedTreeSummaryBase>;
32
32
  } catch {
33
33
  fail('Json syntax error in Summary');
34
34
  }