@fluid-experimental/tree 0.59.1000 → 0.59.2000-63294

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 (68) hide show
  1. package/api-extractor.json +5 -9
  2. package/dist/Checkout.js +1 -1
  3. package/dist/Checkout.js.map +1 -1
  4. package/dist/SharedTree.d.ts +16 -10
  5. package/dist/SharedTree.d.ts.map +1 -1
  6. package/dist/SharedTree.js +22 -10
  7. package/dist/SharedTree.js.map +1 -1
  8. package/dist/SummaryTestUtilities.js.map +1 -1
  9. package/dist/Transaction.d.ts +22 -2
  10. package/dist/Transaction.d.ts.map +1 -1
  11. package/dist/Transaction.js +26 -6
  12. package/dist/Transaction.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 +2 -1
  16. package/dist/index.js.map +1 -1
  17. package/dist/persisted-types/0.1.1.d.ts +9 -0
  18. package/dist/persisted-types/0.1.1.d.ts.map +1 -1
  19. package/dist/persisted-types/0.1.1.js.map +1 -1
  20. package/lib/Checkout.js +1 -1
  21. package/lib/Checkout.js.map +1 -1
  22. package/lib/SharedTree.d.ts +16 -10
  23. package/lib/SharedTree.d.ts.map +1 -1
  24. package/lib/SharedTree.js +22 -10
  25. package/lib/SharedTree.js.map +1 -1
  26. package/lib/SummaryTestUtilities.js.map +1 -1
  27. package/lib/Transaction.d.ts +22 -2
  28. package/lib/Transaction.d.ts.map +1 -1
  29. package/lib/Transaction.js +25 -5
  30. package/lib/Transaction.js.map +1 -1
  31. package/lib/index.d.ts +2 -2
  32. package/lib/index.d.ts.map +1 -1
  33. package/lib/index.js +1 -1
  34. package/lib/index.js.map +1 -1
  35. package/lib/persisted-types/0.1.1.d.ts +9 -0
  36. package/lib/persisted-types/0.1.1.d.ts.map +1 -1
  37. package/lib/persisted-types/0.1.1.js.map +1 -1
  38. package/lib/test/Forest.perf.tests.js +5 -3
  39. package/lib/test/Forest.perf.tests.js.map +1 -1
  40. package/lib/test/IdCompressor.tests.js +1 -1
  41. package/lib/test/IdCompressor.tests.js.map +1 -1
  42. package/lib/test/Summary.tests.d.ts.map +1 -1
  43. package/lib/test/Summary.tests.js +3 -3
  44. package/lib/test/Summary.tests.js.map +1 -1
  45. package/lib/test/Transaction.tests.js +36 -2
  46. package/lib/test/Transaction.tests.js.map +1 -1
  47. package/lib/test/fuzz/SharedTreeFuzzTests.js +2 -2
  48. package/lib/test/fuzz/SharedTreeFuzzTests.js.map +1 -1
  49. package/lib/test/utilities/PendingLocalStateTests.d.ts.map +1 -1
  50. package/lib/test/utilities/PendingLocalStateTests.js +4 -4
  51. package/lib/test/utilities/PendingLocalStateTests.js.map +1 -1
  52. package/lib/test/utilities/SharedTreeTests.d.ts.map +1 -1
  53. package/lib/test/utilities/SharedTreeTests.js +59 -7
  54. package/lib/test/utilities/SharedTreeTests.js.map +1 -1
  55. package/lib/test/utilities/SharedTreeVersioningTests.js +1 -1
  56. package/lib/test/utilities/SharedTreeVersioningTests.js.map +1 -1
  57. package/lib/test/utilities/SummarySizeTests.js.map +1 -1
  58. package/lib/test/utilities/TestUtilities.d.ts +2 -0
  59. package/lib/test/utilities/TestUtilities.d.ts.map +1 -1
  60. package/lib/test/utilities/TestUtilities.js +9 -1
  61. package/lib/test/utilities/TestUtilities.js.map +1 -1
  62. package/package.json +21 -18
  63. package/src/Checkout.ts +1 -1
  64. package/src/SharedTree.ts +39 -19
  65. package/src/SummaryTestUtilities.ts +1 -1
  66. package/src/Transaction.ts +38 -6
  67. package/src/index.ts +2 -1
  68. package/src/persisted-types/0.1.1.ts +11 -0
@@ -1 +1 @@
1
- {"version":3,"file":"Transaction.js","sourceRoot":"","sources":["../src/Transaction.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAwB,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,OAAO,EAAE,kBAAkB,E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B,IAAI,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE;gBACxC,MAAM,IAAI,GAAyB,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;gBAC1F,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;gBACxC,IAAI,IAAI,CAAC,IAAI,CAAC,aAAa,YAAY,gBAAgB,EAAE;oBACxD,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;iBAC5D;gBACD,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;aAClC;SACD;IACF,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ChangeInternal, Edit, EditStatus } from './persisted-types';\nimport { newEditId } from './EditUtilities';\nimport { TreeView } from './TreeView';\nimport { Change } from './ChangeTypes';\nimport { SharedTree } from './SharedTree';\nimport { GenericTransaction, TransactionInternal } from './TransactionInternal';\nimport { CachingLogViewer } from './LogViewer';\n\n/**\n * Buffers changes to be applied to an isolated view of a `SharedTree` over time before applying them directly to the tree itself as a\n * single edit\n */\nexport class Transaction {\n\t/** The view of the tree when this transaction was created */\n\tpublic readonly startingView: TreeView;\n\tprivate readonly transaction: GenericTransaction;\n\n\t/**\n\t * Create a new transaction over the given tree. The tree's `currentView` at this time will become the `startingView` for this\n\t * transaction.\n\t * @param tree - the `SharedTree` that this transaction applies changes to\n\t */\n\tpublic constructor(public readonly tree: SharedTree) {\n\t\tconst { currentView } = tree;\n\t\tthis.transaction = new GenericTransaction(currentView, new TransactionInternal.Policy());\n\t\tthis.startingView = currentView;\n\t}\n\n\t/**\n\t * True if this transaction is open, false if it is closed. A transaction may be closed manually via `closeAndApplyEdit()`, or may\n\t * be automatically closed by a change in this transaction failing to apply (see `applyChange()`).\n\t */\n\tpublic get isOpen(): boolean {\n\t\treturn this.transaction.isOpen && this.status === EditStatus.Applied;\n\t}\n\n\t/**\n\t * The status of the most recently applied change in this transaction\n\t */\n\tpublic get status(): EditStatus {\n\t\treturn this.transaction.status;\n\t}\n\n\t/**\n\t * The state of the tree following the most change that was successfully applied. If no changes have been applied, this is the same as\n\t * `startingView`.\n\t */\n\tpublic get currentView(): TreeView {\n\t\treturn this.transaction.view;\n\t}\n\n\t/**\n\t * Attempt to apply a sequence of changes in this transaction. The `currentView` will be updated to reflect the new tree state after all\n\t * applied changes. If any change fails to apply, the remaining changes will be ignored and this transaction will be automatically\n\t * closed (see `isOpen`). If this transaction is already closed, this method has no effect.\n\t * @param changes - the changes to apply\n\t * @returns either the `EditStatus` of the given changes or the `EditStatus` of the last change before the transaction was closed\n\t */\n\tpublic apply(...changes: Change[]): EditStatus;\n\tpublic apply(changes: Change[]): EditStatus;\n\tpublic apply(headOrChanges: Change | Change[], ...tail: Change[]): EditStatus {\n\t\tif (this.isOpen) {\n\t\t\tconst changes = Array.isArray(headOrChanges) ? headOrChanges : [headOrChanges, ...tail];\n\t\t\tthis.transaction.applyChanges(changes.map((c) => this.tree.internalizeChange(c)));\n\t\t}\n\t\treturn this.status;\n\t}\n\n\t/**\n\t * Close this transaction and apply its changes to the `SharedTree`. If this transaction is already closed, this method has no effect.\n\t */\n\tpublic closeAndCommit(): void {\n\t\tif (this.isOpen) {\n\t\t\tif (this.transaction.changes.length > 0) {\n\t\t\t\tconst edit: Edit<ChangeInternal> = { id: newEditId(), changes: this.transaction.changes };\n\t\t\t\tconst result = this.transaction.close();\n\t\t\t\tif (this.tree.editsInternal instanceof CachingLogViewer) {\n\t\t\t\t\tthis.tree.editsInternal.setKnownEditingResult(edit, result);\n\t\t\t\t}\n\t\t\t\tthis.tree.applyEditInternal(edit);\n\t\t\t}\n\t\t}\n\t}\n}\n"]}
1
+ {"version":3,"file":"Transaction.js","source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CAAC;aAClC;SACD;IACF,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IErrorEvent } from '@fluidframework/common-definitions';\nimport { TypedEventEmitter } from '@fluidframework/common-utils';\nimport { ChangeInternal, Edit, EditStatus } from './persisted-types';\nimport { newEditId } from './EditUtilities';\nimport { TreeView } from './TreeView';\nimport { Change } from './ChangeTypes';\nimport { SharedTree } from './SharedTree';\nimport { GenericTransaction, TransactionInternal } from './TransactionInternal';\nimport { CachingLogViewer } from './LogViewer';\n\n/**\n * An event emitted by a `Transaction` to indicate a state change. See {@link TransactionEvents} for event argument information.\n * @public\n */\nexport enum TransactionEvent {\n\t/**\n\t * `currentView` has changed from `before` to `after`\n\t */\n\tViewChange = 'viewChange',\n}\n\n/**\n * Events which may be emitted by `Transaction`\n * @public\n */\nexport interface TransactionEvents extends IErrorEvent {\n\t(event: TransactionEvent.ViewChange, listener: (before: TreeView, after: TreeView) => void);\n}\n\n/**\n * Buffers changes to be applied to an isolated view of a `SharedTree` over time before applying them directly to the tree itself as a\n * single edit\n */\nexport class Transaction extends TypedEventEmitter<TransactionEvents> {\n\t/** The view of the tree when this transaction was created */\n\tpublic readonly startingView: TreeView;\n\tprivate readonly transaction: GenericTransaction;\n\n\t/**\n\t * Create a new transaction over the given tree. The tree's `currentView` at this time will become the `startingView` for this\n\t * transaction.\n\t * @param tree - the `SharedTree` that this transaction applies changes to\n\t */\n\tpublic constructor(public readonly tree: SharedTree) {\n\t\tsuper();\n\t\tconst { currentView } = tree;\n\t\tthis.transaction = new GenericTransaction(currentView, new TransactionInternal.Policy());\n\t\tthis.startingView = currentView;\n\t}\n\n\t/**\n\t * True if this transaction is open, false if it is closed. A transaction may be closed manually via `closeAndApplyEdit()`, or may\n\t * be automatically closed by a change in this transaction failing to apply (see `applyChange()`).\n\t */\n\tpublic get isOpen(): boolean {\n\t\treturn this.transaction.isOpen && this.status === EditStatus.Applied;\n\t}\n\n\t/**\n\t * The status of the most recently applied change in this transaction\n\t */\n\tpublic get status(): EditStatus {\n\t\treturn this.transaction.status;\n\t}\n\n\t/**\n\t * The state of the tree following the most change that was successfully applied. If no changes have been applied, this is the same as\n\t * `startingView`.\n\t */\n\tpublic get currentView(): TreeView {\n\t\treturn this.transaction.view;\n\t}\n\n\t/**\n\t * Attempt to apply a sequence of changes in this transaction. The `currentView` will be updated to reflect the new tree state after all\n\t * applied changes. If any change fails to apply, the remaining changes will be ignored and this transaction will be automatically\n\t * closed (see `isOpen`). If this transaction is already closed, this method has no effect. This method will emit a\n\t * `TransactionEvent.ViewChange` event at most once per call.\n\t * @param changes - the changes to apply\n\t * @returns either the `EditStatus` of the given changes or the `EditStatus` of the last change before the transaction was closed\n\t */\n\tpublic apply(...changes: Change[]): EditStatus;\n\tpublic apply(changes: Change[]): EditStatus;\n\tpublic apply(headOrChanges: Change | Change[], ...tail: Change[]): EditStatus {\n\t\tif (this.isOpen) {\n\t\t\tconst changes = Array.isArray(headOrChanges) ? headOrChanges : [headOrChanges, ...tail];\n\t\t\tif (changes.length > 0) {\n\t\t\t\tconst previousView = this.currentView;\n\t\t\t\tthis.transaction.applyChanges(changes.map((c) => this.tree.internalizeChange(c)));\n\t\t\t\tif (\n\t\t\t\t\tthis.listenerCount(TransactionEvent.ViewChange) > 0 &&\n\t\t\t\t\t!previousView.hasEqualForest(this.currentView)\n\t\t\t\t) {\n\t\t\t\t\tthis.emit(TransactionEvent.ViewChange, previousView, this.currentView);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn this.status;\n\t}\n\n\t/**\n\t * Close this transaction and apply its changes to the `SharedTree`. If this transaction is already closed, this method has no effect.\n\t */\n\tpublic closeAndCommit(): void {\n\t\tif (this.isOpen) {\n\t\t\tif (this.transaction.changes.length > 0) {\n\t\t\t\tconst result = this.transaction.close();\n\t\t\t\tconst edit: Edit<ChangeInternal> = { id: newEditId(), changes: result.changes };\n\t\t\t\tif (this.tree.edits instanceof CachingLogViewer) {\n\t\t\t\t\tthis.tree.edits.setKnownEditingResult(edit, result);\n\t\t\t\t}\n\t\t\t\tthis.tree.applyEditInternal(edit);\n\t\t\t}\n\t\t}\n\t}\n}\n"]}
package/lib/index.d.ts CHANGED
@@ -27,7 +27,7 @@ export * from './ReconciliationPath';
27
27
  export * from './MergeHealth';
28
28
  export * from './TreeViewUtilities';
29
29
  export { StringInterner } from './StringInterner';
30
- export { Side, EditStatus, TreeNode, TreeNodeSequence, Payload, ConstraintEffect, Edit, ChangeInternal, ChangeNode, ChangeNode_0_0_2, EditLogSummary, FluidEditHandle, SharedTreeSummaryBase, EditWithoutId, PlaceholderTree, EditBase, HasTraits, InsertInternal, DetachInternal, BuildInternal, SetValueInternal, ConstraintInternal, BuildNodeInternal, StablePlaceInternal_0_0_2, StableRangeInternal_0_0_2, NodeData, TraitMap, ChangeTypeInternal, TraitLocationInternal_0_0_2, WriteFormat, ConstraintInternal_0_0_2, StablePlaceInternal, StableRangeInternal, BuildNodeInternal_0_0_2, BuildInternal_0_0_2, InsertInternal_0_0_2, DetachInternal_0_0_2, SetValueInternal_0_0_2, TraitLocationInternal, } from './persisted-types';
30
+ export { Side, EditStatus, TreeNode, TreeNodeSequence, Payload, ConstraintEffect, Edit, ChangeInternal, InternalizedChange, ChangeNode, ChangeNode_0_0_2, EditLogSummary, FluidEditHandle, SharedTreeSummaryBase, EditWithoutId, PlaceholderTree, EditBase, HasTraits, InsertInternal, DetachInternal, BuildInternal, SetValueInternal, ConstraintInternal, BuildNodeInternal, StablePlaceInternal_0_0_2, StableRangeInternal_0_0_2, NodeData, TraitMap, ChangeTypeInternal, TraitLocationInternal_0_0_2, WriteFormat, ConstraintInternal_0_0_2, StablePlaceInternal, StableRangeInternal, BuildNodeInternal_0_0_2, BuildInternal_0_0_2, InsertInternal_0_0_2, DetachInternal_0_0_2, SetValueInternal_0_0_2, TraitLocationInternal, } from './persisted-types';
31
31
  export { SharedTreeFactory, SharedTree, EditCommittedHandler, SequencedEditAppliedHandler, EditCommittedEventArguments, SequencedEditAppliedEventArguments, EditApplicationOutcome, ISharedTreeEvents, } from './SharedTree';
32
32
  export * from './EventTypes';
33
33
  export { setTrait, areRevisionViewsSemanticallyEqual, BadPlaceValidationResult, BadRangeValidationResult, PlaceValidationResult, RangeValidationResult, RangeValidationResultKind, } from './EditUtilities';
@@ -36,7 +36,7 @@ export { TransactionInternal, GenericTransaction, GenericTransactionPolicy, Edit
36
36
  export { NodeInTrait, PlaceIndex, TreeViewNode, TreeView, TraitNodeIndex, TreeViewPlace, TreeViewRange, TraitLocation, } from './TreeView';
37
37
  export { RevisionView, TransactionView } from './RevisionView';
38
38
  export { NodeIdContext, NodeIdGenerator, NodeIdConverter } from './NodeIdUtilities';
39
- export { Transaction } from './Transaction';
39
+ export { Transaction, TransactionEvent, TransactionEvents } from './Transaction';
40
40
  /**
41
41
  * TODO:#61413: Publish test utilities from a separate test package
42
42
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AAEH;;;GAGG;AAIH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACjE,OAAO,EAAE,4BAA4B,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACnF,YAAY,EACX,YAAY,EACZ,UAAU,EACV,kBAAkB,EAClB,MAAM,EACN,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,MAAM,EACN,WAAW,EACX,YAAY,EACZ,wBAAwB,EACxB,aAAa,EACb,UAAU,EACV,UAAU,GACV,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,Y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C3B,OAAO,EACN,iBAAiB,EACjB,UAAU,EACV,oBAAoB,EACpB,2BAA2B,EAC3B,2BAA2B,EAC3B,kCAAkC,EAClC,sBAAsB,EACtB,iBAAiB,GACjB,MAAM,cAAc,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,OAAO,EACN,QAAQ,EACR,iCAAiC,EACjC,wBAAwB,EACxB,wBAAwB,EACxB,qBAAqB,EACrB,qBAAqB,EACrB,yBAAyB,GACzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EACN,mBAAmB,EACnB,kBAAkB,EAClB,wBAAwB,EACxB,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,0BAA0B,EAC1B,uBAAuB,EACvB,YAAY,GACZ,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACN,WAAW,EACX,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,cAAc,EACd,aAAa,EACb,aAAa,EACb,aAAa,GACb,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpF,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEjF;;GAEG;AACH,OAAO;AACN,wEAAwE;AACxE,sCAAsC,IAAI,4BAA4B,EACtE,sCAAsC,GACtC,MAAM,wBAAwB,CAAC;AAEhC,cAAc,eAAe,CAAC"}
package/lib/index.js CHANGED
@@ -31,7 +31,7 @@ export { comparePayloads } from './PayloadUtilities';
31
31
  export { TransactionInternal, GenericTransaction, } from './TransactionInternal';
32
32
  export { TreeView, } from './TreeView';
33
33
  export { RevisionView, TransactionView } from './RevisionView';
34
- export { Transaction } from './Transaction';
34
+ export { Transaction, TransactionEvent } from './Transaction';
35
35
  /**
36
36
  * TODO:#61413: Publish test utilities from a separate test package
37
37
  */
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AAEH;;;GAGG;AAEH,cAAc;AAEd,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAS,MAAM,EAA0B,MAAM,UAAU,CAAC;AACjE,OAAO,EAAE,4BAA4B,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAiBnF,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAIrD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAmB,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAC5F,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AAEpC,OAAO,EACN,IAAI,EACJ,UAAU,EAIV,gBAAgB,EAEhB,cAAc,EAoBd,kBAAkB,EAElB,WAAW,EAEX,mBAAmB,EACnB,mBAAmB,GAOnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACN,iBAAiB,EACjB,UAAU,GAOV,MAAM,cAAc,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,OAAO,EACN,QAAQ,EACR,iCAAiC,EAGjC,qBAAqB,EAErB,yBAAyB,GACzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EACN,mBAAmB,EACnB,kBAAkB,GAWlB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAIN,QAAQ,GAKR,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAE/D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;GAEG;AACH,OAAO;AACN,wEAAwE;AACxE,sCAAsC,IAAI,4BAA4B,EACtE,sCAAsC,GACtC,MAAM,wBAAwB,CAAC;AAEhC,cAAc,eAAe,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Fluid DDS storing a tree.\n *\n * @packageDocumentation\n */\n\n/**\n * This file represents the public API. Consumers of this package will not see exported modules unless they are enumerated here.\n * Removing / editing existing exports here will often indicate a breaking change, so please be cognizant of changes made here.\n */\n\n// API Exports\n\nexport { initialTree } from './InitialTree';\nexport { TreeNodeHandle } from './TreeNodeHandle';\nexport { Delta, Forest, ForestNode, ParentData } from './Forest';\nexport { sharedTreeAssertionErrorType, isSharedTreeEvent, Result } from './Common';\nexport type {\n\tCompressedId,\n\tDefinition,\n\tDetachedSequenceId,\n\tEditId,\n\tInternedStringId,\n\tFinalCompressedId,\n\tLocalCompressedId,\n\tNodeId,\n\tNodeIdBrand,\n\tStableNodeId,\n\tSessionSpaceCompressedId,\n\tSessionUnique,\n\tTraitLabel,\n\tUuidString,\n} from './Identifiers';\nexport { isDetachedSequenceId } from './Identifiers';\nexport type { OrderedEditSet, EditHandle } from './EditLog';\nexport { LogViewer } from './LogViewer';\nexport { Revision } from './RevisionValueCache';\nexport { Checkout, CheckoutEvent, ICheckoutEvents, EditValidationResult } from './Checkout';\nexport { LazyCheckout } from './LazyCheckout';\nexport { EagerCheckout } from './EagerCheckout';\nexport * from './ReconciliationPath';\nexport * from './MergeHealth';\nexport * from './TreeViewUtilities';\nexport { StringInterner } from './StringInterner';\nexport {\n\tSide,\n\tEditStatus,\n\tTreeNode,\n\tTreeNodeSequence,\n\tPayload,\n\tConstraintEffect,\n\tEdit,\n\tChangeInternal,\n\tChangeNode,\n\tChangeNode_0_0_2,\n\tEditLogSummary,\n\tFluidEditHandle,\n\tSharedTreeSummaryBase,\n\tEditWithoutId,\n\tPlaceholderTree,\n\tEditBase,\n\tHasTraits,\n\tInsertInternal,\n\tDetachInternal,\n\tBuildInternal,\n\tSetValueInternal,\n\tConstraintInternal,\n\tBuildNodeInternal,\n\tStablePlaceInternal_0_0_2,\n\tStableRangeInternal_0_0_2,\n\tNodeData,\n\tTraitMap,\n\tChangeTypeInternal,\n\tTraitLocationInternal_0_0_2,\n\tWriteFormat,\n\tConstraintInternal_0_0_2,\n\tStablePlaceInternal,\n\tStableRangeInternal,\n\tBuildNodeInternal_0_0_2,\n\tBuildInternal_0_0_2,\n\tInsertInternal_0_0_2,\n\tDetachInternal_0_0_2,\n\tSetValueInternal_0_0_2,\n\tTraitLocationInternal,\n} from './persisted-types';\nexport {\n\tSharedTreeFactory,\n\tSharedTree,\n\tEditCommittedHandler,\n\tSequencedEditAppliedHandler,\n\tEditCommittedEventArguments,\n\tSequencedEditAppliedEventArguments,\n\tEditApplicationOutcome,\n\tISharedTreeEvents,\n} from './SharedTree';\nexport * from './EventTypes';\nexport {\n\tsetTrait,\n\tareRevisionViewsSemanticallyEqual,\n\tBadPlaceValidationResult,\n\tBadRangeValidationResult,\n\tPlaceValidationResult,\n\tRangeValidationResult,\n\tRangeValidationResultKind,\n} from './EditUtilities';\nexport { comparePayloads } from './PayloadUtilities';\nexport {\n\tTransactionInternal,\n\tGenericTransaction,\n\tGenericTransactionPolicy,\n\tEditingResult,\n\tEditingResultBase,\n\tFailedEditingResult,\n\tValidEditingResult,\n\tTransactionState,\n\tTransactionFailure,\n\tSucceedingTransactionState,\n\tFailingTransactionState,\n\tChangeResult,\n} from './TransactionInternal';\nexport {\n\tNodeInTrait,\n\tPlaceIndex,\n\tTreeViewNode,\n\tTreeView,\n\tTraitNodeIndex,\n\tTreeViewPlace,\n\tTreeViewRange,\n\tTraitLocation,\n} from './TreeView';\nexport { RevisionView, TransactionView } from './RevisionView';\nexport { NodeIdContext, NodeIdGenerator, NodeIdConverter } from './NodeIdUtilities';\nexport { Transaction } from './Transaction';\n\n/**\n * TODO:#61413: Publish test utilities from a separate test package\n */\nexport {\n\t/** @deprecated Use `getSerializedUploadedEditChunkContents` instead. */\n\tgetSerializedUploadedEditChunkContents as getUploadedEditChunkContents,\n\tgetSerializedUploadedEditChunkContents,\n} from './SummaryTestUtilities';\n\nexport * from './ChangeTypes';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AAEH;;;GAGG;AAEH,cAAc;AAEd,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAS,MAAM,EAA0B,MAAM,UAAU,CAAC;AACjE,OAAO,EAAE,4BAA4B,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAiBnF,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAIrD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAmB,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAC5F,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AAEpC,OAAO,EACN,IAAI,EACJ,UAAU,EAIV,gBAAgB,EAEhB,cAAc,EAqBd,kBAAkB,EAElB,WAAW,EAEX,mBAAmB,EACnB,mBAAmB,GAOnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACN,iBAAiB,EACjB,UAAU,GAOV,MAAM,cAAc,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,OAAO,EACN,QAAQ,EACR,iCAAiC,EAGjC,qBAAqB,EAErB,yBAAyB,GACzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EACN,mBAAmB,EACnB,kBAAkB,GAWlB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAIN,QAAQ,GAKR,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAE/D,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAqB,MAAM,eAAe,CAAC;AAEjF;;GAEG;AACH,OAAO;AACN,wEAAwE;AACxE,sCAAsC,IAAI,4BAA4B,EACtE,sCAAsC,GACtC,MAAM,wBAAwB,CAAC;AAEhC,cAAc,eAAe,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Fluid DDS storing a tree.\n *\n * @packageDocumentation\n */\n\n/**\n * This file represents the public API. Consumers of this package will not see exported modules unless they are enumerated here.\n * Removing / editing existing exports here will often indicate a breaking change, so please be cognizant of changes made here.\n */\n\n// API Exports\n\nexport { initialTree } from './InitialTree';\nexport { TreeNodeHandle } from './TreeNodeHandle';\nexport { Delta, Forest, ForestNode, ParentData } from './Forest';\nexport { sharedTreeAssertionErrorType, isSharedTreeEvent, Result } from './Common';\nexport type {\n\tCompressedId,\n\tDefinition,\n\tDetachedSequenceId,\n\tEditId,\n\tInternedStringId,\n\tFinalCompressedId,\n\tLocalCompressedId,\n\tNodeId,\n\tNodeIdBrand,\n\tStableNodeId,\n\tSessionSpaceCompressedId,\n\tSessionUnique,\n\tTraitLabel,\n\tUuidString,\n} from './Identifiers';\nexport { isDetachedSequenceId } from './Identifiers';\nexport type { OrderedEditSet, EditHandle } from './EditLog';\nexport { LogViewer } from './LogViewer';\nexport { Revision } from './RevisionValueCache';\nexport { Checkout, CheckoutEvent, ICheckoutEvents, EditValidationResult } from './Checkout';\nexport { LazyCheckout } from './LazyCheckout';\nexport { EagerCheckout } from './EagerCheckout';\nexport * from './ReconciliationPath';\nexport * from './MergeHealth';\nexport * from './TreeViewUtilities';\nexport { StringInterner } from './StringInterner';\nexport {\n\tSide,\n\tEditStatus,\n\tTreeNode,\n\tTreeNodeSequence,\n\tPayload,\n\tConstraintEffect,\n\tEdit,\n\tChangeInternal,\n\tInternalizedChange,\n\tChangeNode,\n\tChangeNode_0_0_2,\n\tEditLogSummary,\n\tFluidEditHandle,\n\tSharedTreeSummaryBase,\n\tEditWithoutId,\n\tPlaceholderTree,\n\tEditBase,\n\tHasTraits,\n\tInsertInternal,\n\tDetachInternal,\n\tBuildInternal,\n\tSetValueInternal,\n\tConstraintInternal,\n\tBuildNodeInternal,\n\tStablePlaceInternal_0_0_2,\n\tStableRangeInternal_0_0_2,\n\tNodeData,\n\tTraitMap,\n\tChangeTypeInternal,\n\tTraitLocationInternal_0_0_2,\n\tWriteFormat,\n\tConstraintInternal_0_0_2,\n\tStablePlaceInternal,\n\tStableRangeInternal,\n\tBuildNodeInternal_0_0_2,\n\tBuildInternal_0_0_2,\n\tInsertInternal_0_0_2,\n\tDetachInternal_0_0_2,\n\tSetValueInternal_0_0_2,\n\tTraitLocationInternal,\n} from './persisted-types';\nexport {\n\tSharedTreeFactory,\n\tSharedTree,\n\tEditCommittedHandler,\n\tSequencedEditAppliedHandler,\n\tEditCommittedEventArguments,\n\tSequencedEditAppliedEventArguments,\n\tEditApplicationOutcome,\n\tISharedTreeEvents,\n} from './SharedTree';\nexport * from './EventTypes';\nexport {\n\tsetTrait,\n\tareRevisionViewsSemanticallyEqual,\n\tBadPlaceValidationResult,\n\tBadRangeValidationResult,\n\tPlaceValidationResult,\n\tRangeValidationResult,\n\tRangeValidationResultKind,\n} from './EditUtilities';\nexport { comparePayloads } from './PayloadUtilities';\nexport {\n\tTransactionInternal,\n\tGenericTransaction,\n\tGenericTransactionPolicy,\n\tEditingResult,\n\tEditingResultBase,\n\tFailedEditingResult,\n\tValidEditingResult,\n\tTransactionState,\n\tTransactionFailure,\n\tSucceedingTransactionState,\n\tFailingTransactionState,\n\tChangeResult,\n} from './TransactionInternal';\nexport {\n\tNodeInTrait,\n\tPlaceIndex,\n\tTreeViewNode,\n\tTreeView,\n\tTraitNodeIndex,\n\tTreeViewPlace,\n\tTreeViewRange,\n\tTraitLocation,\n} from './TreeView';\nexport { RevisionView, TransactionView } from './RevisionView';\nexport { NodeIdContext, NodeIdGenerator, NodeIdConverter } from './NodeIdUtilities';\nexport { Transaction, TransactionEvent, TransactionEvents } from './Transaction';\n\n/**\n * TODO:#61413: Publish test utilities from a separate test package\n */\nexport {\n\t/** @deprecated Use `getSerializedUploadedEditChunkContents` instead. */\n\tgetSerializedUploadedEditChunkContents as getUploadedEditChunkContents,\n\tgetSerializedUploadedEditChunkContents,\n} from './SummaryTestUtilities';\n\nexport * from './ChangeTypes';\n"]}
@@ -139,6 +139,15 @@ export interface CompressedBuildInternal<TId extends OpSpaceNodeId> {
139
139
  * A BuildNode that has been compressed into a {@link CompressedPlaceholderTree}.
140
140
  */
141
141
  export declare type CompressedBuildNode<TId extends OpSpaceNodeId> = CompressedPlaceholderTree<TId, DetachedSequenceId>;
142
+ /**
143
+ * This type should be used as an opaque handle in the public API for `ChangeInternal` objects.
144
+ * This is useful for supporting public APIs which involve working with a tree's edit history,
145
+ * which will involve changes that have already been internalized.
146
+ * @public
147
+ */
148
+ export interface InternalizedChange {
149
+ InternalChangeBrand: '2cae1045-61cf-4ef7-a6a3-8ad920cb7ab3';
150
+ }
142
151
  /**
143
152
  * {@inheritdoc (Change:type)}
144
153
  * @public
@@ -1 +1 @@
1
- {"version":3,"file":"0.1.1.d.ts","sourceRoot":"","sources":["../../src/persisted-types/0.1.1.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAA8B,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAEzE,OAAO,KAAK,EACX,eAAe,EACf,mCAAmC,E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mBAAmB,CAAC,OAAO,CAAC,KAAK,CAAC;KACvC,CAAC;CACF,CAAC;AA2BF,sFAAsF;AACtF,+BAA+B;AAC/B,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,CAAC;AAElC,2CAA2C;AAC3C,8BAA8B;AAC9B,MAAM,CAAC,MAAM,cAAc,GAAG,sCAAmD,CAAC;AAElF,+EAA+E;AAC/E,SAAS,SAAS,CAAM,IAAyB;;IAChD,aAAQ,IAAsB,CAAC,UAAU,mCAAK,IAAY,CAAC;AAC5D,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { assert, assertNotUndefined, ReplaceRecursive } from '../Common';\n// These are re-exported from a persisted-types file.\nimport type {\n\tIdCreationRange,\n\tSerializedIdCompressorWithNoSession,\n\tSerializedIdCompressorWithOngoingSession,\n} from '../id-compressor';\nimport type {\n\tDefinition,\n\tDetachedSequenceId,\n\tEditId,\n\tFinalNodeId,\n\tInternedStringId,\n\tNodeId,\n\tOpSpaceNodeId,\n\tSessionId,\n\tTraitLabel,\n\tUuidString,\n} from '../Identifiers';\nimport {\n\tBuildInternal_0_0_2,\n\tChangeTypeInternal,\n\tConstraintEffect,\n\tConstraintInternal_0_0_2,\n\tDetachInternal_0_0_2,\n\tEdit,\n\tEditWithoutId,\n\tInsertInternal_0_0_2,\n\tNodeData,\n\tPayload,\n\tSetValueInternal_0_0_2,\n\tSharedTreeNoOp,\n\tSharedTreeOpType,\n\tSharedTreeSummaryBase,\n\tSharedTreeUpdateOp,\n\tSide,\n\tStablePlaceInternal_0_0_2,\n\tTraitLocationInternal_0_0_2,\n\tTreeNode,\n\tTreeNodeSequence,\n\tVersionedOp,\n\tWriteFormat,\n} from './0.0.2';\n\n/**\n * Specifies the location of a trait (a labeled sequence of nodes) within the tree.\n * @public\n */\nexport interface TraitLocationInternal extends Omit<TraitLocationInternal_0_0_2, 'parent'> {\n\treadonly parent: NodeId;\n}\n\n/**\n * Alternating list of label then children list under that label.\n * The label may be interned, and children are {@link CompressedPlaceholderTree}.\n */\nexport type CompressedTraits<TId extends OpSpaceNodeId, TPlaceholder extends number | never> = (\n\t| InternedStringId\n\t| TraitLabel\n\t| (CompressedPlaceholderTree<TId, TPlaceholder> | TPlaceholder)[]\n)[];\n\n/**\n * A TreeNode that has been compressed into the following array format:\n * [identifier, definition, traits, payload],\n * where traits is also an array of [label, [trait], label, [trait], ...].\n * Payload is omitted if empty, and traits will be an empty subarray if no traits exist but a payload exists.\n * If both traits and payload does not exist, then both are omitted.\n * All trait labels and node definitions may also be string interned.\n * @internal\n */\nexport type CompressedPlaceholderTree<TId extends OpSpaceNodeId, TPlaceholder extends number | never> =\n\t| TPlaceholder\n\t| [InternedStringId | Definition] // The node Definition's interned string ID\n\t| [InternedStringId | Definition, TId]\n\t| [\n\t\t\tInternedStringId | Definition,\n\t\t\t[Payload, ...CompressedTraits<TId, TPlaceholder>] | CompressedTraits<TId, TPlaceholder>\n\t ]\n\t| [\n\t\t\tInternedStringId | Definition,\n\t\t\tTId,\n\t\t\t[Payload, ...CompressedTraits<TId, TPlaceholder>] | CompressedTraits<TId, TPlaceholder>\n\t ];\n\n/**\n * JSON-compatible Node type. Objects of this type will be persisted in internal change objects (under Edits) in the SharedTree history.\n * @public\n */\nexport type ChangeNode = TreeNode<ChangeNode, NodeId>;\n\n/**\n * A ChangeNode that has been compressed into a {@link CompressedPlaceholderTree}.\n */\nexport type CompressedChangeNode<TId extends OpSpaceNodeId> = CompressedPlaceholderTree<TId, never>;\n\n/**\n * The contents of a SharedTree summary for write format 0.1.1.\n * Contains the current tree in a compressed format,\n * the edits needed to get from `initialTree` to the current tree,\n * and the interned strings that can be used to retrieve the interned summary.\n */\nexport interface SharedTreeSummary extends SharedTreeSummaryBase {\n\treadonly version: WriteFormat.v0_1_1;\n\n\treadonly currentTree?: CompressedChangeNode<FinalNodeId>;\n\n\t/**\n\t * Information that can populate an edit log.\n\t */\n\treadonly editHistory: EditLogSummary<CompressedChangeInternal<FinalNodeId>, FluidEditHandle>;\n\n\t/**\n\t * List of interned strings.\n\t * In 0.1.1, definitions and trait labels are interned deterministically on sequenced ops,\n\t * and each client maintains a string interner whose lifetime is tied to the SharedTree.\n\t */\n\treadonly internedStrings: readonly string[];\n\n\t/**\n\t * Information about all IDs compressed in the summary\n\t */\n\treadonly idCompressor: SerializedIdCompressorWithNoSession | SerializedIdCompressorWithOngoingSession;\n}\n\n/**\n * Information used to populate an edit log.\n * In 0.1.1, this is a persisted type only for `EditLogSummary<CompressedChangeInternal, FluidEditHandle>`,\n * where calling `FluidEditHandle.get` returns an array buffer of compressed `editChunk` contents.\n * The type is parameterized to avoid nearly identical type definitions for uncompressed forms of the edit\n * log, and abstracting away the fact that handle fetching needs to invoke decompression.\n * @public\n */\nexport interface EditLogSummary<TChange, THandle> {\n\t/**\n\t * A of list of serialized chunks and their corresponding keys.\n\t * Start revision is the index of the first edit in the chunk in relation to the edit log.\n\t */\n\treadonly editChunks: readonly {\n\t\treadonly startRevision: number;\n\t\t/**\n\t\t * Either a chunk of edits or a handle that can be used to load that chunk.\n\t\t */\n\t\treadonly chunk: THandle | readonly EditWithoutId<TChange>[];\n\t}[];\n\n\t/**\n\t * A list of edits IDs for all sequenced edits.\n\t */\n\treadonly editIds: readonly EditId[];\n}\n\n/**\n * FluidEditHandles are used to load edit chunks stored outside of the EditLog.\n * Can be satisfied by IFluidHandle<ArrayBufferLike>.\n * Note that though this is in `PersistedTypes`, it isn't directly serializable (e.g. `get` is a function).\n * Its serialization relies on being encoded via an IFluidSerializer.\n * @public\n */\nexport interface FluidEditHandle {\n\treadonly get: () => Promise<ArrayBuffer>;\n\treadonly absolutePath: string;\n}\n\n// Future write formats should make this a union type and append to it (e.g. `EditChunkContents_0_1_1 | EditChunkContents_2_0_0`).\nexport type EditChunkContents = EditChunkContents_0_1_1;\n\nexport interface EditChunkContents_0_1_1 {\n\tversion: WriteFormat.v0_1_1;\n\tedits: readonly EditWithoutId<CompressedChangeInternal<FinalNodeId>>[];\n}\n\n/**\n * Edits per edit chunk. This value is in persisted types because it requires consensus to change.\n */\nexport const editsPerChunk = 100;\n\n/**\n * Compressed change format type.\n * Encodes the same information as a {@link ChangeInternal}, but uses a more compact object format for `build` changes.\n */\nexport type CompressedChangeInternal<TId extends OpSpaceNodeId> =\n\t| ReplaceRecursive<Exclude<ChangeInternal, BuildInternal>, NodeId, TId>\n\t| CompressedBuildInternal<TId>;\n\n/**\n * A compressed version of {@link BuildInternal} where the source is a sequence of compressed nodes.\n */\nexport interface CompressedBuildInternal<TId extends OpSpaceNodeId> {\n\t/** {@inheritdoc Build.destination } */\n\treadonly destination: DetachedSequenceId;\n\t/** A sequence of nodes to build in some compressed format. */\n\treadonly source: TreeNodeSequence<CompressedBuildNode<TId>>;\n\t/** {@inheritdoc Build.\"type\" } */\n\treadonly type: typeof ChangeTypeInternal.CompressedBuild;\n}\n\n/**\n * A BuildNode that has been compressed into a {@link CompressedPlaceholderTree}.\n */\nexport type CompressedBuildNode<TId extends OpSpaceNodeId> = CompressedPlaceholderTree<TId, DetachedSequenceId>;\n\n/**\n * {@inheritdoc (Change:type)}\n * @public\n */\nexport type ChangeInternal = InsertInternal | DetachInternal | BuildInternal | SetValueInternal | ConstraintInternal;\n\n/**\n * {@inheritdoc BuildNode}\n * @public\n */\nexport type BuildNodeInternal = TreeNode<BuildNodeInternal, NodeId> | DetachedSequenceId;\n\n/**\n * {@inheritdoc Build}\n * @public\n */\nexport interface BuildInternal extends Omit<BuildInternal_0_0_2, 'source'> {\n\treadonly source: TreeNodeSequence<BuildNodeInternal>;\n}\n\n/**\n * {@inheritdoc (Insert:interface)}\n * @public\n */\nexport interface InsertInternal extends Omit<InsertInternal_0_0_2, 'destination'> {\n\t/** {@inheritdoc (Insert:interface).destination } */\n\treadonly destination: StablePlaceInternal;\n}\n\n/**\n * {@inheritdoc Detach}\n * @public\n */\nexport interface DetachInternal extends Omit<DetachInternal_0_0_2, 'source'> {\n\t/** {@inheritdoc Detach.source } */\n\treadonly source: StableRangeInternal;\n}\n\n/**\n * {@inheritdoc SetValue}\n * @public\n */\nexport interface SetValueInternal extends Omit<SetValueInternal_0_0_2, 'nodeToModify'> {\n\t/** {@inheritdoc SetValue.nodeToModify } */\n\treadonly nodeToModify: NodeId;\n}\n\n/**\n * {@inheritdoc Constraint}\n * @public\n */\nexport interface ConstraintInternal extends Omit<ConstraintInternal_0_0_2, 'toConstrain' | 'parentNode'> {\n\t/** {@inheritdoc Constraint.toConstrain } */\n\treadonly toConstrain: StableRangeInternal;\n\t/** {@inheritdoc Constraint.parentNode } */\n\treadonly parentNode?: NodeId;\n}\n\n// Note: Documentation of this constant is merged with documentation of the `ChangeInternal` interface.\n/**\n * @public\n */\nexport const ChangeInternal = {\n\tbuild: (source: TreeNodeSequence<BuildNodeInternal>, destination: DetachedSequenceId): BuildInternal => ({\n\t\tdestination,\n\t\tsource,\n\t\ttype: ChangeTypeInternal.Build,\n\t}),\n\n\tinsert: (source: DetachedSequenceId, destination: StablePlaceInternal): InsertInternal => ({\n\t\tdestination,\n\t\tsource,\n\t\ttype: ChangeTypeInternal.Insert,\n\t}),\n\n\tdetach: (source: StableRangeInternal, destination?: DetachedSequenceId): DetachInternal => ({\n\t\tdestination,\n\t\tsource,\n\t\ttype: ChangeTypeInternal.Detach,\n\t}),\n\n\tsetPayload: (nodeToModify: NodeData<NodeId> | NodeId, payload: Payload): SetValueInternal => ({\n\t\tnodeToModify: getNodeId(nodeToModify),\n\t\tpayload,\n\t\ttype: ChangeTypeInternal.SetValue,\n\t}),\n\n\tclearPayload: (nodeToModify: NodeData<NodeId> | NodeId): SetValueInternal => ({\n\t\tnodeToModify: getNodeId(nodeToModify),\n\t\t// Rationale: 'undefined' is reserved for future use (see 'SetValue' interface above.)\n\t\tpayload: null,\n\t\ttype: ChangeTypeInternal.SetValue,\n\t}),\n\n\tconstraint: (\n\t\ttoConstrain: StableRangeInternal,\n\t\teffect: ConstraintEffect,\n\t\tidentityHash?: UuidString,\n\t\tlength?: number,\n\t\tcontentHash?: UuidString,\n\t\tparentNode?: NodeId,\n\t\tlabel?: TraitLabel\n\t): ConstraintInternal => ({\n\t\ttoConstrain,\n\t\teffect,\n\t\tidentityHash,\n\t\tlength,\n\t\tcontentHash,\n\t\tparentNode,\n\t\tlabel,\n\t\ttype: ChangeTypeInternal.Constraint,\n\t}),\n\n\t/** {@inheritdoc (Change:variable).delete } */\n\tdelete: (stableRange: StableRangeInternal): ChangeInternal => ChangeInternal.detach(stableRange),\n\n\t/** {@inheritdoc (Change:variable).insertTree } */\n\tinsertTree: (nodes: TreeNodeSequence<BuildNodeInternal>, destination: StablePlaceInternal): ChangeInternal[] => {\n\t\tconst build = ChangeInternal.build(nodes, 0 as DetachedSequenceId);\n\t\treturn [build, ChangeInternal.insert(build.destination, destination)];\n\t},\n\n\t/** {@inheritdoc (Change:variable).move } */\n\tmove: (source: StableRangeInternal, destination: StablePlaceInternal): ChangeInternal[] => {\n\t\tconst detach = ChangeInternal.detach(source, 0 as DetachedSequenceId);\n\t\treturn [detach, ChangeInternal.insert(assertNotUndefined(detach.destination), destination)];\n\t},\n};\n\n/**\n * {@inheritdoc (StablePlace:interface) }\n * @public\n */\nexport interface StablePlaceInternal extends Omit<StablePlaceInternal_0_0_2, 'referenceSibling' | 'referenceTrait'> {\n\t/**\n\t * {@inheritdoc (StablePlace:interface).referenceSibling }\n\t */\n\treadonly referenceSibling?: NodeId;\n\n\t/**\n\t * {@inheritdoc (StablePlace:interface).referenceTrait }\n\t */\n\treadonly referenceTrait?: TraitLocationInternal;\n}\n\n/**\n * {@inheritdoc (StableRange:interface) }\n * @public\n */\nexport interface StableRangeInternal {\n\t/** {@inheritdoc (StableRange:interface).start } */\n\treadonly start: StablePlaceInternal;\n\t/** {@inheritdoc (StableRange:interface).end } */\n\treadonly end: StablePlaceInternal;\n}\n\n/**\n * The remainder of this file consists of factory methods duplicated with those for StableRange/StablePlace and are maintained while\n * the new persisted version of SharedTree ops/summaries is rolled out.\n */\n\n/**\n * @public\n */\nexport const StablePlaceInternal = {\n\t/**\n\t * @returns The location directly before `node`.\n\t */\n\tbefore: (node: NodeData<NodeId> | NodeId): StablePlaceInternal => ({\n\t\tside: Side.Before,\n\t\treferenceSibling: getNodeId(node),\n\t}),\n\t/**\n\t * @returns The location directly after `node`.\n\t */\n\tafter: (node: NodeData<NodeId> | NodeId): StablePlaceInternal => ({\n\t\tside: Side.After,\n\t\treferenceSibling: getNodeId(node),\n\t}),\n\t/**\n\t * @returns The location at the start of `trait`.\n\t */\n\tatStartOf: (trait: TraitLocationInternal): StablePlaceInternal => ({\n\t\tside: Side.After,\n\t\treferenceTrait: trait,\n\t}),\n\t/**\n\t * @returns The location at the end of `trait`.\n\t */\n\tatEndOf: (trait: TraitLocationInternal): StablePlaceInternal => ({\n\t\tside: Side.Before,\n\t\treferenceTrait: trait,\n\t}),\n};\n\n/**\n * @public\n */\nexport const StableRangeInternal = {\n\t/**\n\t * Factory for producing a `StableRange` from a start `StablePlace` to an end `StablePlace`.\n\t * @example\n\t * StableRange.from(StablePlace.before(startNode)).to(StablePlace.after(endNode))\n\t */\n\tfrom: (start: StablePlaceInternal): { to: (end: StablePlaceInternal) => StableRangeInternal } => ({\n\t\tto: (end: StablePlaceInternal): StableRangeInternal => {\n\t\t\tif (start.referenceTrait && end.referenceTrait) {\n\t\t\t\tconst message = 'StableRange must be constructed with endpoints from the same trait';\n\t\t\t\tassert(start.referenceTrait.parent === end.referenceTrait.parent, message);\n\t\t\t\tassert(start.referenceTrait.label === end.referenceTrait.label, message);\n\t\t\t}\n\t\t\treturn { start, end };\n\t\t},\n\t}),\n\t/**\n\t * @returns a `StableRange` which contains only the provided `node`.\n\t * Both the start and end `StablePlace` objects used to anchor this `StableRange` are in terms of the passed in node.\n\t */\n\tonly: (node: NodeData<NodeId> | NodeId): StableRangeInternal => ({\n\t\tstart: StablePlaceInternal.before(node),\n\t\tend: StablePlaceInternal.after(node),\n\t}),\n\t/**\n\t * @returns a `StableRange` which contains everything in the trait.\n\t * This is anchored using the provided `trait`, and is independent of the actual contents of the trait:\n\t * it does not use sibling anchoring.\n\t */\n\tall: (trait: TraitLocationInternal): StableRangeInternal => ({\n\t\tstart: StablePlaceInternal.atStartOf(trait),\n\t\tend: StablePlaceInternal.atEndOf(trait),\n\t}),\n};\n\n/**\n * Discriminated union of valid 0.0.1 SharedTree op types.\n */\nexport type SharedTreeOp = SharedTreeEditOp | SharedTreeHandleOp | SharedTreeUpdateOp | SharedTreeNoOp;\n\nexport interface SharedTreeEditOp extends VersionedOp<WriteFormat.v0_1_1> {\n\treadonly type: SharedTreeOpType.Edit;\n\t/** The collection of changes to apply. */\n\treadonly edit: Edit<CompressedChangeInternal<OpSpaceNodeId>>;\n\t/** Contains all the IDs generated by the originating client since the last sent op */\n\treadonly idRange: IdCreationRange;\n}\n\n/**\n * A SharedTree op that includes edit handle information.\n * The handle corresponds to an edit chunk in the edit log.\n */\nexport interface SharedTreeHandleOp extends VersionedOp<WriteFormat.v0_1_1> {\n\treadonly type: SharedTreeOpType.Handle;\n\t/** The serialized handle to an uploaded edit chunk. */\n\treadonly editHandle: string;\n\t/** The index of the first edit in the chunk that corresponds to the handle. */\n\treadonly startRevision: number;\n}\n\n/** The number of IDs that a SharedTree reserves for current or future internal use */\n// This value must never change\nexport const reservedIdCount = 10;\n\n/** The SessionID of the Upgrade Session */\n// This UUID must never change\nexport const ghostSessionId = '79590933-1c70-4fda-817a-adab57c20318' as SessionId;\n\n/** Accepts either a node or a node's identifier, and returns the identifier */\nfunction getNodeId<TId>(node: TId | NodeData<TId>): TId {\n\treturn (node as NodeData<TId>).identifier ?? (node as TId);\n}\n"]}
1
+ {"version":3,"file":"0.1.1.js","sourceRoot":"","sources":["../../src/persisted-types/0.1.1.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAoB,MAAM,WAAW,CAAC;AAmBzE,OAAO,EAEN,kBAAkB,EAclB,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A+E;AAC/E,SAAS,SAAS,CAAM,IAAyB;;IAChD,aAAQ,IAAsB,CAAC,UAAU,mCAAK,IAAY,CAAC;AAC5D,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { assert, assertNotUndefined, ReplaceRecursive } from '../Common';\n// These are re-exported from a persisted-types file.\nimport type {\n\tIdCreationRange,\n\tSerializedIdCompressorWithNoSession,\n\tSerializedIdCompressorWithOngoingSession,\n} from '../id-compressor';\nimport type {\n\tDefinition,\n\tDetachedSequenceId,\n\tEditId,\n\tFinalNodeId,\n\tInternedStringId,\n\tNodeId,\n\tOpSpaceNodeId,\n\tSessionId,\n\tTraitLabel,\n\tUuidString,\n} from '../Identifiers';\nimport {\n\tBuildInternal_0_0_2,\n\tChangeTypeInternal,\n\tConstraintEffect,\n\tConstraintInternal_0_0_2,\n\tDetachInternal_0_0_2,\n\tEdit,\n\tEditWithoutId,\n\tInsertInternal_0_0_2,\n\tNodeData,\n\tPayload,\n\tSetValueInternal_0_0_2,\n\tSharedTreeNoOp,\n\tSharedTreeOpType,\n\tSharedTreeSummaryBase,\n\tSharedTreeUpdateOp,\n\tSide,\n\tStablePlaceInternal_0_0_2,\n\tTraitLocationInternal_0_0_2,\n\tTreeNode,\n\tTreeNodeSequence,\n\tVersionedOp,\n\tWriteFormat,\n} from './0.0.2';\n\n/**\n * Specifies the location of a trait (a labeled sequence of nodes) within the tree.\n * @public\n */\nexport interface TraitLocationInternal extends Omit<TraitLocationInternal_0_0_2, 'parent'> {\n\treadonly parent: NodeId;\n}\n\n/**\n * Alternating list of label then children list under that label.\n * The label may be interned, and children are {@link CompressedPlaceholderTree}.\n */\nexport type CompressedTraits<TId extends OpSpaceNodeId, TPlaceholder extends number | never> = (\n\t| InternedStringId\n\t| TraitLabel\n\t| (CompressedPlaceholderTree<TId, TPlaceholder> | TPlaceholder)[]\n)[];\n\n/**\n * A TreeNode that has been compressed into the following array format:\n * [identifier, definition, traits, payload],\n * where traits is also an array of [label, [trait], label, [trait], ...].\n * Payload is omitted if empty, and traits will be an empty subarray if no traits exist but a payload exists.\n * If both traits and payload does not exist, then both are omitted.\n * All trait labels and node definitions may also be string interned.\n * @internal\n */\nexport type CompressedPlaceholderTree<TId extends OpSpaceNodeId, TPlaceholder extends number | never> =\n\t| TPlaceholder\n\t| [InternedStringId | Definition] // The node Definition's interned string ID\n\t| [InternedStringId | Definition, TId]\n\t| [\n\t\t\tInternedStringId | Definition,\n\t\t\t[Payload, ...CompressedTraits<TId, TPlaceholder>] | CompressedTraits<TId, TPlaceholder>\n\t ]\n\t| [\n\t\t\tInternedStringId | Definition,\n\t\t\tTId,\n\t\t\t[Payload, ...CompressedTraits<TId, TPlaceholder>] | CompressedTraits<TId, TPlaceholder>\n\t ];\n\n/**\n * JSON-compatible Node type. Objects of this type will be persisted in internal change objects (under Edits) in the SharedTree history.\n * @public\n */\nexport type ChangeNode = TreeNode<ChangeNode, NodeId>;\n\n/**\n * A ChangeNode that has been compressed into a {@link CompressedPlaceholderTree}.\n */\nexport type CompressedChangeNode<TId extends OpSpaceNodeId> = CompressedPlaceholderTree<TId, never>;\n\n/**\n * The contents of a SharedTree summary for write format 0.1.1.\n * Contains the current tree in a compressed format,\n * the edits needed to get from `initialTree` to the current tree,\n * and the interned strings that can be used to retrieve the interned summary.\n */\nexport interface SharedTreeSummary extends SharedTreeSummaryBase {\n\treadonly version: WriteFormat.v0_1_1;\n\n\treadonly currentTree?: CompressedChangeNode<FinalNodeId>;\n\n\t/**\n\t * Information that can populate an edit log.\n\t */\n\treadonly editHistory: EditLogSummary<CompressedChangeInternal<FinalNodeId>, FluidEditHandle>;\n\n\t/**\n\t * List of interned strings.\n\t * In 0.1.1, definitions and trait labels are interned deterministically on sequenced ops,\n\t * and each client maintains a string interner whose lifetime is tied to the SharedTree.\n\t */\n\treadonly internedStrings: readonly string[];\n\n\t/**\n\t * Information about all IDs compressed in the summary\n\t */\n\treadonly idCompressor: SerializedIdCompressorWithNoSession | SerializedIdCompressorWithOngoingSession;\n}\n\n/**\n * Information used to populate an edit log.\n * In 0.1.1, this is a persisted type only for `EditLogSummary<CompressedChangeInternal, FluidEditHandle>`,\n * where calling `FluidEditHandle.get` returns an array buffer of compressed `editChunk` contents.\n * The type is parameterized to avoid nearly identical type definitions for uncompressed forms of the edit\n * log, and abstracting away the fact that handle fetching needs to invoke decompression.\n * @public\n */\nexport interface EditLogSummary<TChange, THandle> {\n\t/**\n\t * A of list of serialized chunks and their corresponding keys.\n\t * Start revision is the index of the first edit in the chunk in relation to the edit log.\n\t */\n\treadonly editChunks: readonly {\n\t\treadonly startRevision: number;\n\t\t/**\n\t\t * Either a chunk of edits or a handle that can be used to load that chunk.\n\t\t */\n\t\treadonly chunk: THandle | readonly EditWithoutId<TChange>[];\n\t}[];\n\n\t/**\n\t * A list of edits IDs for all sequenced edits.\n\t */\n\treadonly editIds: readonly EditId[];\n}\n\n/**\n * FluidEditHandles are used to load edit chunks stored outside of the EditLog.\n * Can be satisfied by IFluidHandle<ArrayBufferLike>.\n * Note that though this is in `PersistedTypes`, it isn't directly serializable (e.g. `get` is a function).\n * Its serialization relies on being encoded via an IFluidSerializer.\n * @public\n */\nexport interface FluidEditHandle {\n\treadonly get: () => Promise<ArrayBuffer>;\n\treadonly absolutePath: string;\n}\n\n// Future write formats should make this a union type and append to it (e.g. `EditChunkContents_0_1_1 | EditChunkContents_2_0_0`).\nexport type EditChunkContents = EditChunkContents_0_1_1;\n\nexport interface EditChunkContents_0_1_1 {\n\tversion: WriteFormat.v0_1_1;\n\tedits: readonly EditWithoutId<CompressedChangeInternal<FinalNodeId>>[];\n}\n\n/**\n * Edits per edit chunk. This value is in persisted types because it requires consensus to change.\n */\nexport const editsPerChunk = 100;\n\n/**\n * Compressed change format type.\n * Encodes the same information as a {@link ChangeInternal}, but uses a more compact object format for `build` changes.\n */\nexport type CompressedChangeInternal<TId extends OpSpaceNodeId> =\n\t| ReplaceRecursive<Exclude<ChangeInternal, BuildInternal>, NodeId, TId>\n\t| CompressedBuildInternal<TId>;\n\n/**\n * A compressed version of {@link BuildInternal} where the source is a sequence of compressed nodes.\n */\nexport interface CompressedBuildInternal<TId extends OpSpaceNodeId> {\n\t/** {@inheritdoc Build.destination } */\n\treadonly destination: DetachedSequenceId;\n\t/** A sequence of nodes to build in some compressed format. */\n\treadonly source: TreeNodeSequence<CompressedBuildNode<TId>>;\n\t/** {@inheritdoc Build.\"type\" } */\n\treadonly type: typeof ChangeTypeInternal.CompressedBuild;\n}\n\n/**\n * A BuildNode that has been compressed into a {@link CompressedPlaceholderTree}.\n */\nexport type CompressedBuildNode<TId extends OpSpaceNodeId> = CompressedPlaceholderTree<TId, DetachedSequenceId>;\n\n// TODO: `ChangeInternal`s should be assignable to this type without casting; this will require some test refactoring.\n/**\n * This type should be used as an opaque handle in the public API for `ChangeInternal` objects.\n * This is useful for supporting public APIs which involve working with a tree's edit history,\n * which will involve changes that have already been internalized.\n * @public\n */\nexport interface InternalizedChange {\n\tInternalChangeBrand: '2cae1045-61cf-4ef7-a6a3-8ad920cb7ab3';\n}\n\n/**\n * {@inheritdoc (Change:type)}\n * @public\n */\nexport type ChangeInternal = InsertInternal | DetachInternal | BuildInternal | SetValueInternal | ConstraintInternal;\n\n/**\n * {@inheritdoc BuildNode}\n * @public\n */\nexport type BuildNodeInternal = TreeNode<BuildNodeInternal, NodeId> | DetachedSequenceId;\n\n/**\n * {@inheritdoc Build}\n * @public\n */\nexport interface BuildInternal extends Omit<BuildInternal_0_0_2, 'source'> {\n\treadonly source: TreeNodeSequence<BuildNodeInternal>;\n}\n\n/**\n * {@inheritdoc (Insert:interface)}\n * @public\n */\nexport interface InsertInternal extends Omit<InsertInternal_0_0_2, 'destination'> {\n\t/** {@inheritdoc (Insert:interface).destination } */\n\treadonly destination: StablePlaceInternal;\n}\n\n/**\n * {@inheritdoc Detach}\n * @public\n */\nexport interface DetachInternal extends Omit<DetachInternal_0_0_2, 'source'> {\n\t/** {@inheritdoc Detach.source } */\n\treadonly source: StableRangeInternal;\n}\n\n/**\n * {@inheritdoc SetValue}\n * @public\n */\nexport interface SetValueInternal extends Omit<SetValueInternal_0_0_2, 'nodeToModify'> {\n\t/** {@inheritdoc SetValue.nodeToModify } */\n\treadonly nodeToModify: NodeId;\n}\n\n/**\n * {@inheritdoc Constraint}\n * @public\n */\nexport interface ConstraintInternal extends Omit<ConstraintInternal_0_0_2, 'toConstrain' | 'parentNode'> {\n\t/** {@inheritdoc Constraint.toConstrain } */\n\treadonly toConstrain: StableRangeInternal;\n\t/** {@inheritdoc Constraint.parentNode } */\n\treadonly parentNode?: NodeId;\n}\n\n// Note: Documentation of this constant is merged with documentation of the `ChangeInternal` interface.\n/**\n * @public\n */\nexport const ChangeInternal = {\n\tbuild: (source: TreeNodeSequence<BuildNodeInternal>, destination: DetachedSequenceId): BuildInternal => ({\n\t\tdestination,\n\t\tsource,\n\t\ttype: ChangeTypeInternal.Build,\n\t}),\n\n\tinsert: (source: DetachedSequenceId, destination: StablePlaceInternal): InsertInternal => ({\n\t\tdestination,\n\t\tsource,\n\t\ttype: ChangeTypeInternal.Insert,\n\t}),\n\n\tdetach: (source: StableRangeInternal, destination?: DetachedSequenceId): DetachInternal => ({\n\t\tdestination,\n\t\tsource,\n\t\ttype: ChangeTypeInternal.Detach,\n\t}),\n\n\tsetPayload: (nodeToModify: NodeData<NodeId> | NodeId, payload: Payload): SetValueInternal => ({\n\t\tnodeToModify: getNodeId(nodeToModify),\n\t\tpayload,\n\t\ttype: ChangeTypeInternal.SetValue,\n\t}),\n\n\tclearPayload: (nodeToModify: NodeData<NodeId> | NodeId): SetValueInternal => ({\n\t\tnodeToModify: getNodeId(nodeToModify),\n\t\t// Rationale: 'undefined' is reserved for future use (see 'SetValue' interface above.)\n\t\tpayload: null,\n\t\ttype: ChangeTypeInternal.SetValue,\n\t}),\n\n\tconstraint: (\n\t\ttoConstrain: StableRangeInternal,\n\t\teffect: ConstraintEffect,\n\t\tidentityHash?: UuidString,\n\t\tlength?: number,\n\t\tcontentHash?: UuidString,\n\t\tparentNode?: NodeId,\n\t\tlabel?: TraitLabel\n\t): ConstraintInternal => ({\n\t\ttoConstrain,\n\t\teffect,\n\t\tidentityHash,\n\t\tlength,\n\t\tcontentHash,\n\t\tparentNode,\n\t\tlabel,\n\t\ttype: ChangeTypeInternal.Constraint,\n\t}),\n\n\t/** {@inheritdoc (Change:variable).delete } */\n\tdelete: (stableRange: StableRangeInternal): ChangeInternal => ChangeInternal.detach(stableRange),\n\n\t/** {@inheritdoc (Change:variable).insertTree } */\n\tinsertTree: (nodes: TreeNodeSequence<BuildNodeInternal>, destination: StablePlaceInternal): ChangeInternal[] => {\n\t\tconst build = ChangeInternal.build(nodes, 0 as DetachedSequenceId);\n\t\treturn [build, ChangeInternal.insert(build.destination, destination)];\n\t},\n\n\t/** {@inheritdoc (Change:variable).move } */\n\tmove: (source: StableRangeInternal, destination: StablePlaceInternal): ChangeInternal[] => {\n\t\tconst detach = ChangeInternal.detach(source, 0 as DetachedSequenceId);\n\t\treturn [detach, ChangeInternal.insert(assertNotUndefined(detach.destination), destination)];\n\t},\n};\n\n/**\n * {@inheritdoc (StablePlace:interface) }\n * @public\n */\nexport interface StablePlaceInternal extends Omit<StablePlaceInternal_0_0_2, 'referenceSibling' | 'referenceTrait'> {\n\t/**\n\t * {@inheritdoc (StablePlace:interface).referenceSibling }\n\t */\n\treadonly referenceSibling?: NodeId;\n\n\t/**\n\t * {@inheritdoc (StablePlace:interface).referenceTrait }\n\t */\n\treadonly referenceTrait?: TraitLocationInternal;\n}\n\n/**\n * {@inheritdoc (StableRange:interface) }\n * @public\n */\nexport interface StableRangeInternal {\n\t/** {@inheritdoc (StableRange:interface).start } */\n\treadonly start: StablePlaceInternal;\n\t/** {@inheritdoc (StableRange:interface).end } */\n\treadonly end: StablePlaceInternal;\n}\n\n/**\n * The remainder of this file consists of factory methods duplicated with those for StableRange/StablePlace and are maintained while\n * the new persisted version of SharedTree ops/summaries is rolled out.\n */\n\n/**\n * @public\n */\nexport const StablePlaceInternal = {\n\t/**\n\t * @returns The location directly before `node`.\n\t */\n\tbefore: (node: NodeData<NodeId> | NodeId): StablePlaceInternal => ({\n\t\tside: Side.Before,\n\t\treferenceSibling: getNodeId(node),\n\t}),\n\t/**\n\t * @returns The location directly after `node`.\n\t */\n\tafter: (node: NodeData<NodeId> | NodeId): StablePlaceInternal => ({\n\t\tside: Side.After,\n\t\treferenceSibling: getNodeId(node),\n\t}),\n\t/**\n\t * @returns The location at the start of `trait`.\n\t */\n\tatStartOf: (trait: TraitLocationInternal): StablePlaceInternal => ({\n\t\tside: Side.After,\n\t\treferenceTrait: trait,\n\t}),\n\t/**\n\t * @returns The location at the end of `trait`.\n\t */\n\tatEndOf: (trait: TraitLocationInternal): StablePlaceInternal => ({\n\t\tside: Side.Before,\n\t\treferenceTrait: trait,\n\t}),\n};\n\n/**\n * @public\n */\nexport const StableRangeInternal = {\n\t/**\n\t * Factory for producing a `StableRange` from a start `StablePlace` to an end `StablePlace`.\n\t * @example\n\t * StableRange.from(StablePlace.before(startNode)).to(StablePlace.after(endNode))\n\t */\n\tfrom: (start: StablePlaceInternal): { to: (end: StablePlaceInternal) => StableRangeInternal } => ({\n\t\tto: (end: StablePlaceInternal): StableRangeInternal => {\n\t\t\tif (start.referenceTrait && end.referenceTrait) {\n\t\t\t\tconst message = 'StableRange must be constructed with endpoints from the same trait';\n\t\t\t\tassert(start.referenceTrait.parent === end.referenceTrait.parent, message);\n\t\t\t\tassert(start.referenceTrait.label === end.referenceTrait.label, message);\n\t\t\t}\n\t\t\treturn { start, end };\n\t\t},\n\t}),\n\t/**\n\t * @returns a `StableRange` which contains only the provided `node`.\n\t * Both the start and end `StablePlace` objects used to anchor this `StableRange` are in terms of the passed in node.\n\t */\n\tonly: (node: NodeData<NodeId> | NodeId): StableRangeInternal => ({\n\t\tstart: StablePlaceInternal.before(node),\n\t\tend: StablePlaceInternal.after(node),\n\t}),\n\t/**\n\t * @returns a `StableRange` which contains everything in the trait.\n\t * This is anchored using the provided `trait`, and is independent of the actual contents of the trait:\n\t * it does not use sibling anchoring.\n\t */\n\tall: (trait: TraitLocationInternal): StableRangeInternal => ({\n\t\tstart: StablePlaceInternal.atStartOf(trait),\n\t\tend: StablePlaceInternal.atEndOf(trait),\n\t}),\n};\n\n/**\n * Discriminated union of valid 0.0.1 SharedTree op types.\n */\nexport type SharedTreeOp = SharedTreeEditOp | SharedTreeHandleOp | SharedTreeUpdateOp | SharedTreeNoOp;\n\nexport interface SharedTreeEditOp extends VersionedOp<WriteFormat.v0_1_1> {\n\treadonly type: SharedTreeOpType.Edit;\n\t/** The collection of changes to apply. */\n\treadonly edit: Edit<CompressedChangeInternal<OpSpaceNodeId>>;\n\t/** Contains all the IDs generated by the originating client since the last sent op */\n\treadonly idRange: IdCreationRange;\n}\n\n/**\n * A SharedTree op that includes edit handle information.\n * The handle corresponds to an edit chunk in the edit log.\n */\nexport interface SharedTreeHandleOp extends VersionedOp<WriteFormat.v0_1_1> {\n\treadonly type: SharedTreeOpType.Handle;\n\t/** The serialized handle to an uploaded edit chunk. */\n\treadonly editHandle: string;\n\t/** The index of the first edit in the chunk that corresponds to the handle. */\n\treadonly startRevision: number;\n}\n\n/** The number of IDs that a SharedTree reserves for current or future internal use */\n// This value must never change\nexport const reservedIdCount = 10;\n\n/** The SessionID of the Upgrade Session */\n// This UUID must never change\nexport const ghostSessionId = '79590933-1c70-4fda-817a-adab57c20318' as SessionId;\n\n/** Accepts either a node or a node's identifier, and returns the identifier */\nfunction getNodeId<TId>(node: TId | NodeData<TId>): TId {\n\treturn (node as NodeData<TId>).identifier ?? (node as TId);\n}\n"]}
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { benchmark, BenchmarkType } from '@fluid-tools/benchmark';
5
+ import { benchmark, BenchmarkType, isInPerformanceTestingMode } from '@fluid-tools/benchmark';
6
6
  import { v4 } from 'uuid';
7
7
  import { assert } from '../Common';
8
8
  import { Forest } from '../Forest';
@@ -11,7 +11,9 @@ import { Side } from '../persisted-types';
11
11
  import { refreshTestTree } from './utilities/TestUtilities';
12
12
  describe('Forest Perf', () => {
13
13
  const testTree = refreshTestTree();
14
- for (const count of [100, 1000, 10000, 100000]) {
14
+ // Larger sizes can slow down correctness test runs, or even time out, so only run smaller sizes as correctness tests.
15
+ const sizes = isInPerformanceTestingMode ? [100, 1000, 10000, 100000] : [100, 1000];
16
+ for (const count of sizes) {
15
17
  // Pick a single representative size for the 'Measurement' suite to keep it small.
16
18
  const type = count === 10000 ? BenchmarkType.Measurement : BenchmarkType.Perspective;
17
19
  benchmark({
@@ -60,7 +62,7 @@ describe('Forest Perf', () => {
60
62
  },
61
63
  });
62
64
  let otherForest;
63
- for (const otherCount of [100, 1000, 10000, 100000]) {
65
+ for (const otherCount of sizes) {
64
66
  benchmark({
65
67
  type,
66
68
  title: `invoke delta on Forest with ${count} nodes against Forest with ${otherCount} nodes`,
@@ -1 +1 @@
1
- {"version":3,"file":"Forest.perf.tests.js","sourceRoot":"","sources":["../../src/test/Forest.perf.tests.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,OAAO,EAAE,MAAM,EAAc,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAc,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAGtD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE5D,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC5B,MAAM,QAAQ,GAAG,eAAe,EAAE,CAAC;IAEnC,KAAK,MAAM,KAA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G,GAAe,EAAE,EAAgB,CAAC;QAC3C,MAAM,EAAE,GAAG,KAAK,EAAE,CAAC;QAEnB,MAAM,OAAO,GAAiB;YAC7B,UAAU,EAAE,EAAE;YACd,UAAU,EAAE,GAAG;YACf,MAAM,EAAE,IAAI,GAAG,EAAiC;SAChD,CAAC;QAEF,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;QAC1B,MAAM,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;QAC3D,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;QACzE,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;KACb;IACD,OAAO,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,MAAM,CAAC,CAAC;AAC5B,CAAC;AAED,SAAS,kBAAkB,CAAC,QAAkB;IAC7C,uCAAY,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,CAAC,KAAE,MAAM,EAAE,IAAI,GAAG,EAAE,IAAG;AAChF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { benchmark, BenchmarkType } from '@fluid-tools/benchmark';\nimport { v4 } from 'uuid';\n\nimport { assert } from '../Common';\nimport { Definition, NodeId, TraitLabel } from '../Identifiers';\nimport { Forest, ForestNode } from '../Forest';\nimport { RevisionView } from '../RevisionView';\nimport { ChangeNode, Side } from '../persisted-types';\nimport { TreeViewNode } from '../TreeView';\nimport { TestTree } from './utilities/TestNode';\nimport { refreshTestTree } from './utilities/TestUtilities';\n\ndescribe('Forest Perf', () => {\n\tconst testTree = refreshTestTree();\n\n\tfor (const count of [100, 1_000, 10_000, 100_000]) {\n\t\t// Pick a single representative size for the 'Measurement' suite to keep it small.\n\t\tconst type = count === 10_000 ? BenchmarkType.Measurement : BenchmarkType.Perspective;\n\n\t\tbenchmark({\n\t\t\ttype,\n\t\t\ttitle: `${count} random inserts in TreeView`,\n\t\t\tbenchmarkFn: () => {\n\t\t\t\tbuildRandomTree(testTree, count);\n\t\t\t},\n\t\t});\n\n\t\tlet built: RevisionView | undefined;\n\t\tlet rootId: NodeId | undefined;\n\t\tbenchmark({\n\t\t\ttype,\n\t\t\ttitle: `walk ${count} node TreeView`,\n\t\t\tbefore: () => {\n\t\t\t\t[built, rootId] = buildRandomTree(testTree, count);\n\t\t\t},\n\t\t\tbenchmarkFn: () => {\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\tconst nodes = walk(built!, rootId!);\n\t\t\t\tassert(nodes === count);\n\t\t\t},\n\t\t\tafter: () => {\n\t\t\t\tbuilt = undefined;\n\t\t\t\trootId = undefined;\n\t\t\t},\n\t\t});\n\n\t\tlet forest: Forest | undefined;\n\t\tlet nodes: ForestNode[];\n\t\tbenchmark({\n\t\t\ttype,\n\t\t\ttitle: `insert ${count} nodes into Forest`,\n\t\t\tbefore: () => {\n\t\t\t\tforest = Forest.create(true);\n\t\t\t\tnodes = [];\n\t\t\t\tfor (let i = 0; i < count; i++) {\n\t\t\t\t\tnodes.push(makeTestForestNode(testTree));\n\t\t\t\t}\n\t\t\t},\n\t\t\tbenchmarkFn: () => {\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\tforest!.add(nodes);\n\t\t\t},\n\t\t\tafter: () => {\n\t\t\t\tforest = undefined;\n\t\t\t},\n\t\t});\n\n\t\tlet otherForest: Forest | undefined;\n\t\tfor (const otherCount of [100, 1_000, 10_000, 100_000]) {\n\t\t\tbenchmark({\n\t\t\t\ttype,\n\t\t\t\ttitle: `invoke delta on Forest with ${count} nodes against Forest with ${otherCount} nodes`,\n\t\t\t\tbefore: () => {\n\t\t\t\t\tforest = Forest.create(true);\n\t\t\t\t\totherForest = Forest.create(true);\n\t\t\t\t\tnodes = [];\n\t\t\t\t\tfor (let i = 0; i < count; i++) {\n\t\t\t\t\t\tnodes.push(makeTestForestNode(testTree));\n\t\t\t\t\t}\n\t\t\t\t\tforest = forest.add(nodes);\n\n\t\t\t\t\tconst otherNodes: ForestNode[] = [];\n\t\t\t\t\tfor (let i = 0; i < otherCount; i++) {\n\t\t\t\t\t\totherNodes.push(makeTestForestNode(testTree));\n\t\t\t\t\t}\n\t\t\t\t\totherForest = otherForest.add(otherNodes);\n\t\t\t\t},\n\t\t\t\tbenchmarkFn: () => {\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\t\tforest!.delta(otherForest!);\n\t\t\t\t},\n\t\t\t\tafter: () => {\n\t\t\t\t\tforest = undefined;\n\t\t\t\t\totherForest = undefined;\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n});\n\nfunction walk(s: RevisionView, id: NodeId): number {\n\tlet count = 1;\n\tconst n = s.getViewNode(id);\n\tfor (const [_label, v] of n.traits.entries()) {\n\t\tfor (const child of v) {\n\t\t\tcount += walk(s, child);\n\t\t}\n\t}\n\treturn count;\n}\n\nfunction buildRandomTree(testTree: TestTree, size: number): [RevisionView, NodeId] {\n\tfunction getId(): NodeId {\n\t\treturn testTree.generateNodeId();\n\t}\n\n\tfunction getLabel(): TraitLabel {\n\t\treturn v4() as TraitLabel;\n\t}\n\n\tconst rootId = getId();\n\tconst root: ChangeNode = { traits: {}, definition: v4() as Definition, identifier: rootId };\n\tconst ids = [rootId];\n\tlet f = RevisionView.fromTree(root).openForTransaction();\n\n\tfor (let i = 1; i < size; i++) {\n\t\tconst label = getLabel();\n\t\tconst def: Definition = v4() as Definition;\n\t\tconst id = getId();\n\n\t\tconst newNode: TreeViewNode = {\n\t\t\tidentifier: id,\n\t\t\tdefinition: def,\n\t\t\ttraits: new Map<TraitLabel, readonly NodeId[]>(),\n\t\t};\n\n\t\tf = f.addNodes([newNode]);\n\t\tconst parent = ids[Math.floor(Math.random() * ids.length)];\n\t\tf = f.attachRange([id], { trait: { parent, label }, side: Side.Before });\n\t\tids.push(id);\n\t}\n\treturn [f.close(), rootId];\n}\n\nfunction makeTestForestNode(testTree: TestTree): ForestNode {\n\treturn { ...testTree.buildLeaf(testTree.generateNodeId()), traits: new Map() };\n}\n"]}
1
+ {"version":3,"file":"Forest.perf.tests.js","sourceRoot":"","sources":["../../src/test/Forest.perf.tests.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAC9F,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,OAAO,EAAE,MAAM,EAAc,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAc,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAGtD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE5D,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC5B,MAAM,QAAQ,GAAG,eAAe,EAAE,CAAC;IACnC,sHAAsH;IACtH,MAAM,KAAK,GAAG,0BAA0B,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,IAAK,EAAE,KAAM,EAAE,MAAO,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,IAAK,CAAC,CAAC;IAExF,KAAK,MAAM,KAAK,IAAI,KAAK,EAAE;QAC1B,kFAAkF;QAClF,MAAM,IAAI,GAAG,KAAK,KAAK,KAAM,CAAC,CAAC,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,aAAa,CAAC,WAAW,CAAC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CAAC,CAAC,CAAC;QAC1B,MAAM,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;QAC3D,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;QACzE,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;KACb;IACD,OAAO,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,MAAM,CAAC,CAAC;AAC5B,CAAC;AAED,SAAS,kBAAkB,CAAC,QAAkB;IAC7C,uCAAY,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,CAAC,KAAE,MAAM,EAAE,IAAI,GAAG,EAAE,IAAG;AAChF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { benchmark, BenchmarkType, isInPerformanceTestingMode } from '@fluid-tools/benchmark';\nimport { v4 } from 'uuid';\n\nimport { assert } from '../Common';\nimport { Definition, NodeId, TraitLabel } from '../Identifiers';\nimport { Forest, ForestNode } from '../Forest';\nimport { RevisionView } from '../RevisionView';\nimport { ChangeNode, Side } from '../persisted-types';\nimport { TreeViewNode } from '../TreeView';\nimport { TestTree } from './utilities/TestNode';\nimport { refreshTestTree } from './utilities/TestUtilities';\n\ndescribe('Forest Perf', () => {\n\tconst testTree = refreshTestTree();\n\t// Larger sizes can slow down correctness test runs, or even time out, so only run smaller sizes as correctness tests.\n\tconst sizes = isInPerformanceTestingMode ? [100, 1_000, 10_000, 100_000] : [100, 1_000];\n\n\tfor (const count of sizes) {\n\t\t// Pick a single representative size for the 'Measurement' suite to keep it small.\n\t\tconst type = count === 10_000 ? BenchmarkType.Measurement : BenchmarkType.Perspective;\n\n\t\tbenchmark({\n\t\t\ttype,\n\t\t\ttitle: `${count} random inserts in TreeView`,\n\t\t\tbenchmarkFn: () => {\n\t\t\t\tbuildRandomTree(testTree, count);\n\t\t\t},\n\t\t});\n\n\t\tlet built: RevisionView | undefined;\n\t\tlet rootId: NodeId | undefined;\n\t\tbenchmark({\n\t\t\ttype,\n\t\t\ttitle: `walk ${count} node TreeView`,\n\t\t\tbefore: () => {\n\t\t\t\t[built, rootId] = buildRandomTree(testTree, count);\n\t\t\t},\n\t\t\tbenchmarkFn: () => {\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\tconst nodes = walk(built!, rootId!);\n\t\t\t\tassert(nodes === count);\n\t\t\t},\n\t\t\tafter: () => {\n\t\t\t\tbuilt = undefined;\n\t\t\t\trootId = undefined;\n\t\t\t},\n\t\t});\n\n\t\tlet forest: Forest | undefined;\n\t\tlet nodes: ForestNode[];\n\t\tbenchmark({\n\t\t\ttype,\n\t\t\ttitle: `insert ${count} nodes into Forest`,\n\t\t\tbefore: () => {\n\t\t\t\tforest = Forest.create(true);\n\t\t\t\tnodes = [];\n\t\t\t\tfor (let i = 0; i < count; i++) {\n\t\t\t\t\tnodes.push(makeTestForestNode(testTree));\n\t\t\t\t}\n\t\t\t},\n\t\t\tbenchmarkFn: () => {\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\tforest!.add(nodes);\n\t\t\t},\n\t\t\tafter: () => {\n\t\t\t\tforest = undefined;\n\t\t\t},\n\t\t});\n\n\t\tlet otherForest: Forest | undefined;\n\t\tfor (const otherCount of sizes) {\n\t\t\tbenchmark({\n\t\t\t\ttype,\n\t\t\t\ttitle: `invoke delta on Forest with ${count} nodes against Forest with ${otherCount} nodes`,\n\t\t\t\tbefore: () => {\n\t\t\t\t\tforest = Forest.create(true);\n\t\t\t\t\totherForest = Forest.create(true);\n\t\t\t\t\tnodes = [];\n\t\t\t\t\tfor (let i = 0; i < count; i++) {\n\t\t\t\t\t\tnodes.push(makeTestForestNode(testTree));\n\t\t\t\t\t}\n\t\t\t\t\tforest = forest.add(nodes);\n\n\t\t\t\t\tconst otherNodes: ForestNode[] = [];\n\t\t\t\t\tfor (let i = 0; i < otherCount; i++) {\n\t\t\t\t\t\totherNodes.push(makeTestForestNode(testTree));\n\t\t\t\t\t}\n\t\t\t\t\totherForest = otherForest.add(otherNodes);\n\t\t\t\t},\n\t\t\t\tbenchmarkFn: () => {\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\t\tforest!.delta(otherForest!);\n\t\t\t\t},\n\t\t\t\tafter: () => {\n\t\t\t\t\tforest = undefined;\n\t\t\t\t\totherForest = undefined;\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n});\n\nfunction walk(s: RevisionView, id: NodeId): number {\n\tlet count = 1;\n\tconst n = s.getViewNode(id);\n\tfor (const [_label, v] of n.traits.entries()) {\n\t\tfor (const child of v) {\n\t\t\tcount += walk(s, child);\n\t\t}\n\t}\n\treturn count;\n}\n\nfunction buildRandomTree(testTree: TestTree, size: number): [RevisionView, NodeId] {\n\tfunction getId(): NodeId {\n\t\treturn testTree.generateNodeId();\n\t}\n\n\tfunction getLabel(): TraitLabel {\n\t\treturn v4() as TraitLabel;\n\t}\n\n\tconst rootId = getId();\n\tconst root: ChangeNode = { traits: {}, definition: v4() as Definition, identifier: rootId };\n\tconst ids = [rootId];\n\tlet f = RevisionView.fromTree(root).openForTransaction();\n\n\tfor (let i = 1; i < size; i++) {\n\t\tconst label = getLabel();\n\t\tconst def: Definition = v4() as Definition;\n\t\tconst id = getId();\n\n\t\tconst newNode: TreeViewNode = {\n\t\t\tidentifier: id,\n\t\t\tdefinition: def,\n\t\t\ttraits: new Map<TraitLabel, readonly NodeId[]>(),\n\t\t};\n\n\t\tf = f.addNodes([newNode]);\n\t\tconst parent = ids[Math.floor(Math.random() * ids.length)];\n\t\tf = f.attachRange([id], { trait: { parent, label }, side: Side.Before });\n\t\tids.push(id);\n\t}\n\treturn [f.close(), rootId];\n}\n\nfunction makeTestForestNode(testTree: TestTree): ForestNode {\n\treturn { ...testTree.buildLeaf(testTree.generateNodeId()), traits: new Map() };\n}\n"]}
@@ -1056,7 +1056,7 @@ function createNetworkTestFunction(validateAfter) {
1056
1056
  network.deliverOperations(DestinationClient.All);
1057
1057
  network.assertNetworkState();
1058
1058
  }
1059
- });
1059
+ }).timeout(10000);
1060
1060
  };
1061
1061
  }
1062
1062
  function describeNetwork(title, its) {