@fluid-experimental/property-changeset 0.58.1000 → 0.58.2000

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 (100) hide show
  1. package/dist/changeset.d.ts.map +1 -1
  2. package/dist/changeset.js +1 -18
  3. package/dist/changeset.js.map +1 -1
  4. package/dist/changeset_operations/array.d.ts.map +1 -1
  5. package/dist/changeset_operations/array.js +0 -3
  6. package/dist/changeset_operations/array.js.map +1 -1
  7. package/dist/changeset_operations/arrayChangesetIterator.d.ts +4 -4
  8. package/dist/changeset_operations/arrayChangesetIterator.d.ts.map +1 -1
  9. package/dist/changeset_operations/arrayChangesetIterator.js +1 -5
  10. package/dist/changeset_operations/arrayChangesetIterator.js.map +1 -1
  11. package/dist/changeset_operations/changesetConflictTypes.d.ts.map +1 -1
  12. package/dist/changeset_operations/changesetConflictTypes.js +0 -1
  13. package/dist/changeset_operations/changesetConflictTypes.js.map +1 -1
  14. package/dist/changeset_operations/indexedCollection.d.ts.map +1 -1
  15. package/dist/changeset_operations/indexedCollection.js +1 -3
  16. package/dist/changeset_operations/indexedCollection.js.map +1 -1
  17. package/dist/changeset_operations/isEmptyChangeset.js.map +1 -1
  18. package/dist/changeset_operations/operationTypes.js +0 -1
  19. package/dist/changeset_operations/operationTypes.js.map +1 -1
  20. package/dist/helpers/typeidHelper.d.ts.map +1 -1
  21. package/dist/helpers/typeidHelper.js +4 -5
  22. package/dist/helpers/typeidHelper.js.map +1 -1
  23. package/dist/index.d.ts +1 -1
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.js.map +1 -1
  26. package/dist/pathHelper.d.ts +2 -2
  27. package/dist/pathHelper.d.ts.map +1 -1
  28. package/dist/pathHelper.js +0 -2
  29. package/dist/pathHelper.js.map +1 -1
  30. package/dist/rebase.js +0 -1
  31. package/dist/rebase.js.map +1 -1
  32. package/dist/templateValidator.d.ts +3 -3
  33. package/dist/templateValidator.d.ts.map +1 -1
  34. package/dist/templateValidator.js +10 -12
  35. package/dist/templateValidator.js.map +1 -1
  36. package/dist/test/array.spec.js +56 -56
  37. package/dist/test/array.spec.js.map +1 -1
  38. package/dist/test/pathHelper.spec.js +14 -14
  39. package/dist/test/pathHelper.spec.js.map +1 -1
  40. package/dist/test/schemaValidator.js +2 -8
  41. package/dist/test/schemaValidator.js.map +1 -1
  42. package/dist/test/schemas/badBothPropertiesAndTypeid.js +3 -3
  43. package/dist/test/schemas/badBothPropertiesAndTypeid.js.map +1 -1
  44. package/dist/test/schemas/badInvalidSemverInTypeid.js +9 -9
  45. package/dist/test/schemas/badInvalidSemverInTypeid.js.map +1 -1
  46. package/dist/test/schemas/badMissingSemverInTypeid.js +9 -9
  47. package/dist/test/schemas/badMissingSemverInTypeid.js.map +1 -1
  48. package/dist/test/schemas/badNestedProperties.js +9 -9
  49. package/dist/test/schemas/badNestedProperties.js.map +1 -1
  50. package/dist/test/schemas/badPrimitiveTypeid.js +5 -5
  51. package/dist/test/schemas/badPrimitiveTypeid.js.map +1 -1
  52. package/dist/test/schemas/badVersionedTypeid.js +9 -9
  53. package/dist/test/schemas/badVersionedTypeid.js.map +1 -1
  54. package/dist/test/schemas/goodColorPalette.js +2 -2
  55. package/dist/test/schemas/goodColorPalette.js.map +1 -1
  56. package/dist/test/schemas/goodDraftAsVersion.js +2 -2
  57. package/dist/test/schemas/goodDraftAsVersion.js.map +1 -1
  58. package/dist/test/schemas/goodPointId.js +9 -9
  59. package/dist/test/schemas/goodPointId.js.map +1 -1
  60. package/dist/test/schemas/goodReferenceAndRegular.js +2 -2
  61. package/dist/test/schemas/goodReferenceAndRegular.js.map +1 -1
  62. package/dist/test/schemas/goodReservedTypes.js +4 -4
  63. package/dist/test/schemas/goodReservedTypes.js.map +1 -1
  64. package/dist/test/schemas/goodUIBorder.js +7 -7
  65. package/dist/test/schemas/goodUIBorder.js.map +1 -1
  66. package/dist/test/tsconfig.tsbuildinfo +23 -23
  67. package/dist/test/validator/templateValidator.spec.js +27 -27
  68. package/dist/test/validator/templateValidator.spec.js.map +1 -1
  69. package/dist/test/validator/typeidHelper.spec.js +2 -2
  70. package/dist/test/validator/typeidHelper.spec.js.map +1 -1
  71. package/dist/utils.d.ts +1 -1
  72. package/dist/utils.d.ts.map +1 -1
  73. package/dist/utils.js +2 -4
  74. package/dist/utils.js.map +1 -1
  75. package/lib/changeset.js +1 -18
  76. package/lib/changeset.js.map +1 -1
  77. package/lib/changeset_operations/array.js +0 -3
  78. package/lib/changeset_operations/array.js.map +1 -1
  79. package/lib/changeset_operations/arrayChangesetIterator.js +1 -5
  80. package/lib/changeset_operations/arrayChangesetIterator.js.map +1 -1
  81. package/lib/changeset_operations/changesetConflictTypes.js +0 -1
  82. package/lib/changeset_operations/changesetConflictTypes.js.map +1 -1
  83. package/lib/changeset_operations/indexedCollection.js +1 -3
  84. package/lib/changeset_operations/indexedCollection.js.map +1 -1
  85. package/lib/changeset_operations/isEmptyChangeset.js.map +1 -1
  86. package/lib/changeset_operations/operationTypes.js +0 -1
  87. package/lib/changeset_operations/operationTypes.js.map +1 -1
  88. package/lib/helpers/typeidHelper.js +4 -5
  89. package/lib/helpers/typeidHelper.js.map +1 -1
  90. package/lib/index.js +1 -1
  91. package/lib/index.js.map +1 -1
  92. package/lib/pathHelper.js +0 -2
  93. package/lib/pathHelper.js.map +1 -1
  94. package/lib/rebase.js +0 -1
  95. package/lib/rebase.js.map +1 -1
  96. package/lib/templateValidator.js +10 -12
  97. package/lib/templateValidator.js.map +1 -1
  98. package/lib/utils.js +2 -4
  99. package/lib/utils.js.map +1 -1
  100. package/package.json +8 -4
@@ -38,7 +38,7 @@ export class ArrayChangeSetIterator {
38
38
  this._op = {
39
39
  type: ArrayIteratorOperationTypes.NOP,
40
40
  offset: 0,
41
- operation: undefined
41
+ operation: undefined,
42
42
  };
43
43
  // go to the first element
44
44
  this.next();
@@ -176,14 +176,12 @@ export class ArrayChangeSetIterator {
176
176
  this._atEnd = false;
177
177
  return true;
178
178
  }
179
- ;
180
179
  /**
181
180
  * @returns true, if there are no more operations left
182
181
  */
183
182
  atEnd() {
184
183
  return this._atEnd;
185
184
  }
186
- ;
187
185
  _copyModifies(in_modifies) {
188
186
  if (!in_modifies || in_modifies.length === 0) {
189
187
  return undefined;
@@ -194,8 +192,6 @@ export class ArrayChangeSetIterator {
194
192
  }
195
193
  return result;
196
194
  }
197
- ;
198
195
  }
199
196
  ArrayChangeSetIterator.types = ArrayIteratorOperationTypes; // @TODO Not sure if this is still required if we export it separately.
200
- ;
201
197
  //# sourceMappingURL=arrayChangesetIterator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"arrayChangesetIterator.js","sourceRoot":"","sources":["../../src/changeset_operations/arrayChangesetIterator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH;;GAEG;AAGF,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AACvC,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AAExC,aAAa;AACb,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAGhE,OAAO,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAG/D,MAAM,EAAE,GAAG,EAAE,GAAG,SAAS,CAAC;AA2D1B;;;;;GAKG;AACH,MAAM,OAAO,sBAAsB;IA6B/B;;OAEG;IACH,YAAY,YAAiC;QACzC,IAAI,CAAC,UAAU,GAAG,YAAY,CAAC;QAC/B,8EAA8E;QAC9E,4CAA4C;QAC5C,IAAI,CAAC,eAAe,GAAG,YAAY,CAAC,MAAM,CAAC;QAC3C,IAAI,CAAC,eAAe,GAAG;YACnB,MAAM,EAAE,CAAC;YACT,MAAM,EAAE,CAAC;YACT,MAAM,EAAE,CAAC;SACZ,CAAC;QAEF,IAAI,CAAC,cAAc,GAAG,CAAC,CAAC;QACxB,IAAI,CAAC,mBAAmB,GAAG,CAAC,CAAC,CAAC;QAC9B,IAAI,CAAC,oBAAoB,GAAG,CAAC,CAAC;QAC9B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;Q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,EAAE,CAAC,CAAC;SAC3E;QACD,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,OAAO,IAAI,CAAC;IAChB,CAAC;IAAA,CAAC;IAEF;;OAEG;IACH,KAAK;QACD,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IAAA,CAAC;IAEM,aAAa,CAAC,WAAqB;QACvC,IAAI,CAAC,WAAW,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE;YAC1C,OAAO,SAAS,CAAC;SACpB;QACD,MAAM,MAAM,GAAG,EAAE,CAAC;QAClB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACzC,MAAM,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;SAC/D;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;IAAA,CAAC;;AA/MK,4BAAK,GAAG,2BAA2B,CAAC,CAAC,uEAAuE;AAgNtH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/**\n * @fileoverview Iterator to iterate over array ChangeSets\n */\n\n\n import isNumber from \"lodash/isNumber\";\n import isString from \"lodash/isString\";\n\n// @ts-ignore\nimport { constants } from \"@fluid-experimental/property-common\";\n\nimport { SerializedChangeSet } from \"../changeset\";\nimport { ArrayIteratorOperationTypes } from \"./operationTypes\";\n\n\nconst { MSG } = constants;\n\n\n\ntype genericArray = Array<number | string | (SerializedChangeSet & {typeid:string})>;\nexport type arrayInsertList = [number, string | genericArray]\nexport type arrayModifyList = [number, string | genericArray] | [number, string, string] | [number, genericArray, genericArray]\nexport type arrayRemoveList = [number, number | string | genericArray]\n\n\n\n/**\n * Description of an array operation\n */\nexport interface OperationDescription {\n _absoluteBegin?: number;\n type?: ArrayIteratorOperationTypes,\n offset?: number,\n}\n\n/**\n * Description of an insert array operation\n */\nexport interface InsertOperation extends OperationDescription {\n type: ArrayIteratorOperationTypes.INSERT;\n removeInsertOperation?: arrayInsertList;\n operation?: arrayInsertList;\n}\n\n\n/**\n * Description of a remove array operation\n */\nexport interface RemoveOperation extends OperationDescription {\n type: ArrayIteratorOperationTypes.REMOVE;\n removeInsertOperation?: arrayRemoveList;\n operation?: arrayRemoveList;\n}\n\n/**\n * Description of a modify array operation\n */\nexport interface ModifyOperation extends OperationDescription {\n type: ArrayIteratorOperationTypes.MODIFY;\n removeInsertOperation?: arrayModifyList;\n operation: arrayModifyList;\n}\n\n/**\n * Description of a modify array operation\n */\n export interface NOPOperation extends Omit<OperationDescription, \"removeInsertOperation\"|\"operation\"> {\n type: ArrayIteratorOperationTypes.NOP;\n operation?: [];\n}\n\nexport type NoneNOPOperation = RemoveOperation | InsertOperation | ModifyOperation;\nexport type GenericOperation = NoneNOPOperation | NOPOperation;\n\n/**\n * Iterator class which iterates over an array ChangeSet. It will successively return the operations ordered by their\n * position within the array. Additionally, it will keep track of the modifications to the array indices caused\n * by the previous operations.\n *\n */\nexport class ArrayChangeSetIterator {\n static types = ArrayIteratorOperationTypes; // @TODO Not sure if this is still required if we export it separately.\n\n private _changeSet: SerializedChangeSet;\n private _copiedModifies: string | any[];\n private _currentIndices: { insert: number; remove: number; modify: number; };\n private _currentOffset: number;\n private _lastOperationIndex: number;\n private _lastOperationOffset: number;\n\n private _atEnd: boolean;\n private _op: GenericOperation;\n\n public get opDescription(): GenericOperation {\n return this._op;\n }\n\n public get currentOffset(): number {\n return this._currentOffset;\n }\n\n public get lastOperationIndex(): number {\n return this._lastOperationIndex;\n }\n\n public get lastOperationOffset(): number {\n return this._lastOperationOffset;\n }\n\n /**\n * @param in_changeSet - The ChangeSet to iterate over (this has to be an array ChangeSet\n */\n constructor(in_changeSet: SerializedChangeSet) {\n this._changeSet = in_changeSet;\n // if we need to chop overlapping modifies internally, so we have to copy them\n // we do this lazy and only if really needed\n this._copiedModifies = in_changeSet.modify;\n this._currentIndices = {\n insert: 0,\n remove: 0,\n modify: 0,\n };\n\n this._currentOffset = 0;\n this._lastOperationIndex = -1;\n this._lastOperationOffset = 0;\n this._atEnd = false;\n\n this._op = {\n type: ArrayIteratorOperationTypes.NOP,\n offset: 0,\n operation: undefined\n };\n\n // go to the first element\n this.next();\n }\n\n /**\n * Returns the next operation in the ChangeSet\n * @returns true, if there are operations left\n */\n next(): boolean {\n // Find the smallest index in the operations lists\n let currentIndex = Infinity;\n let type: ArrayIteratorOperationTypes;\n (this._op as any).removeInsertOperation = undefined;\n // Process the current remove entry\n if (this._changeSet.remove &&\n this._currentIndices.remove < this._changeSet.remove.length) {\n type = ArrayChangeSetIterator.types.REMOVE;\n currentIndex = this._changeSet.remove[this._currentIndices.remove][0];\n let currentLength = this._changeSet.remove[this._currentIndices.remove][1];\n if (!isNumber(currentLength)) {\n currentLength = currentLength.length;\n }\n\n // Check, whether this is a removeInsertOperation\n if (this._changeSet.insert &&\n this._currentIndices.insert < this._changeSet.insert.length &&\n this._changeSet.insert[this._currentIndices.insert][0] <= currentIndex + currentLength) {\n (this._op as InsertOperation).removeInsertOperation = this._changeSet.insert[this._currentIndices.insert];\n }\n }\n\n // Process the current insert entry (we prefer remove over insert, since this prevents the array from growing more\n // than necessary)\n if (this._changeSet.insert &&\n this._currentIndices.insert < this._changeSet.insert.length &&\n this._changeSet.insert[this._currentIndices.insert][0] < currentIndex) {\n type = ArrayChangeSetIterator.types.INSERT;\n currentIndex = this._changeSet.insert[this._currentIndices.insert][0];\n }\n\n // Process the current modify entry\n if (this._copiedModifies &&\n this._currentIndices.modify < this._copiedModifies.length &&\n this._copiedModifies[this._currentIndices.modify][0] < currentIndex) {\n type = ArrayChangeSetIterator.types.MODIFY;\n }\n\n if (this._lastOperationIndex !== currentIndex) {\n this._currentOffset += this._lastOperationOffset;\n this._lastOperationIndex = currentIndex;\n this._lastOperationOffset = 0;\n }\n\n // We have found nothing, so we are at the end of the ChangeSet\n if (type === undefined) {\n this._op.type = ArrayChangeSetIterator.types.NOP;\n this._op.offset = this._currentOffset;\n this._op.operation = undefined;\n this._atEnd = true;\n return false;\n }\n\n // Determine the return value and update the internal indices and offsets depending on the next operation\n switch (type) {\n case ArrayChangeSetIterator.types.INSERT:\n this._op.type = ArrayChangeSetIterator.types.INSERT;\n // Define the return value\n this._op.operation = this._changeSet.insert[this._currentIndices.insert];\n this._op.offset = this._currentOffset;\n // Update the current offset. For an insert we have to increase it by the number of the inserted elements\n this._lastOperationOffset += (this._op.operation[1] as any).length;\n\n // Shift the internal index\n this._currentIndices.insert++;\n break;\n case ArrayChangeSetIterator.types.REMOVE:\n this._op.type = ArrayChangeSetIterator.types.REMOVE;\n // Define the return value\n this._op.operation = this._changeSet.remove[this._currentIndices.remove];\n this._op.offset = this._currentOffset;\n // Update the current offset. For a remove we have to decrement it by the number of the removed elements\n var removedElements = isNumber(this._op.operation[1]) ? this._op.operation[1] : this._op.operation[1].length;\n this._lastOperationOffset -= removedElements;\n\n // Shift the internal index\n this._currentIndices.remove++;\n break;\n case ArrayChangeSetIterator.types.MODIFY:\n {\n this._op.type = ArrayChangeSetIterator.types.MODIFY;\n this._op.offset = this._currentOffset;\n // check, if the modify's range overlaps with coming insert changes:\n let nextModify = this._copiedModifies[this._currentIndices.modify];\n const modifyEnd = nextModify[0] + nextModify[1].length;\n if (this._changeSet.insert &&\n this._currentIndices.insert < this._changeSet.insert.length &&\n this._changeSet.insert[this._currentIndices.insert][0] < modifyEnd) {\n // we have an overlap and need to cut the modify\n const insertPosition = this._changeSet.insert[this._currentIndices.insert][0];\n\n // if we haven't copied the change set's modifies yet, we need to do that now\n if (this._copiedModifies === this._changeSet.modify) {\n this._copiedModifies = this._copyModifies(this._changeSet.modify);\n // now we need to update nextModify!\n nextModify = this._copiedModifies[this._currentIndices.modify];\n }\n\n // use modify only up to insert's position\n\n // build a partial modify and cut the remaining one:\n const partialModify: arrayModifyList = [nextModify[0], undefined];\n if (isString(nextModify[1])) {\n partialModify[1] = nextModify[1].substr(0, insertPosition - nextModify[0]);\n nextModify[1] = nextModify[1].substr(insertPosition - nextModify[0]);\n } else {\n partialModify[1] = nextModify[1].splice(0, insertPosition - nextModify[0]);\n }\n\n nextModify[0] = insertPosition;\n\n // use the whole modify\n this._op.operation = partialModify;\n } else {\n // use the whole modify\n this._op.operation = nextModify;\n\n // Shift the internal index\n this._currentIndices.modify++;\n }\n break;\n }\n default:\n throw new Error(`ArrayChangeSetIterator: ${MSG.UNKNOWN_OPERATION}`);\n }\n this._atEnd = false;\n return true;\n };\n\n /**\n * @returns true, if there are no more operations left\n */\n atEnd(): boolean {\n return this._atEnd;\n };\n\n private _copyModifies(in_modifies: string[]) {\n if (!in_modifies || in_modifies.length === 0) {\n return undefined;\n }\n const result = [];\n for (let i = 0; i < in_modifies.length; i++) {\n result.push([in_modifies[i][0], in_modifies[i][1].slice()]);\n }\n return result;\n };\n};\n"]}
1
+ {"version":3,"file":"arrayChangesetIterator.js","sourceRoot":"","sources":["../../src/changeset_operations/arrayChangesetIterator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH;;GAEG;AAEF,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AACvC,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AAExC,aAAa;AACb,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAGhE,OAAO,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAE/D,MAAM,EAAE,GAAG,EAAE,GAAG,SAAS,CAAC;AAsD1B;;;;;GAKG;AACH,MAAM,OAAO,sBAAsB;IA6B/B;;OAEG;IACH,YAAY,YAAiC;QACzC,IAAI,CAAC,UAAU,GAAG,YAAY,CAAC;QAC/B,8EAA8E;QAC9E,4CAA4C;QAC5C,IAAI,CAAC,eAAe,GAAG,YAAY,CAAC,MAAM,CAAC;QAC3C,IAAI,CAAC,eAA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AG,CAAC,SAAS,GAAG,aAAa,CAAC;qBACtC;yBAAM;wBACH,uBAAuB;wBACvB,IAAI,CAAC,GAAG,CAAC,SAAS,GAAG,UAAU,CAAC;wBAEhC,2BAA2B;wBAC3B,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,CAAC;qBACjC;oBACD,MAAM;iBACT;YACL;gBACI,MAAM,IAAI,KAAK,CAAC,2BAA2B,GAAG,CAAC,iBAAiB,EAAE,CAAC,CAAC;SAC3E;QACD,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;OAEG;IACH,KAAK;QACD,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IAEO,aAAa,CAAC,WAAqB;QACvC,IAAI,CAAC,WAAW,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE;YAC1C,OAAO,SAAS,CAAC;SACpB;QACD,MAAM,MAAM,GAAG,EAAE,CAAC;QAClB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACzC,MAAM,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;SAC/D;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;;AA/MM,4BAAK,GAAG,2BAA2B,CAAC,CAAC,uEAAuE","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/**\n * @fileoverview Iterator to iterate over array ChangeSets\n */\n\n import isNumber from \"lodash/isNumber\";\n import isString from \"lodash/isString\";\n\n// @ts-ignore\nimport { constants } from \"@fluid-experimental/property-common\";\n\nimport { SerializedChangeSet } from \"../changeset\";\nimport { ArrayIteratorOperationTypes } from \"./operationTypes\";\n\nconst { MSG } = constants;\n\ntype genericArray = (number | string | (SerializedChangeSet & {typeid: string}))[];\nexport type arrayInsertList = [number, string | genericArray];\nexport type arrayModifyList = [number, string | genericArray] | [number, string, string] | [number, genericArray, genericArray];\nexport type arrayRemoveList = [number, number | string | genericArray];\n\n/**\n * Description of an array operation\n */\nexport interface OperationDescription {\n _absoluteBegin?: number;\n type?: ArrayIteratorOperationTypes,\n offset?: number,\n}\n\n/**\n * Description of an insert array operation\n */\nexport interface InsertOperation extends OperationDescription {\n type: ArrayIteratorOperationTypes.INSERT;\n removeInsertOperation?: arrayInsertList;\n operation?: arrayInsertList;\n}\n\n/**\n * Description of a remove array operation\n */\nexport interface RemoveOperation extends OperationDescription {\n type: ArrayIteratorOperationTypes.REMOVE;\n removeInsertOperation?: arrayRemoveList;\n operation?: arrayRemoveList;\n}\n\n/**\n * Description of a modify array operation\n */\nexport interface ModifyOperation extends OperationDescription {\n type: ArrayIteratorOperationTypes.MODIFY;\n removeInsertOperation?: arrayModifyList;\n operation: arrayModifyList;\n}\n\n/**\n * Description of a modify array operation\n */\n export interface NOPOperation extends Omit<OperationDescription, \"removeInsertOperation\" | \"operation\"> {\n type: ArrayIteratorOperationTypes.NOP;\n operation?: [];\n}\n\nexport type NoneNOPOperation = RemoveOperation | InsertOperation | ModifyOperation;\nexport type GenericOperation = NoneNOPOperation | NOPOperation;\n\n/**\n * Iterator class which iterates over an array ChangeSet. It will successively return the operations ordered by their\n * position within the array. Additionally, it will keep track of the modifications to the array indices caused\n * by the previous operations.\n *\n */\nexport class ArrayChangeSetIterator {\n static types = ArrayIteratorOperationTypes; // @TODO Not sure if this is still required if we export it separately.\n\n private readonly _changeSet: SerializedChangeSet;\n private _copiedModifies: string | any[];\n private readonly _currentIndices: { insert: number; remove: number; modify: number; };\n private _currentOffset: number;\n private _lastOperationIndex: number;\n private _lastOperationOffset: number;\n\n private _atEnd: boolean;\n private _op: GenericOperation;\n\n public get opDescription(): GenericOperation {\n return this._op;\n }\n\n public get currentOffset(): number {\n return this._currentOffset;\n }\n\n public get lastOperationIndex(): number {\n return this._lastOperationIndex;\n }\n\n public get lastOperationOffset(): number {\n return this._lastOperationOffset;\n }\n\n /**\n * @param in_changeSet - The ChangeSet to iterate over (this has to be an array ChangeSet\n */\n constructor(in_changeSet: SerializedChangeSet) {\n this._changeSet = in_changeSet;\n // if we need to chop overlapping modifies internally, so we have to copy them\n // we do this lazy and only if really needed\n this._copiedModifies = in_changeSet.modify;\n this._currentIndices = {\n insert: 0,\n remove: 0,\n modify: 0,\n };\n\n this._currentOffset = 0;\n this._lastOperationIndex = -1;\n this._lastOperationOffset = 0;\n this._atEnd = false;\n\n this._op = {\n type: ArrayIteratorOperationTypes.NOP,\n offset: 0,\n operation: undefined,\n };\n\n // go to the first element\n this.next();\n }\n\n /**\n * Returns the next operation in the ChangeSet\n * @returns true, if there are operations left\n */\n next(): boolean {\n // Find the smallest index in the operations lists\n let currentIndex = Infinity;\n let type: ArrayIteratorOperationTypes;\n (this._op as any).removeInsertOperation = undefined;\n // Process the current remove entry\n if (this._changeSet.remove &&\n this._currentIndices.remove < this._changeSet.remove.length) {\n type = ArrayChangeSetIterator.types.REMOVE;\n currentIndex = this._changeSet.remove[this._currentIndices.remove][0];\n let currentLength = this._changeSet.remove[this._currentIndices.remove][1];\n if (!isNumber(currentLength)) {\n currentLength = currentLength.length;\n }\n\n // Check, whether this is a removeInsertOperation\n if (this._changeSet.insert &&\n this._currentIndices.insert < this._changeSet.insert.length &&\n this._changeSet.insert[this._currentIndices.insert][0] <= currentIndex + currentLength) {\n (this._op as InsertOperation).removeInsertOperation = this._changeSet.insert[this._currentIndices.insert];\n }\n }\n\n // Process the current insert entry (we prefer remove over insert, since this prevents the array from growing more\n // than necessary)\n if (this._changeSet.insert &&\n this._currentIndices.insert < this._changeSet.insert.length &&\n this._changeSet.insert[this._currentIndices.insert][0] < currentIndex) {\n type = ArrayChangeSetIterator.types.INSERT;\n currentIndex = this._changeSet.insert[this._currentIndices.insert][0];\n }\n\n // Process the current modify entry\n if (this._copiedModifies &&\n this._currentIndices.modify < this._copiedModifies.length &&\n this._copiedModifies[this._currentIndices.modify][0] < currentIndex) {\n type = ArrayChangeSetIterator.types.MODIFY;\n }\n\n if (this._lastOperationIndex !== currentIndex) {\n this._currentOffset += this._lastOperationOffset;\n this._lastOperationIndex = currentIndex;\n this._lastOperationOffset = 0;\n }\n\n // We have found nothing, so we are at the end of the ChangeSet\n if (type === undefined) {\n this._op.type = ArrayChangeSetIterator.types.NOP;\n this._op.offset = this._currentOffset;\n this._op.operation = undefined;\n this._atEnd = true;\n return false;\n }\n\n // Determine the return value and update the internal indices and offsets depending on the next operation\n switch (type) {\n case ArrayChangeSetIterator.types.INSERT:\n this._op.type = ArrayChangeSetIterator.types.INSERT;\n // Define the return value\n this._op.operation = this._changeSet.insert[this._currentIndices.insert];\n this._op.offset = this._currentOffset;\n // Update the current offset. For an insert we have to increase it by the number of the inserted elements\n this._lastOperationOffset += (this._op.operation[1] as any).length;\n\n // Shift the internal index\n this._currentIndices.insert++;\n break;\n case ArrayChangeSetIterator.types.REMOVE:\n this._op.type = ArrayChangeSetIterator.types.REMOVE;\n // Define the return value\n this._op.operation = this._changeSet.remove[this._currentIndices.remove];\n this._op.offset = this._currentOffset;\n // Update the current offset. For a remove we have to decrement it by the number of the removed elements\n var removedElements = isNumber(this._op.operation[1]) ? this._op.operation[1] : this._op.operation[1].length;\n this._lastOperationOffset -= removedElements;\n\n // Shift the internal index\n this._currentIndices.remove++;\n break;\n case ArrayChangeSetIterator.types.MODIFY:\n {\n this._op.type = ArrayChangeSetIterator.types.MODIFY;\n this._op.offset = this._currentOffset;\n // check, if the modify's range overlaps with coming insert changes:\n let nextModify = this._copiedModifies[this._currentIndices.modify];\n const modifyEnd = nextModify[0] + nextModify[1].length;\n if (this._changeSet.insert &&\n this._currentIndices.insert < this._changeSet.insert.length &&\n this._changeSet.insert[this._currentIndices.insert][0] < modifyEnd) {\n // we have an overlap and need to cut the modify\n const insertPosition = this._changeSet.insert[this._currentIndices.insert][0];\n\n // if we haven't copied the change set's modifies yet, we need to do that now\n if (this._copiedModifies === this._changeSet.modify) {\n this._copiedModifies = this._copyModifies(this._changeSet.modify);\n // now we need to update nextModify!\n nextModify = this._copiedModifies[this._currentIndices.modify];\n }\n\n // use modify only up to insert's position\n\n // build a partial modify and cut the remaining one:\n const partialModify: arrayModifyList = [nextModify[0], undefined];\n if (isString(nextModify[1])) {\n partialModify[1] = nextModify[1].substr(0, insertPosition - nextModify[0]);\n nextModify[1] = nextModify[1].substr(insertPosition - nextModify[0]);\n } else {\n partialModify[1] = nextModify[1].splice(0, insertPosition - nextModify[0]);\n }\n\n nextModify[0] = insertPosition;\n\n // use the whole modify\n this._op.operation = partialModify;\n } else {\n // use the whole modify\n this._op.operation = nextModify;\n\n // Shift the internal index\n this._currentIndices.modify++;\n }\n break;\n }\n default:\n throw new Error(`ArrayChangeSetIterator: ${MSG.UNKNOWN_OPERATION}`);\n }\n this._atEnd = false;\n return true;\n }\n\n /**\n * @returns true, if there are no more operations left\n */\n atEnd(): boolean {\n return this._atEnd;\n }\n\n private _copyModifies(in_modifies: string[]) {\n if (!in_modifies || in_modifies.length === 0) {\n return undefined;\n }\n const result = [];\n for (let i = 0; i < in_modifies.length; i++) {\n result.push([in_modifies[i][0], in_modifies[i][1].slice()]);\n }\n return result;\n }\n}\n"]}
@@ -28,5 +28,4 @@ export var ConflictType;
28
28
  // Tried to insert inside a removed array range
29
29
  ConflictType[ConflictType["INSERT_IN_REMOVED_RANGE"] = 8] = "INSERT_IN_REMOVED_RANGE";
30
30
  })(ConflictType || (ConflictType = {}));
31
- ;
32
31
  //# sourceMappingURL=changesetConflictTypes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"changesetConflictTypes.js","sourceRoot":"","sources":["../../src/changeset_operations/changesetConflictTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH;;GAEG;AAEH,MAAM,CAAN,IAAY,YAqBX;AArBD,WAAY,YAAY;IACpB,oGAAoG;IACpG,mFAAwB,CAAA;IACxB,6CAA6C;IAC7C,iEAAa,CAAA;IACb,wCAAwC;IACxC,6FAA2B,CAAA;IAC3B;;;;OAIG;IACH,mHAAsC,CAAA;IACtC,kEAAkE;IAClE,+FAA4B,CAAA;IAC5B,+GAA+G;IAC/G,6EAAmB,CAAA;IACnB,oDAAoD;IACpD,2EAAkB,CAAA;IAClB,+CAA+C;IAC/C,qFAAuB,CAAA;AAC3B,CAAC,EArBW,YAAY,KAAZ,YAAY,QAqBvB;AAAA,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/**\n * @fileoverview Conflict types that can occur during changeset operations\n */\n\nexport enum ConflictType {\n /** We had two incompatible ChangeSets, they probably were with respect to different base commits */\n INVALID_CHANGESET_BASE=1,\n /** A value was changed in both ChangeSets */\n COLLIDING_SET,\n /** A deleted child node was modified */\n ENTRY_MODIFIED_AFTER_REMOVE,\n /** A child was modified after it had been removed and added.\n *\n * The modification can no longer be applied, since the affected object has changed and thus\n * the ChangeSet is no longer compatible.\n */\n ENTRY_MODIFICATION_AFTER_REMOVE_INSERT,\n /** An entry with the same key was inserted into the collection */\n INSERTED_ENTRY_WITH_SAME_KEY,\n /** A property was removed after a modify, this should mostly be safe, be we report it for completeness sake */\n REMOVE_AFTER_MODIFY,\n // Templates do not match from one commit to another\n MISMATCH_TEMPLATES,\n // Tried to insert inside a removed array range\n INSERT_IN_REMOVED_RANGE,\n};\n\n\n"]}
1
+ {"version":3,"file":"changesetConflictTypes.js","sourceRoot":"","sources":["../../src/changeset_operations/changesetConflictTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH;;GAEG;AAEH,MAAM,CAAN,IAAY,YAqBX;AArBD,WAAY,YAAY;IACpB,oGAAoG;IACpG,mFAA0B,CAAA;IAC1B,6CAA6C;IAC7C,iEAAa,CAAA;IACb,wCAAwC;IACxC,6FAA2B,CAAA;IAC3B;;;;OAIG;IACH,mHAAsC,CAAA;IACtC,kEAAkE;IAClE,+FAA4B,CAAA;IAC5B,+GAA+G;IAC/G,6EAAmB,CAAA;IACnB,oDAAoD;IACpD,2EAAkB,CAAA;IAClB,+CAA+C;IAC/C,qFAAuB,CAAA;AAC3B,CAAC,EArBW,YAAY,KAAZ,YAAY,QAqBvB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/**\n * @fileoverview Conflict types that can occur during changeset operations\n */\n\nexport enum ConflictType {\n /** We had two incompatible ChangeSets, they probably were with respect to different base commits */\n INVALID_CHANGESET_BASE = 1,\n /** A value was changed in both ChangeSets */\n COLLIDING_SET,\n /** A deleted child node was modified */\n ENTRY_MODIFIED_AFTER_REMOVE,\n /** A child was modified after it had been removed and added.\n *\n * The modification can no longer be applied, since the affected object has changed and thus\n * the ChangeSet is no longer compatible.\n */\n ENTRY_MODIFICATION_AFTER_REMOVE_INSERT,\n /** An entry with the same key was inserted into the collection */\n INSERTED_ENTRY_WITH_SAME_KEY,\n /** A property was removed after a modify, this should mostly be safe, be we report it for completeness sake */\n REMOVE_AFTER_MODIFY,\n // Templates do not match from one commit to another\n MISMATCH_TEMPLATES,\n // Tried to insert inside a removed array range\n INSERT_IN_REMOVED_RANGE,\n}\n"]}
@@ -11,7 +11,7 @@ import isEqual from "lodash/isEqual";
11
11
  import isObject from "lodash/isObject";
12
12
  import without from "lodash/without";
13
13
  import includes from "lodash/includes";
14
- //@ts-ignore
14
+ // @ts-ignore
15
15
  import { constants, joinPaths } from "@fluid-experimental/property-common";
16
16
  import { TypeIdHelper } from "../helpers/typeidHelper";
17
17
  import { PathHelper } from "../pathHelper";
@@ -184,7 +184,6 @@ export var ChangeSetIndexedCollectionFunctions;
184
184
  }
185
185
  }
186
186
  }
187
- ;
188
187
  // Apply insert operations
189
188
  if (in_appliedPropertyChanges.insert) {
190
189
  // Get and initialize the corresponding entries from the existing collection
@@ -758,5 +757,4 @@ export var ChangeSetIndexedCollectionFunctions;
758
757
  }
759
758
  };
760
759
  })(ChangeSetIndexedCollectionFunctions || (ChangeSetIndexedCollectionFunctions = {}));
761
- ;
762
760
  //# sourceMappingURL=indexedCollection.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"indexedCollection.js","sourceRoot":"","sources":["../../src/changeset_operations/indexedCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH;;GAEG;AAEF,OAAO,EAAC,IAAI,IAAI,SAAS,EAAC,MAAM,mBAAmB,CAAC;AACpD,OAAO,OAAO,MAAM,gBAAgB,CAAC;AACrC,OAAO,OAAO,MAAM,gBAAgB,CAAC;AACrC,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AACvC,OAAO,OAAO,MAAM,gBAAgB,CAAC;AACrC,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AAExC,YAAY;AACZ,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAE3E,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,MAAM,EAAE,uBAAuB,EAAE,GAAG,EAAE,GAAG,SAAS,CAAC;AAEnD;;;;GAIG;AAEH;;;;;;;;;GASG;AACH,MAAM,kBAAkB,GAAG,UAAS,SAAc;IAC9C,IAAI,CAAC,SAAS,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE;QAChE,OAAO,OAAO,CAAC,SAAS,CAAC,CAAC;KAC7B;IAED,wCAAwC;IACxC,KAAK,MAAM,MAAM,IAAI,SAAS,EAAE;QAC5B,OAAO,KAAK,CAAC;KAChB;IAED,OAAO,IAAI,CAAC;AAChB,CAAC,CAAC;AAE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IAAI,EAAE,CAAC,CAAC;YACnD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBACxC,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC/C,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBACzC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;oBACxC,IAAI,gBAAgB,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;wBAC3C,OAAO,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;qBAClC;iBACJ;gBACD,IAAI,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;oBACnD,OAAO,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;iBACxC;aACJ;SACJ;QAED,mDAAmD;QACnD,IAAI,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YACpC,OAAO,OAAO,CAAC,MAAM,CAAC;SACzB;IACL,CAAC,CAAA;AACL,CAAC,EA/vBgB,mCAAmC,KAAnC,mCAAmC,QA+vBnD;AAAA,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/**\n * @fileoverview Helper functions and classes to work with ChangeSets with indexed collections (sets and maps)\n */\n\n import {copy as cloneDeep} from \"fastest-json-copy\";\n import isEmpty from \"lodash/isEmpty\";\n import isEqual from \"lodash/isEqual\";\n import isObject from \"lodash/isObject\";\n import without from \"lodash/without\";\n import includes from \"lodash/includes\";\n\n//@ts-ignore\nimport { constants, joinPaths } from \"@fluid-experimental/property-common\";\nimport { ApplyChangeSetOptions, ConflictInfo, SerializedChangeSet } from \"../changeset\";\nimport { TypeIdHelper } from \"../helpers/typeidHelper\";\nimport { PathHelper } from \"../pathHelper\";\nimport { ConflictType } from \"./changesetConflictTypes\";\nimport { isEmptyChangeSet } from \"./isEmptyChangeset\";\n\nconst { PROPERTY_PATH_DELIMITER, MSG } = constants;\n\n/**\n * @namespace property-changeset.ChangeSetOperations.IndexedCollectionOperations\n * @alias property-changeset.ChangeSetOperations.IndexedCollectionOperations\n * Helper functions and classes to perform operations on ChangeSets with indexed collections (sets and maps)\n */\n\n/**\n * Checks whether an object is empty (has no keys)\n * This function should be a bit faster than the isEmpty from\n * underscore. Unfortunately, at least on Chrome, it is still in\n * O(n)\n *\n * @param in_object - The object to check\n * @returns Is it empty?\n * @private\n */\nconst _fastIsEmptyObject = function(in_object: any): boolean {\n if (!in_object || Array.isArray(in_object) || !isObject(in_object)) {\n return isEmpty(in_object);\n }\n\n // eslint-disable-next-line guard-for-in\n for (const _entry in in_object) {\n return false;\n }\n\n return true;\n};\n\nexport namespace ChangeSetIndexedCollectionFunctions {\n /**\n * Applies a ChangeSet to a given indexed collection property (recursively). The ChangeSet is assumed to be relative\n * to the same property root and it will be applied behind the base ChangeSet (assuming that the changes are\n * relative to the state after the base ChangeSet has been applied. It will change the base ChangeSet.\n *\n * @param io_basePropertyChanges - The ChangeSet describing the initial state\n * @param in_appliedPropertyChanges - The ChangeSet to apply to this state\n * @param in_typeid - The typeid of the contents collection\n * (without the collection type)\n * @param in_options - Optional additional parameters\n * @param in_options.applyAfterMetaInformation - Additional meta information which help later to obtain\n * more compact changeset during the apply operation\n *\n * @private\n */\n export const _performApplyAfterOnPropertyIndexedCollection = function(\n io_basePropertyChanges: SerializedChangeSet, // eslint-disable-line complexity\n in_appliedPropertyChanges: SerializedChangeSet,\n in_typeid: string,\n in_options: ApplyChangeSetOptions) {\n const isPrimitiveTypeid = TypeIdHelper.isPrimitiveType(in_typeid);\n\n // Handle remove entry operations\n if (in_appliedPropertyChanges.remove) {\n // Get and initialize the corresponding entries in the existing collection\n let removedEntries = in_appliedPropertyChanges.remove;\n\n io_basePropertyChanges = io_basePropertyChanges || {};\n io_basePropertyChanges.remove = io_basePropertyChanges.remove ||\n (Array.isArray(in_appliedPropertyChanges.remove) ? [] : {});\n let baseInserted = io_basePropertyChanges.insert || {};\n let baseRemoved = io_basePropertyChanges.remove;\n let baseModified = io_basePropertyChanges.modify;\n let done = false;\n\n if (!Array.isArray(removedEntries)) {\n if (isPrimitiveTypeid) {\n removedEntries = Object.keys(removedEntries);\n } else {\n // this is a reversible change set of templated types\n const removedTypes = Object.keys(removedEntries);\n for (let t = 0; t < removedTypes.length; t++) {\n const removedKeys = Object.keys(removedEntries[removedTypes[t]]);\n for (let i = 0; i < removedKeys.length; i++) {\n if (baseInserted[removedTypes[t]] &&\n baseInserted[removedTypes[t]][removedKeys[i]] !== undefined) {\n delete baseInserted[removedTypes[t]][removedKeys[i]];\n\n // If all entries for a typeid have been removed, we can remove\n // the whole typeid from the inserted section\n if (baseInserted && isEmpty(baseInserted[removedTypes[t]])) {\n delete baseInserted[removedTypes[t]];\n }\n } else {\n if (baseModified && baseModified[removedTypes[t]] &&\n baseModified[removedTypes[t]][removedKeys[i]] !== undefined) {\n delete baseModified[removedTypes[t]][removedKeys[i]];\n\n // If all entries for a typeid have been removed, we can remove\n // the whole typeid from the inserted section\n if (baseModified && isEmpty(baseModified[removedTypes[t]])) {\n delete baseModified[removedTypes[t]];\n }\n }\n if (Array.isArray(baseRemoved)) {\n baseRemoved.push(removedKeys[i]);\n } else {\n if (!baseRemoved[removedTypes[t]]) {\n baseRemoved[removedTypes[t]] = {};\n }\n baseRemoved[removedTypes[t]][removedKeys[i]] = removedEntries[removedTypes[t]][removedKeys[i]];\n }\n }\n }\n }\n done = true;\n }\n }\n\n if (!done) {\n if (isPrimitiveTypeid) {\n for (let i = 0; i < removedEntries.length; i++) {\n let key = removedEntries[i];\n\n // If there is an insert for this key, we just remove it\n if (baseInserted[key] !== undefined) {\n delete baseInserted[key];\n } else {\n // There could be a modify entry for this key, which we have to remove\n if (baseModified && baseModified[key] !== undefined) {\n delete baseModified[key];\n }\n\n // Otherwise we add it to the remove list\n if (Array.isArray(baseRemoved)) {\n baseRemoved.push(key);\n } else {\n baseRemoved[key] = in_appliedPropertyChanges.remove[key];\n }\n }\n }\n } else {\n const baseInsertedTypeids = Object.keys(baseInserted);\n for (let i = 0; i < removedEntries.length; i++) {\n let key = removedEntries[i];\n let foundInTypeid;\n\n // Since we only have a flat remove list (without typeid) in the changeset, we have\n // to check all inserts\n for (let j = 0; j < baseInsertedTypeids.length; j++) {\n if (baseInserted[baseInsertedTypeids[j]] &&\n baseInserted[baseInsertedTypeids[j]][key] !== undefined) {\n foundInTypeid = baseInsertedTypeids[j];\n break;\n }\n }\n\n if (foundInTypeid) {\n // If this key was inserted by this ChangeSet, we just remove it from the inserted list\n delete baseInserted[foundInTypeid][key];\n\n // If all entries for a typeid have been removed, we can remove\n // the whole typeid from the inserted or modified section\n if (baseInserted && isEmpty(baseInserted[foundInTypeid])) {\n delete baseInserted[foundInTypeid];\n }\n if (baseModified && isEmpty(baseModified[foundInTypeid])) {\n delete baseModified[foundInTypeid];\n }\n } else {\n // There could be a modify entry for this key, which we have to remove\n const baseModifiedTypeids = Object.keys(baseModified || {});\n for (let j = 0; j < baseModifiedTypeids.length; j++) {\n if (baseModified[baseModifiedTypeids[j]][key]) {\n foundInTypeid = baseModifiedTypeids[j];\n delete baseModified[foundInTypeid][key];\n break;\n }\n }\n\n // Otherwise we add it to the remove list\n baseRemoved.push(key);\n }\n }\n }\n }\n };\n\n // Apply insert operations\n if (in_appliedPropertyChanges.insert) {\n // Get and initialize the corresponding entries from the existing collection\n io_basePropertyChanges = io_basePropertyChanges || {};\n io_basePropertyChanges.insert = io_basePropertyChanges.insert || {};\n let baseInserted = io_basePropertyChanges.insert;\n let baseRemoved = io_basePropertyChanges.remove;\n\n // Insert the inserted entries\n\n // If no typeids are included, we just use a placeholder for the iteration below\n const insertedTypeids = isPrimitiveTypeid ? [undefined] : Object.keys(in_appliedPropertyChanges.insert);\n for (let i = 0; i < insertedTypeids.length; i++) {\n let typeid = insertedTypeids[i];\n const insertedEntries = isPrimitiveTypeid ?\n in_appliedPropertyChanges.insert : in_appliedPropertyChanges.insert[typeid];\n const insertedKeys = Object.keys(insertedEntries);\n let removalCS;\n if (baseRemoved) {\n removalCS = isPrimitiveTypeid ? baseRemoved : baseRemoved[typeid];\n }\n for (let j = 0; j < insertedKeys.length; j++) {\n let key = insertedKeys[j];\n let deeplyEqualCS = false;\n\n // If we have a complex type in the collection, we need to do a deep comparison of the two\n // ChangeSets to determine, whether they are equal\n // TODO: We should actually compute a diff between the two and recursively convert portions to modifies\n // Instead, right now, we only handle the case where the two keys cancel each out perfectly, i.e.,\n // the insert is reinserting exactly what was removed.\n if (!isPrimitiveTypeid && removalCS && isObject(removalCS) && removalCS[key] !== undefined) {\n // Split out the two parts: all the keys other than remove/insert should match exactly.\n // The contents 'remove' and 'insert', if they exist, should also match.\n deeplyEqualCS = !!insertedEntries[key].insert === !!removalCS[key].remove;\n\n // If there are 'insert' and 'remove', see if the removed data matches the inserted data\n if (deeplyEqualCS && insertedEntries[key].insert) {\n deeplyEqualCS = isEqual(\n insertedEntries[key].insert,\n removalCS[key].remove,\n );\n }\n\n // Finally, check if the data being inserted matches the data that was removed\n const insertedEntry = isObject(insertedEntries[key]) ? without(insertedEntries[key], \"insert\") : insertedEntries[key];\n const removedEntry = isObject(removalCS[key]) ? without(removalCS[key], \"remove\") : removalCS[key];\n deeplyEqualCS = deeplyEqualCS && isEqual(insertedEntry, removedEntry);\n }\n\n if ((isPrimitiveTypeid || TypeIdHelper.isPrimitiveType(typeid) || deeplyEqualCS) &&\n removalCS &&\n ((Array.isArray(removalCS) && includes(baseRemoved, key)) || removalCS[key] !== undefined)) {\n // A remove and insert are combined into a modify for primitive types\n\n // Remove the old remove command\n let oldValueMatches = false;\n if (Array.isArray(removalCS)) {\n if (isPrimitiveTypeid) {\n io_basePropertyChanges.remove = without(io_basePropertyChanges.remove, key);\n } else {\n io_basePropertyChanges.remove[typeid] = without(io_basePropertyChanges.remove[typeid], key);\n }\n } else {\n oldValueMatches = deeplyEqualCS || (removalCS[key] === insertedEntries[key]);\n delete removalCS[key];\n }\n\n // Insert a modify command instead\n if (!oldValueMatches) {\n io_basePropertyChanges.modify = io_basePropertyChanges.modify || {};\n if (isPrimitiveTypeid) {\n io_basePropertyChanges.modify[key] = insertedEntries[key];\n } else {\n io_basePropertyChanges.modify[typeid] = io_basePropertyChanges.modify[typeid] || {};\n io_basePropertyChanges.modify[typeid][key] = cloneDeep(insertedEntries[key]);\n }\n }\n } else if (isPrimitiveTypeid && baseInserted[key] === undefined) {\n baseInserted[key] = insertedEntries[key];\n } else if (!isPrimitiveTypeid && (!baseInserted[typeid] || baseInserted[typeid][key] === undefined)) {\n baseInserted[typeid] = baseInserted[typeid] || {};\n baseInserted[typeid][key] = cloneDeep(insertedEntries[key]);\n } else {\n throw new Error(MSG.ALREADY_EXISTING_ENTRY + key);\n }\n }\n }\n }\n\n // Handle modification operations\n if (in_appliedPropertyChanges.modify) {\n // Get and initialize the corresponding entries from the existing collection\n const modifiedEntries = in_appliedPropertyChanges.modify;\n io_basePropertyChanges = io_basePropertyChanges || {};\n io_basePropertyChanges.modify = io_basePropertyChanges.modify || {};\n let baseModified = io_basePropertyChanges.modify;\n let baseInserted = io_basePropertyChanges.insert || {};\n\n // Process the modifications\n\n // If no typeids are included, we just use a placeholder for the iteration below\n const modifiedTypeids = isPrimitiveTypeid ? [undefined] : Object.keys(modifiedEntries);\n for (let i = 0; i < modifiedTypeids.length; i++) {\n let typeid = modifiedTypeids[i];\n\n const modifyKeys = Object.keys(isPrimitiveTypeid ? modifiedEntries : modifiedEntries[typeid]);\n for (let j = 0; j < modifyKeys.length; j++) {\n let key = modifyKeys[j];\n\n if (isPrimitiveTypeid) {\n let newValue = modifiedEntries[key];\n if (newValue && newValue.hasOwnProperty(\"value\")) {\n newValue = newValue.value;\n }\n if (baseInserted[key] !== undefined) {\n // If this entry was added by this ChangeSet, we modify the insert operation according to the\n // new ChangeSet\n baseInserted[key] = newValue;\n } else {\n if (baseModified[key] && baseModified[key].hasOwnProperty(\"value\")) {\n baseModified[key].value = newValue;\n } else {\n baseModified[key] = newValue;\n }\n }\n } else {\n // If this is a polymorphic collection, we can still have individual entries with\n // primitive types\n const isEntryPrimitiveType = TypeIdHelper.isPrimitiveType(typeid);\n\n if (baseInserted[typeid] && baseInserted[typeid][key] !== undefined) {\n // If this entry was added by this ChangeSet, we modify the insert operation according to the\n // new ChangeSet\n if (isEntryPrimitiveType && typeid !== \"String\") {\n let newValue = modifiedEntries[typeid][key];\n if (newValue && newValue.hasOwnProperty(\"value\")) {\n newValue = modifiedEntries[typeid][key].value;\n }\n\n // In the case of Int64 or Uint64 we copy the array so that\n // both ChangeSets don't point to the same instance\n if (typeid === \"Int64\" || typeid === \"Uint64\") {\n newValue = newValue.slice();\n }\n\n if (baseInserted[typeid][key] && baseInserted[typeid][key].hasOwnProperty(\"value\")) {\n baseInserted[typeid][key].value = newValue;\n } else {\n baseInserted[typeid][key] = newValue;\n }\n } else {\n this.performApplyAfterOnPropertyWithTypeid(key,\n baseInserted[typeid],\n modifiedEntries[typeid],\n typeid,\n false,\n in_options);\n }\n } else if (baseModified[typeid] && baseModified[typeid][key] !== undefined) {\n // If there was a previous modification operation, we have to merge the two\n if (isEntryPrimitiveType && typeid !== \"String\") {\n // Primitive types can simply be overwritten, however we have an exception for\n // 64 bit integers (until javascript natively supports them)\n if (typeid === \"Int64\" || typeid === \"Uint64\") {\n let appliedVal = modifiedEntries[typeid][key];\n if (appliedVal && appliedVal.hasOwnProperty(\"value\")) {\n appliedVal = appliedVal.value;\n }\n baseModified[typeid][key] = appliedVal.slice();\n } else {\n baseModified[typeid][key] = modifiedEntries[typeid][key];\n }\n } else {\n this.performApplyAfterOnPropertyWithTypeid(key,\n baseModified[typeid],\n modifiedEntries[typeid],\n typeid,\n true,\n in_options);\n }\n } else {\n baseModified[typeid] = baseModified[typeid] || {};\n baseModified[typeid][key] = cloneDeep(modifiedEntries[typeid][key]);\n }\n }\n }\n }\n }\n\n // Remove unnecessary entries from the ChangeSet\n this._cleanIndexedCollectionChangeSet(io_basePropertyChanges, !isPrimitiveTypeid);\n }\n\n /**\n * Performs the rebase operation for set and map collections\n *\n * @param in_ownPropertyChangeSet - The ChangeSet for this collection\n * @param io_rebasePropertyChangeSet - The ChangeSet for the collection to be rebased\n * @param in_basePath - Base path to get to the property processed by this function\n * @param in_typeid - The typeid of the contents collection (without the collection type)\n * @param in_useSquareBracketsInPath -\n * If set to true, paths will be created using the angular brackets syntax (for\n * arrays), otherwise dots will be used (for NodeProperties)\n * @param out_conflicts - A list of paths that resulted in conflicts together with the type of the conflict\n * @param in_options - Optional additional parameters\n * @param in_options.applyAfterMetaInformation - Additional meta information which help later to obtain\n * more compact changeset during the apply operation\n *\n * @private\n */\n export const _rebaseIndexedCollectionChangeSetForProperty = function(\n in_ownPropertyChangeSet: SerializedChangeSet, // eslint-disable-line complexity\n io_rebasePropertyChangeSet: SerializedChangeSet,\n in_basePath: string,\n in_typeid: string,\n in_useSquareBracketsInPath: boolean,\n out_conflicts: ConflictInfo[],\n in_options: ApplyChangeSetOptions) {\n const isPrimitiveTypeid = TypeIdHelper.isPrimitiveType(in_typeid);\n\n const changesByKeys = {};\n let modifyMap = {};\n // Helper function which stores the changes indexed by key in the changesByKeys array to\n // make it easier to compare the related changes in the two ChangeSets\n const addChanges = function(in_collection: Record<string, any>, in_changeIdentifier: string, in_changePrefix: string, in_typeidChange?: string) {\n // Collection didn't exist in this ChangeSet\n if (in_collection === undefined) {\n return;\n }\n\n // For remove operations, the ChangeSet is only an array of keys, otherwise it is a map, so we have to\n // distinguish the two cases here\n const keys = Array.isArray(in_collection) ? in_collection : Object.keys(in_collection);\n\n // Add all entries indexed with the key\n for (let j = 0; j < keys.length; j++) {\n const key = keys[j];\n\n // Store the type of the change\n changesByKeys[key] = changesByKeys[key] || {};\n changesByKeys[key][in_changePrefix] = changesByKeys[key][in_changePrefix] ?\n `${changesByKeys[key][in_changePrefix]}_${in_changeIdentifier}` :\n in_changeIdentifier;\n\n // If applicable store the typeid of the change\n if (in_typeidChange) {\n changesByKeys[key][`${in_changePrefix}Typeid`] = in_typeidChange;\n }\n\n // Store the ChangeSet\n if (in_changePrefix === \"other\") {\n if (!Array.isArray(in_collection)) {\n changesByKeys[key].change = in_collection[key];\n } else {\n changesByKeys[key].change = key;\n }\n }\n }\n };\n\n // Helper function which adds the Changes for a ChangeSet that is ordered by typeid\n const addChangesWithTypeids = function (in_collection, in_changeIdentifier, in_changePrefix) {\n if (in_collection === undefined) {\n return;\n }\n // Iterate over the typeids (or use dummy entry for the iteration\n const addedKeyTypeids = Object.keys(in_collection);\n for (let i = 0; i < addedKeyTypeids.length; i++) {\n const Typeid = addedKeyTypeids[i];\n addChanges(in_collection[Typeid], in_changeIdentifier, in_changePrefix, Typeid);\n }\n };\n\n // Insert all changes from the ChangeSet into the lookup map\n if (Array.isArray(in_ownPropertyChangeSet.remove)) {\n addChanges(in_ownPropertyChangeSet.remove, \"remove\", \"own\");\n } else {\n if (isPrimitiveTypeid) {\n addChanges(in_ownPropertyChangeSet.remove, \"remove\", \"own\");\n } else {\n addChangesWithTypeids(in_ownPropertyChangeSet.remove, \"remove\", \"own\");\n }\n }\n\n if (Array.isArray(io_rebasePropertyChangeSet.remove)) {\n addChanges(io_rebasePropertyChangeSet.remove, \"remove\", \"other\");\n } else {\n if (isPrimitiveTypeid) {\n addChanges(io_rebasePropertyChangeSet.remove, \"remove\", \"other\");\n } else {\n addChangesWithTypeids(io_rebasePropertyChangeSet.remove, \"remove\", \"other\");\n }\n }\n\n if (isPrimitiveTypeid) {\n addChanges(in_ownPropertyChangeSet.insert, \"insert\", \"own\");\n addChanges(in_ownPropertyChangeSet.modify, \"modify\", \"own\");\n addChanges(io_rebasePropertyChangeSet.insert, \"insert\", \"other\");\n addChanges(io_rebasePropertyChangeSet.modify, \"modify\", \"other\");\n } else {\n addChangesWithTypeids(in_ownPropertyChangeSet.insert, \"insert\", \"own\");\n addChangesWithTypeids(in_ownPropertyChangeSet.modify, \"modify\", \"own\");\n addChangesWithTypeids(io_rebasePropertyChangeSet.insert, \"insert\", \"other\");\n addChangesWithTypeids(io_rebasePropertyChangeSet.modify, \"modify\", \"other\");\n }\n\n // Check for modifications that affect the same object\n const changedKeys = Object.keys(changesByKeys);\n for (let i = 0; i < changedKeys.length; i++) {\n const key = changedKeys[i];\n const newPath = in_useSquareBracketsInPath ?\n `${in_basePath}[${PathHelper.quotePathSegmentIfNeeded(key)}]` :\n joinPaths(in_basePath, PathHelper.quotePathSegmentIfNeeded(key), PROPERTY_PATH_DELIMITER);\n\n const modification = changesByKeys[key];\n if (modification.own && modification.other) {\n /*\n We found a key that was changed by both ChangeSets at the same time\n We now have to handle the conflicting changes. The changes we do, are summarized in this table:\n\n <START REBASE HANDLING TABLE>\n +-------+-----------------+------------------+-------------------+-------------------------------------+\n | \\Own| insert | modify | remove | remove+insert |\n | \\ | | | | |\n |other\\ | | | | |\n +=======+=================+==================+===================+=====================================+\n | | conflicting | incompatible | incompatible | incompatible |\n |insert | inserts | psets | psets | psets |\n | | | | | |\n +-------+-----------------+------------------+-------------------+-------------------------------------+\n | | incompatible | merge recursively| conflict | conflict |\n |modify | psets | (conflicting on | | (modify can not be applied due to |\n | | | leaf) | - delete modify | to incompatible base) |\n | | | | in other | |\n | | | | | - delete modify in other |\n +-------+-----------------+------------------+-------------------+-------------------------------------+\n | | incompatible | non-conflicting | non-conflicting | incompatible |\n |remove | psets | change | change | psets |\n | | | | | |\n | | | | - rem dupl. remove| |\n +-------+-----------------+------------------+-------------------+-------------------------------------+\n | | incompatible | non-conflicting | non-conflicting | conflict |\n |remove+| psets | change | change | |\n |insert | | | | - remove conflicting insert |\n | | | | - rem dupl. remove| |\n +-------+-----------------+------------------+-------------------+-------------------------------------+\n <END REBASE HANDLING TABLE>\n */\n\n // A key was modified after it had been removed\n if (modification.own === \"modify\" && modification.other === \"modify\") {\n if (isPrimitiveTypeid ||\n (TypeIdHelper.isPrimitiveType(modification.ownTypeid) && modification.ownTypeid !== \"String\")) {\n // We have two modification operations that affect the same entry for a base type.\n // This is a legal operation, the second one will overwrite the first one, but we\n // report it as a possible conflict\n let ownModify = in_ownPropertyChangeSet.modify;\n let rebasedModify = io_rebasePropertyChangeSet.modify;\n if (modification.otherTypeid) {\n ownModify = ownModify[modification.otherTypeid];\n rebasedModify = rebasedModify[modification.otherTypeid];\n }\n\n let conflict = {\n path: newPath,\n type: ConflictType.COLLIDING_SET,\n conflictingChange: ownModify[key],\n };\n out_conflicts.push(conflict);\n // If value is the same, delete the entry\n let ownValue = ownModify[key];\n if (typeof ownValue === \"object\" && ownValue.hasOwnProperty(\"value\")) {\n ownValue = ownValue.value;\n }\n let rebaseValue = rebasedModify[key];\n if (typeof rebaseValue === \"object\" && rebaseValue.hasOwnProperty(\"value\")) {\n rebaseValue = rebaseValue.value;\n }\n if (modification.ownTypeid === \"Int64\" || modification.ownTypeid === \"Uint64\" || ownValue.length === 2) {\n // For (u)int64, values are arrays of 2 elements\n if (ownValue[0] === rebaseValue[0] && ownValue[1] === rebaseValue[1]) {\n delete rebasedModify[key];\n }\n } else {\n if (ownValue === rebaseValue) {\n delete rebasedModify[key];\n }\n }\n } else {\n this.rebaseChangeSetForPropertyEntryWithTypeid(key,\n in_ownPropertyChangeSet.modify[modification.ownTypeid],\n io_rebasePropertyChangeSet.modify[modification.otherTypeid],\n modification.ownTypeid,\n newPath,\n true,\n out_conflicts,\n in_options);\n }\n } else if (modification.own === \"remove\" && modification.other === \"modify\") {\n modifyMap = modification.otherTypeid ? io_rebasePropertyChangeSet.modify[modification.otherTypeid] :\n io_rebasePropertyChangeSet.modify;\n\n // Create the conflict information\n let conflict = {\n path: newPath,\n type: ConflictType.ENTRY_MODIFIED_AFTER_REMOVE,\n conflictingChange: modifyMap[key],\n };\n out_conflicts.push(conflict);\n\n // Delete the modification from the rebased ChangeSet\n delete modifyMap[key];\n } else if (modification.own === \"remove_insert\" && modification.other === \"modify\") {\n // We have a conflicting change. A node was removed and inserted (replaced) in the original\n // ChangeSet and then modified by the rebased ChangeSet. Since the base of the modification\n // can have been changed significantly by this operation, we don't know whether we can\n // apply the modification\n\n // Create the conflict information\n let conflict = {\n path: newPath,\n type: ConflictType.ENTRY_MODIFICATION_AFTER_REMOVE_INSERT,\n conflictingChange: io_rebasePropertyChangeSet.modify[modification.otherTypeid][key],\n };\n out_conflicts.push(conflict);\n\n // Delete the modification from the rebased ChangeSet\n delete io_rebasePropertyChangeSet.modify[key];\n } else if ((modification.own === \"modify\" || modification.own === \"remove\") &&\n (modification.other === \"remove\" || modification.other === \"remove_insert\")) {\n if (modification.own === \"modify\") {\n modifyMap = modification.ownTypeid ? in_ownPropertyChangeSet.modify[modification.ownTypeid] :\n in_ownPropertyChangeSet.modify;\n\n // Create the conflict information\n let conflict = {\n path: newPath,\n type: ConflictType.REMOVE_AFTER_MODIFY,\n conflictingChange: modifyMap[key],\n };\n out_conflicts.push(conflict);\n }\n\n // If we have a duplicated delete, we remove it from the new ChangeSet\n if (modification.own === \"remove\") {\n if (Array.isArray(io_rebasePropertyChangeSet.remove)) {\n io_rebasePropertyChangeSet.remove = without(io_rebasePropertyChangeSet.remove, key);\n } else {\n if (isPrimitiveTypeid) {\n delete io_rebasePropertyChangeSet.remove[key];\n } else {\n delete io_rebasePropertyChangeSet.remove[modification.otherTypeid][key];\n }\n }\n }\n } else if (modification.own === \"insert\" && modification.other === \"insert\") {\n if (isPrimitiveTypeid ||\n (TypeIdHelper.isPrimitiveType(modification.ownTypeid))) {\n let insertMap = modification.otherTypeid ? io_rebasePropertyChangeSet.insert[modification.otherTypeid] :\n io_rebasePropertyChangeSet.insert;\n\n // We have two insert operations that affect the same key for a primitive type.\n // This is a legal operation, the second one will overwrite the first one, but we\n // report it as a possible conflicting set\n let conflict = {\n path: newPath,\n type: ConflictType.COLLIDING_SET,\n conflictingChange: insertMap[key],\n };\n out_conflicts.push(conflict);\n\n // Convert to modify\n let oldValue;\n if (modification.otherTypeid) {\n io_rebasePropertyChangeSet.modify = io_rebasePropertyChangeSet.modify || {};\n io_rebasePropertyChangeSet.modify[modification.otherTypeid] =\n io_rebasePropertyChangeSet.modify[modification.otherTypeid] || {};\n modifyMap = io_rebasePropertyChangeSet.modify[modification.otherTypeid];\n oldValue = in_ownPropertyChangeSet.insert[modification.ownTypeid][key];\n } else {\n io_rebasePropertyChangeSet.modify = io_rebasePropertyChangeSet.modify || {};\n modifyMap = io_rebasePropertyChangeSet.modify;\n oldValue = in_ownPropertyChangeSet.insert[key];\n }\n\n modifyMap[key] = { value: insertMap[key], oldValue };\n delete insertMap[key];\n } else {\n // Here we have two insert operations for objects. Since these affect a whole sub-tree and not\n // just a single value, we cannot easily convert it into a modify and instead report it as invalid\n\n let insertMap = modification.otherTypeid ? io_rebasePropertyChangeSet.insert[modification.otherTypeid] :\n io_rebasePropertyChangeSet.insert;\n\n // Create the conflict information\n let conflict = {\n path: newPath,\n type: ConflictType.INSERTED_ENTRY_WITH_SAME_KEY,\n conflictingChange: insertMap[key],\n };\n out_conflicts.push(conflict);\n\n // Delete the modification from the rebased ChangeSet\n delete insertMap[key];\n }\n } else if (modification.own === \"remove_insert\" && modification.other === \"remove_insert\") {\n let insertMap = modification.otherTypeid ? io_rebasePropertyChangeSet.insert[modification.otherTypeid] :\n io_rebasePropertyChangeSet.insert;\n\n // Raise the duplicate inserts as a conflict\n let conflict = {\n path: newPath,\n type: ConflictType.COLLIDING_SET,\n conflictingChange: insertMap[key],\n };\n out_conflicts.push(conflict);\n } else {\n // All other operations are conflicting changes, which only occur for ChangeSets that are relative\n // to different bases\n\n // Create the conflict information\n let conflict = {\n path: newPath,\n type: ConflictType.INVALID_CHANGESET_BASE,\n conflictingChange: modification.change,\n };\n out_conflicts.push(conflict);\n\n // Remove the change from the ChangeSet\n if (modification.other !== \"remove\") {\n if (modification.otherTypeid !== undefined) {\n delete io_rebasePropertyChangeSet[modification.other][modification.otherTypeid][key];\n } else {\n delete io_rebasePropertyChangeSet[modification.other][key];\n }\n } else {\n // Remove remove operations from the ChangeSet\n if (Array.isArray(io_rebasePropertyChangeSet[modification.other])) {\n io_rebasePropertyChangeSet[modification.other] =\n without(io_rebasePropertyChangeSet[modification.other], key);\n } else {\n delete io_rebasePropertyChangeSet[modification.other][key];\n }\n }\n\n console.error(\"Rebase operation with conflicting ChangeSets. Probably incorrect bases.\");\n }\n }\n }\n\n // Remove unnecessary entries from the ChangeSet\n this._cleanIndexedCollectionChangeSet(io_rebasePropertyChangeSet, !isPrimitiveTypeid);\n }\n\n /**\n * Removes empty entries from the .children collection of the ChangeSet\n *\n * @param in_propertyChanges - The ChangeSet to clean up\n * @param in_containsTypeids - Does this ChangeSet contain typeids\n * @private\n */\n export const _cleanIndexedCollectionChangeSet = function(in_propertyChanges: SerializedChangeSet, in_containsTypeids: boolean) {\n const changes = in_propertyChanges;\n // Clean inserts\n\n // First remove unused typeid sections\n if (in_containsTypeids) {\n let typeidList = Object.keys(changes.insert || {});\n for (let j = 0; j < typeidList.length; j++) {\n if (_fastIsEmptyObject(changes.insert[typeidList[j]])) {\n delete changes.insert[typeidList[j]];\n }\n }\n }\n\n // Remove add group if no operations are present\n if (_fastIsEmptyObject(changes.insert)) {\n delete changes.insert;\n }\n\n // First remove unused typeid sections\n if (in_containsTypeids) {\n let typeidList = Object.keys(changes.remove || {});\n for (let j = 0; j < typeidList.length; j++) {\n if (_fastIsEmptyObject(changes.remove[typeidList[j]])) {\n delete changes.remove[typeidList[j]];\n }\n }\n }\n // Remove remove group if no operations are present\n if (_fastIsEmptyObject(changes.remove)) {\n delete changes.remove;\n }\n\n // Clean modifies\n\n // First remove unused typeid sections\n if (in_containsTypeids) {\n let typeidList = Object.keys(changes.modify || {});\n for (let j = 0; j < typeidList.length; j++) {\n const modifies = changes.modify[typeidList[j]];\n const modifyKeys = Object.keys(modifies);\n for (let k = 0; k < modifyKeys.length; k++) {\n if (isEmptyChangeSet(modifies[modifyKeys[k]])) {\n delete modifies[modifyKeys[k]];\n }\n }\n if (_fastIsEmptyObject(changes.modify[typeidList[j]])) {\n delete changes.modify[typeidList[j]];\n }\n }\n }\n\n // Remove modify group if no operations are present\n if (_fastIsEmptyObject(changes.modify)) {\n delete changes.modify;\n }\n }\n};\n"]}
1
+ {"version":3,"file":"indexedCollection.js","sourceRoot":"","sources":["../../src/changeset_operations/indexedCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH;;GAEG;AAEF,OAAO,EAAC,IAAI,IAAI,SAAS,EAAC,MAAM,mBAAmB,CAAC;AACpD,OAAO,OAAO,MAAM,gBAAgB,CAAC;AACrC,OAAO,OAAO,MAAM,gBAAgB,CAAC;AACrC,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AACvC,OAAO,OAAO,MAAM,gBAAgB,CAAC;AACrC,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AAExC,aAAa;AACb,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAE3E,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,MAAM,EAAE,uBAAuB,EAAE,GAAG,EAAE,GAAG,SAAS,CAAC;AAEnD;;;;GAIG;AAEH;;;;;;;;;GASG;AACH,MAAM,kBAAkB,GAAG,UAAS,SAAc;IAC9C,IAAI,CAAC,SAAS,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE;QAChE,OAAO,OAAO,CAAC,SAAS,CAAC,CAAC;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SACzB;QAED,iBAAiB;QAEjB,sCAAsC;QACtC,IAAI,kBAAkB,EAAE;YACpB,IAAI,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC;YACnD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBACxC,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC/C,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBACzC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;oBACxC,IAAI,gBAAgB,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;wBAC3C,OAAO,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;qBAClC;iBACJ;gBACD,IAAI,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;oBACnD,OAAO,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;iBACxC;aACJ;SACJ;QAED,mDAAmD;QACnD,IAAI,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YACpC,OAAO,OAAO,CAAC,MAAM,CAAC;SACzB;IACL,CAAC,CAAC;AACN,CAAC,EA/vBgB,mCAAmC,KAAnC,mCAAmC,QA+vBnD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/**\n * @fileoverview Helper functions and classes to work with ChangeSets with indexed collections (sets and maps)\n */\n\n import {copy as cloneDeep} from \"fastest-json-copy\";\n import isEmpty from \"lodash/isEmpty\";\n import isEqual from \"lodash/isEqual\";\n import isObject from \"lodash/isObject\";\n import without from \"lodash/without\";\n import includes from \"lodash/includes\";\n\n// @ts-ignore\nimport { constants, joinPaths } from \"@fluid-experimental/property-common\";\nimport { ApplyChangeSetOptions, ConflictInfo, SerializedChangeSet } from \"../changeset\";\nimport { TypeIdHelper } from \"../helpers/typeidHelper\";\nimport { PathHelper } from \"../pathHelper\";\nimport { ConflictType } from \"./changesetConflictTypes\";\nimport { isEmptyChangeSet } from \"./isEmptyChangeset\";\n\nconst { PROPERTY_PATH_DELIMITER, MSG } = constants;\n\n/**\n * @namespace property-changeset.ChangeSetOperations.IndexedCollectionOperations\n * @alias property-changeset.ChangeSetOperations.IndexedCollectionOperations\n * Helper functions and classes to perform operations on ChangeSets with indexed collections (sets and maps)\n */\n\n/**\n * Checks whether an object is empty (has no keys)\n * This function should be a bit faster than the isEmpty from\n * underscore. Unfortunately, at least on Chrome, it is still in\n * O(n)\n *\n * @param in_object - The object to check\n * @returns Is it empty?\n * @private\n */\nconst _fastIsEmptyObject = function(in_object: any): boolean {\n if (!in_object || Array.isArray(in_object) || !isObject(in_object)) {\n return isEmpty(in_object);\n }\n\n // eslint-disable-next-line guard-for-in\n for (const _entry in in_object) {\n return false;\n }\n\n return true;\n};\n\nexport namespace ChangeSetIndexedCollectionFunctions {\n /**\n * Applies a ChangeSet to a given indexed collection property (recursively). The ChangeSet is assumed to be relative\n * to the same property root and it will be applied behind the base ChangeSet (assuming that the changes are\n * relative to the state after the base ChangeSet has been applied. It will change the base ChangeSet.\n *\n * @param io_basePropertyChanges - The ChangeSet describing the initial state\n * @param in_appliedPropertyChanges - The ChangeSet to apply to this state\n * @param in_typeid - The typeid of the contents collection\n * (without the collection type)\n * @param in_options - Optional additional parameters\n * @param in_options.applyAfterMetaInformation - Additional meta information which help later to obtain\n * more compact changeset during the apply operation\n *\n * @private\n */\n export const _performApplyAfterOnPropertyIndexedCollection = function(\n io_basePropertyChanges: SerializedChangeSet, // eslint-disable-line complexity\n in_appliedPropertyChanges: SerializedChangeSet,\n in_typeid: string,\n in_options: ApplyChangeSetOptions) {\n const isPrimitiveTypeid = TypeIdHelper.isPrimitiveType(in_typeid);\n\n // Handle remove entry operations\n if (in_appliedPropertyChanges.remove) {\n // Get and initialize the corresponding entries in the existing collection\n let removedEntries = in_appliedPropertyChanges.remove;\n\n io_basePropertyChanges = io_basePropertyChanges || {};\n io_basePropertyChanges.remove = io_basePropertyChanges.remove ||\n (Array.isArray(in_appliedPropertyChanges.remove) ? [] : {});\n let baseInserted = io_basePropertyChanges.insert || {};\n let baseRemoved = io_basePropertyChanges.remove;\n let baseModified = io_basePropertyChanges.modify;\n let done = false;\n\n if (!Array.isArray(removedEntries)) {\n if (isPrimitiveTypeid) {\n removedEntries = Object.keys(removedEntries);\n } else {\n // this is a reversible change set of templated types\n const removedTypes = Object.keys(removedEntries);\n for (let t = 0; t < removedTypes.length; t++) {\n const removedKeys = Object.keys(removedEntries[removedTypes[t]]);\n for (let i = 0; i < removedKeys.length; i++) {\n if (baseInserted[removedTypes[t]] &&\n baseInserted[removedTypes[t]][removedKeys[i]] !== undefined) {\n delete baseInserted[removedTypes[t]][removedKeys[i]];\n\n // If all entries for a typeid have been removed, we can remove\n // the whole typeid from the inserted section\n if (baseInserted && isEmpty(baseInserted[removedTypes[t]])) {\n delete baseInserted[removedTypes[t]];\n }\n } else {\n if (baseModified && baseModified[removedTypes[t]] &&\n baseModified[removedTypes[t]][removedKeys[i]] !== undefined) {\n delete baseModified[removedTypes[t]][removedKeys[i]];\n\n // If all entries for a typeid have been removed, we can remove\n // the whole typeid from the inserted section\n if (baseModified && isEmpty(baseModified[removedTypes[t]])) {\n delete baseModified[removedTypes[t]];\n }\n }\n if (Array.isArray(baseRemoved)) {\n baseRemoved.push(removedKeys[i]);\n } else {\n if (!baseRemoved[removedTypes[t]]) {\n baseRemoved[removedTypes[t]] = {};\n }\n baseRemoved[removedTypes[t]][removedKeys[i]] = removedEntries[removedTypes[t]][removedKeys[i]];\n }\n }\n }\n }\n done = true;\n }\n }\n\n if (!done) {\n if (isPrimitiveTypeid) {\n for (let i = 0; i < removedEntries.length; i++) {\n let key = removedEntries[i];\n\n // If there is an insert for this key, we just remove it\n if (baseInserted[key] !== undefined) {\n delete baseInserted[key];\n } else {\n // There could be a modify entry for this key, which we have to remove\n if (baseModified && baseModified[key] !== undefined) {\n delete baseModified[key];\n }\n\n // Otherwise we add it to the remove list\n if (Array.isArray(baseRemoved)) {\n baseRemoved.push(key);\n } else {\n baseRemoved[key] = in_appliedPropertyChanges.remove[key];\n }\n }\n }\n } else {\n const baseInsertedTypeids = Object.keys(baseInserted);\n for (let i = 0; i < removedEntries.length; i++) {\n let key = removedEntries[i];\n let foundInTypeid;\n\n // Since we only have a flat remove list (without typeid) in the changeset, we have\n // to check all inserts\n for (let j = 0; j < baseInsertedTypeids.length; j++) {\n if (baseInserted[baseInsertedTypeids[j]] &&\n baseInserted[baseInsertedTypeids[j]][key] !== undefined) {\n foundInTypeid = baseInsertedTypeids[j];\n break;\n }\n }\n\n if (foundInTypeid) {\n // If this key was inserted by this ChangeSet, we just remove it from the inserted list\n delete baseInserted[foundInTypeid][key];\n\n // If all entries for a typeid have been removed, we can remove\n // the whole typeid from the inserted or modified section\n if (baseInserted && isEmpty(baseInserted[foundInTypeid])) {\n delete baseInserted[foundInTypeid];\n }\n if (baseModified && isEmpty(baseModified[foundInTypeid])) {\n delete baseModified[foundInTypeid];\n }\n } else {\n // There could be a modify entry for this key, which we have to remove\n const baseModifiedTypeids = Object.keys(baseModified || {});\n for (let j = 0; j < baseModifiedTypeids.length; j++) {\n if (baseModified[baseModifiedTypeids[j]][key]) {\n foundInTypeid = baseModifiedTypeids[j];\n delete baseModified[foundInTypeid][key];\n break;\n }\n }\n\n // Otherwise we add it to the remove list\n baseRemoved.push(key);\n }\n }\n }\n }\n }\n\n // Apply insert operations\n if (in_appliedPropertyChanges.insert) {\n // Get and initialize the corresponding entries from the existing collection\n io_basePropertyChanges = io_basePropertyChanges || {};\n io_basePropertyChanges.insert = io_basePropertyChanges.insert || {};\n let baseInserted = io_basePropertyChanges.insert;\n let baseRemoved = io_basePropertyChanges.remove;\n\n // Insert the inserted entries\n\n // If no typeids are included, we just use a placeholder for the iteration below\n const insertedTypeids = isPrimitiveTypeid ? [undefined] : Object.keys(in_appliedPropertyChanges.insert);\n for (let i = 0; i < insertedTypeids.length; i++) {\n let typeid = insertedTypeids[i];\n const insertedEntries = isPrimitiveTypeid ?\n in_appliedPropertyChanges.insert : in_appliedPropertyChanges.insert[typeid];\n const insertedKeys = Object.keys(insertedEntries);\n let removalCS;\n if (baseRemoved) {\n removalCS = isPrimitiveTypeid ? baseRemoved : baseRemoved[typeid];\n }\n for (let j = 0; j < insertedKeys.length; j++) {\n let key = insertedKeys[j];\n let deeplyEqualCS = false;\n\n // If we have a complex type in the collection, we need to do a deep comparison of the two\n // ChangeSets to determine, whether they are equal\n // TODO: We should actually compute a diff between the two and recursively convert portions to modifies\n // Instead, right now, we only handle the case where the two keys cancel each out perfectly, i.e.,\n // the insert is reinserting exactly what was removed.\n if (!isPrimitiveTypeid && removalCS && isObject(removalCS) && removalCS[key] !== undefined) {\n // Split out the two parts: all the keys other than remove/insert should match exactly.\n // The contents 'remove' and 'insert', if they exist, should also match.\n deeplyEqualCS = !!insertedEntries[key].insert === !!removalCS[key].remove;\n\n // If there are 'insert' and 'remove', see if the removed data matches the inserted data\n if (deeplyEqualCS && insertedEntries[key].insert) {\n deeplyEqualCS = isEqual(\n insertedEntries[key].insert,\n removalCS[key].remove,\n );\n }\n\n // Finally, check if the data being inserted matches the data that was removed\n const insertedEntry = isObject(insertedEntries[key]) ? without(insertedEntries[key], \"insert\") : insertedEntries[key];\n const removedEntry = isObject(removalCS[key]) ? without(removalCS[key], \"remove\") : removalCS[key];\n deeplyEqualCS = deeplyEqualCS && isEqual(insertedEntry, removedEntry);\n }\n\n if ((isPrimitiveTypeid || TypeIdHelper.isPrimitiveType(typeid) || deeplyEqualCS) &&\n removalCS &&\n ((Array.isArray(removalCS) && includes(baseRemoved, key)) || removalCS[key] !== undefined)) {\n // A remove and insert are combined into a modify for primitive types\n\n // Remove the old remove command\n let oldValueMatches = false;\n if (Array.isArray(removalCS)) {\n if (isPrimitiveTypeid) {\n io_basePropertyChanges.remove = without(io_basePropertyChanges.remove, key);\n } else {\n io_basePropertyChanges.remove[typeid] = without(io_basePropertyChanges.remove[typeid], key);\n }\n } else {\n oldValueMatches = deeplyEqualCS || (removalCS[key] === insertedEntries[key]);\n delete removalCS[key];\n }\n\n // Insert a modify command instead\n if (!oldValueMatches) {\n io_basePropertyChanges.modify = io_basePropertyChanges.modify || {};\n if (isPrimitiveTypeid) {\n io_basePropertyChanges.modify[key] = insertedEntries[key];\n } else {\n io_basePropertyChanges.modify[typeid] = io_basePropertyChanges.modify[typeid] || {};\n io_basePropertyChanges.modify[typeid][key] = cloneDeep(insertedEntries[key]);\n }\n }\n } else if (isPrimitiveTypeid && baseInserted[key] === undefined) {\n baseInserted[key] = insertedEntries[key];\n } else if (!isPrimitiveTypeid && (!baseInserted[typeid] || baseInserted[typeid][key] === undefined)) {\n baseInserted[typeid] = baseInserted[typeid] || {};\n baseInserted[typeid][key] = cloneDeep(insertedEntries[key]);\n } else {\n throw new Error(MSG.ALREADY_EXISTING_ENTRY + key);\n }\n }\n }\n }\n\n // Handle modification operations\n if (in_appliedPropertyChanges.modify) {\n // Get and initialize the corresponding entries from the existing collection\n const modifiedEntries = in_appliedPropertyChanges.modify;\n io_basePropertyChanges = io_basePropertyChanges || {};\n io_basePropertyChanges.modify = io_basePropertyChanges.modify || {};\n let baseModified = io_basePropertyChanges.modify;\n let baseInserted = io_basePropertyChanges.insert || {};\n\n // Process the modifications\n\n // If no typeids are included, we just use a placeholder for the iteration below\n const modifiedTypeids = isPrimitiveTypeid ? [undefined] : Object.keys(modifiedEntries);\n for (let i = 0; i < modifiedTypeids.length; i++) {\n let typeid = modifiedTypeids[i];\n\n const modifyKeys = Object.keys(isPrimitiveTypeid ? modifiedEntries : modifiedEntries[typeid]);\n for (let j = 0; j < modifyKeys.length; j++) {\n let key = modifyKeys[j];\n\n if (isPrimitiveTypeid) {\n let newValue = modifiedEntries[key];\n if (newValue && newValue.hasOwnProperty(\"value\")) {\n newValue = newValue.value;\n }\n if (baseInserted[key] !== undefined) {\n // If this entry was added by this ChangeSet, we modify the insert operation according to the\n // new ChangeSet\n baseInserted[key] = newValue;\n } else {\n if (baseModified[key] && baseModified[key].hasOwnProperty(\"value\")) {\n baseModified[key].value = newValue;\n } else {\n baseModified[key] = newValue;\n }\n }\n } else {\n // If this is a polymorphic collection, we can still have individual entries with\n // primitive types\n const isEntryPrimitiveType = TypeIdHelper.isPrimitiveType(typeid);\n\n if (baseInserted[typeid] && baseInserted[typeid][key] !== undefined) {\n // If this entry was added by this ChangeSet, we modify the insert operation according to the\n // new ChangeSet\n if (isEntryPrimitiveType && typeid !== \"String\") {\n let newValue = modifiedEntries[typeid][key];\n if (newValue && newValue.hasOwnProperty(\"value\")) {\n newValue = modifiedEntries[typeid][key].value;\n }\n\n // In the case of Int64 or Uint64 we copy the array so that\n // both ChangeSets don't point to the same instance\n if (typeid === \"Int64\" || typeid === \"Uint64\") {\n newValue = newValue.slice();\n }\n\n if (baseInserted[typeid][key] && baseInserted[typeid][key].hasOwnProperty(\"value\")) {\n baseInserted[typeid][key].value = newValue;\n } else {\n baseInserted[typeid][key] = newValue;\n }\n } else {\n this.performApplyAfterOnPropertyWithTypeid(key,\n baseInserted[typeid],\n modifiedEntries[typeid],\n typeid,\n false,\n in_options);\n }\n } else if (baseModified[typeid] && baseModified[typeid][key] !== undefined) {\n // If there was a previous modification operation, we have to merge the two\n if (isEntryPrimitiveType && typeid !== \"String\") {\n // Primitive types can simply be overwritten, however we have an exception for\n // 64 bit integers (until javascript natively supports them)\n if (typeid === \"Int64\" || typeid === \"Uint64\") {\n let appliedVal = modifiedEntries[typeid][key];\n if (appliedVal && appliedVal.hasOwnProperty(\"value\")) {\n appliedVal = appliedVal.value;\n }\n baseModified[typeid][key] = appliedVal.slice();\n } else {\n baseModified[typeid][key] = modifiedEntries[typeid][key];\n }\n } else {\n this.performApplyAfterOnPropertyWithTypeid(key,\n baseModified[typeid],\n modifiedEntries[typeid],\n typeid,\n true,\n in_options);\n }\n } else {\n baseModified[typeid] = baseModified[typeid] || {};\n baseModified[typeid][key] = cloneDeep(modifiedEntries[typeid][key]);\n }\n }\n }\n }\n }\n\n // Remove unnecessary entries from the ChangeSet\n this._cleanIndexedCollectionChangeSet(io_basePropertyChanges, !isPrimitiveTypeid);\n };\n\n /**\n * Performs the rebase operation for set and map collections\n *\n * @param in_ownPropertyChangeSet - The ChangeSet for this collection\n * @param io_rebasePropertyChangeSet - The ChangeSet for the collection to be rebased\n * @param in_basePath - Base path to get to the property processed by this function\n * @param in_typeid - The typeid of the contents collection (without the collection type)\n * @param in_useSquareBracketsInPath -\n * If set to true, paths will be created using the angular brackets syntax (for\n * arrays), otherwise dots will be used (for NodeProperties)\n * @param out_conflicts - A list of paths that resulted in conflicts together with the type of the conflict\n * @param in_options - Optional additional parameters\n * @param in_options.applyAfterMetaInformation - Additional meta information which help later to obtain\n * more compact changeset during the apply operation\n *\n * @private\n */\n export const _rebaseIndexedCollectionChangeSetForProperty = function(\n in_ownPropertyChangeSet: SerializedChangeSet, // eslint-disable-line complexity\n io_rebasePropertyChangeSet: SerializedChangeSet,\n in_basePath: string,\n in_typeid: string,\n in_useSquareBracketsInPath: boolean,\n out_conflicts: ConflictInfo[],\n in_options: ApplyChangeSetOptions) {\n const isPrimitiveTypeid = TypeIdHelper.isPrimitiveType(in_typeid);\n\n const changesByKeys = {};\n let modifyMap = {};\n // Helper function which stores the changes indexed by key in the changesByKeys array to\n // make it easier to compare the related changes in the two ChangeSets\n const addChanges = function(in_collection: Record<string, any>, in_changeIdentifier: string, in_changePrefix: string, in_typeidChange?: string) {\n // Collection didn't exist in this ChangeSet\n if (in_collection === undefined) {\n return;\n }\n\n // For remove operations, the ChangeSet is only an array of keys, otherwise it is a map, so we have to\n // distinguish the two cases here\n const keys = Array.isArray(in_collection) ? in_collection : Object.keys(in_collection);\n\n // Add all entries indexed with the key\n for (let j = 0; j < keys.length; j++) {\n const key = keys[j];\n\n // Store the type of the change\n changesByKeys[key] = changesByKeys[key] || {};\n changesByKeys[key][in_changePrefix] = changesByKeys[key][in_changePrefix] ?\n `${changesByKeys[key][in_changePrefix]}_${in_changeIdentifier}` :\n in_changeIdentifier;\n\n // If applicable store the typeid of the change\n if (in_typeidChange) {\n changesByKeys[key][`${in_changePrefix}Typeid`] = in_typeidChange;\n }\n\n // Store the ChangeSet\n if (in_changePrefix === \"other\") {\n if (!Array.isArray(in_collection)) {\n changesByKeys[key].change = in_collection[key];\n } else {\n changesByKeys[key].change = key;\n }\n }\n }\n };\n\n // Helper function which adds the Changes for a ChangeSet that is ordered by typeid\n const addChangesWithTypeids = function(in_collection, in_changeIdentifier, in_changePrefix) {\n if (in_collection === undefined) {\n return;\n }\n // Iterate over the typeids (or use dummy entry for the iteration\n const addedKeyTypeids = Object.keys(in_collection);\n for (let i = 0; i < addedKeyTypeids.length; i++) {\n const Typeid = addedKeyTypeids[i];\n addChanges(in_collection[Typeid], in_changeIdentifier, in_changePrefix, Typeid);\n }\n };\n\n // Insert all changes from the ChangeSet into the lookup map\n if (Array.isArray(in_ownPropertyChangeSet.remove)) {\n addChanges(in_ownPropertyChangeSet.remove, \"remove\", \"own\");\n } else {\n if (isPrimitiveTypeid) {\n addChanges(in_ownPropertyChangeSet.remove, \"remove\", \"own\");\n } else {\n addChangesWithTypeids(in_ownPropertyChangeSet.remove, \"remove\", \"own\");\n }\n }\n\n if (Array.isArray(io_rebasePropertyChangeSet.remove)) {\n addChanges(io_rebasePropertyChangeSet.remove, \"remove\", \"other\");\n } else {\n if (isPrimitiveTypeid) {\n addChanges(io_rebasePropertyChangeSet.remove, \"remove\", \"other\");\n } else {\n addChangesWithTypeids(io_rebasePropertyChangeSet.remove, \"remove\", \"other\");\n }\n }\n\n if (isPrimitiveTypeid) {\n addChanges(in_ownPropertyChangeSet.insert, \"insert\", \"own\");\n addChanges(in_ownPropertyChangeSet.modify, \"modify\", \"own\");\n addChanges(io_rebasePropertyChangeSet.insert, \"insert\", \"other\");\n addChanges(io_rebasePropertyChangeSet.modify, \"modify\", \"other\");\n } else {\n addChangesWithTypeids(in_ownPropertyChangeSet.insert, \"insert\", \"own\");\n addChangesWithTypeids(in_ownPropertyChangeSet.modify, \"modify\", \"own\");\n addChangesWithTypeids(io_rebasePropertyChangeSet.insert, \"insert\", \"other\");\n addChangesWithTypeids(io_rebasePropertyChangeSet.modify, \"modify\", \"other\");\n }\n\n // Check for modifications that affect the same object\n const changedKeys = Object.keys(changesByKeys);\n for (let i = 0; i < changedKeys.length; i++) {\n const key = changedKeys[i];\n const newPath = in_useSquareBracketsInPath ?\n `${in_basePath}[${PathHelper.quotePathSegmentIfNeeded(key)}]` :\n joinPaths(in_basePath, PathHelper.quotePathSegmentIfNeeded(key), PROPERTY_PATH_DELIMITER);\n\n const modification = changesByKeys[key];\n if (modification.own && modification.other) {\n /*\n We found a key that was changed by both ChangeSets at the same time\n We now have to handle the conflicting changes. The changes we do, are summarized in this table:\n\n <START REBASE HANDLING TABLE>\n +-------+-----------------+------------------+-------------------+-------------------------------------+\n | \\Own| insert | modify | remove | remove+insert |\n | \\ | | | | |\n |other\\ | | | | |\n +=======+=================+==================+===================+=====================================+\n | | conflicting | incompatible | incompatible | incompatible |\n |insert | inserts | psets | psets | psets |\n | | | | | |\n +-------+-----------------+------------------+-------------------+-------------------------------------+\n | | incompatible | merge recursively| conflict | conflict |\n |modify | psets | (conflicting on | | (modify can not be applied due to |\n | | | leaf) | - delete modify | to incompatible base) |\n | | | | in other | |\n | | | | | - delete modify in other |\n +-------+-----------------+------------------+-------------------+-------------------------------------+\n | | incompatible | non-conflicting | non-conflicting | incompatible |\n |remove | psets | change | change | psets |\n | | | | | |\n | | | | - rem dupl. remove| |\n +-------+-----------------+------------------+-------------------+-------------------------------------+\n | | incompatible | non-conflicting | non-conflicting | conflict |\n |remove+| psets | change | change | |\n |insert | | | | - remove conflicting insert |\n | | | | - rem dupl. remove| |\n +-------+-----------------+------------------+-------------------+-------------------------------------+\n <END REBASE HANDLING TABLE>\n */\n\n // A key was modified after it had been removed\n if (modification.own === \"modify\" && modification.other === \"modify\") {\n if (isPrimitiveTypeid ||\n (TypeIdHelper.isPrimitiveType(modification.ownTypeid) && modification.ownTypeid !== \"String\")) {\n // We have two modification operations that affect the same entry for a base type.\n // This is a legal operation, the second one will overwrite the first one, but we\n // report it as a possible conflict\n let ownModify = in_ownPropertyChangeSet.modify;\n let rebasedModify = io_rebasePropertyChangeSet.modify;\n if (modification.otherTypeid) {\n ownModify = ownModify[modification.otherTypeid];\n rebasedModify = rebasedModify[modification.otherTypeid];\n }\n\n let conflict = {\n path: newPath,\n type: ConflictType.COLLIDING_SET,\n conflictingChange: ownModify[key],\n };\n out_conflicts.push(conflict);\n // If value is the same, delete the entry\n let ownValue = ownModify[key];\n if (typeof ownValue === \"object\" && ownValue.hasOwnProperty(\"value\")) {\n ownValue = ownValue.value;\n }\n let rebaseValue = rebasedModify[key];\n if (typeof rebaseValue === \"object\" && rebaseValue.hasOwnProperty(\"value\")) {\n rebaseValue = rebaseValue.value;\n }\n if (modification.ownTypeid === \"Int64\" || modification.ownTypeid === \"Uint64\" || ownValue.length === 2) {\n // For (u)int64, values are arrays of 2 elements\n if (ownValue[0] === rebaseValue[0] && ownValue[1] === rebaseValue[1]) {\n delete rebasedModify[key];\n }\n } else {\n if (ownValue === rebaseValue) {\n delete rebasedModify[key];\n }\n }\n } else {\n this.rebaseChangeSetForPropertyEntryWithTypeid(key,\n in_ownPropertyChangeSet.modify[modification.ownTypeid],\n io_rebasePropertyChangeSet.modify[modification.otherTypeid],\n modification.ownTypeid,\n newPath,\n true,\n out_conflicts,\n in_options);\n }\n } else if (modification.own === \"remove\" && modification.other === \"modify\") {\n modifyMap = modification.otherTypeid ? io_rebasePropertyChangeSet.modify[modification.otherTypeid] :\n io_rebasePropertyChangeSet.modify;\n\n // Create the conflict information\n let conflict = {\n path: newPath,\n type: ConflictType.ENTRY_MODIFIED_AFTER_REMOVE,\n conflictingChange: modifyMap[key],\n };\n out_conflicts.push(conflict);\n\n // Delete the modification from the rebased ChangeSet\n delete modifyMap[key];\n } else if (modification.own === \"remove_insert\" && modification.other === \"modify\") {\n // We have a conflicting change. A node was removed and inserted (replaced) in the original\n // ChangeSet and then modified by the rebased ChangeSet. Since the base of the modification\n // can have been changed significantly by this operation, we don't know whether we can\n // apply the modification\n\n // Create the conflict information\n let conflict = {\n path: newPath,\n type: ConflictType.ENTRY_MODIFICATION_AFTER_REMOVE_INSERT,\n conflictingChange: io_rebasePropertyChangeSet.modify[modification.otherTypeid][key],\n };\n out_conflicts.push(conflict);\n\n // Delete the modification from the rebased ChangeSet\n delete io_rebasePropertyChangeSet.modify[key];\n } else if ((modification.own === \"modify\" || modification.own === \"remove\") &&\n (modification.other === \"remove\" || modification.other === \"remove_insert\")) {\n if (modification.own === \"modify\") {\n modifyMap = modification.ownTypeid ? in_ownPropertyChangeSet.modify[modification.ownTypeid] :\n in_ownPropertyChangeSet.modify;\n\n // Create the conflict information\n let conflict = {\n path: newPath,\n type: ConflictType.REMOVE_AFTER_MODIFY,\n conflictingChange: modifyMap[key],\n };\n out_conflicts.push(conflict);\n }\n\n // If we have a duplicated delete, we remove it from the new ChangeSet\n if (modification.own === \"remove\") {\n if (Array.isArray(io_rebasePropertyChangeSet.remove)) {\n io_rebasePropertyChangeSet.remove = without(io_rebasePropertyChangeSet.remove, key);\n } else {\n if (isPrimitiveTypeid) {\n delete io_rebasePropertyChangeSet.remove[key];\n } else {\n delete io_rebasePropertyChangeSet.remove[modification.otherTypeid][key];\n }\n }\n }\n } else if (modification.own === \"insert\" && modification.other === \"insert\") {\n if (isPrimitiveTypeid ||\n (TypeIdHelper.isPrimitiveType(modification.ownTypeid))) {\n let insertMap = modification.otherTypeid ? io_rebasePropertyChangeSet.insert[modification.otherTypeid] :\n io_rebasePropertyChangeSet.insert;\n\n // We have two insert operations that affect the same key for a primitive type.\n // This is a legal operation, the second one will overwrite the first one, but we\n // report it as a possible conflicting set\n let conflict = {\n path: newPath,\n type: ConflictType.COLLIDING_SET,\n conflictingChange: insertMap[key],\n };\n out_conflicts.push(conflict);\n\n // Convert to modify\n let oldValue;\n if (modification.otherTypeid) {\n io_rebasePropertyChangeSet.modify = io_rebasePropertyChangeSet.modify || {};\n io_rebasePropertyChangeSet.modify[modification.otherTypeid] =\n io_rebasePropertyChangeSet.modify[modification.otherTypeid] || {};\n modifyMap = io_rebasePropertyChangeSet.modify[modification.otherTypeid];\n oldValue = in_ownPropertyChangeSet.insert[modification.ownTypeid][key];\n } else {\n io_rebasePropertyChangeSet.modify = io_rebasePropertyChangeSet.modify || {};\n modifyMap = io_rebasePropertyChangeSet.modify;\n oldValue = in_ownPropertyChangeSet.insert[key];\n }\n\n modifyMap[key] = { value: insertMap[key], oldValue };\n delete insertMap[key];\n } else {\n // Here we have two insert operations for objects. Since these affect a whole sub-tree and not\n // just a single value, we cannot easily convert it into a modify and instead report it as invalid\n\n let insertMap = modification.otherTypeid ? io_rebasePropertyChangeSet.insert[modification.otherTypeid] :\n io_rebasePropertyChangeSet.insert;\n\n // Create the conflict information\n let conflict = {\n path: newPath,\n type: ConflictType.INSERTED_ENTRY_WITH_SAME_KEY,\n conflictingChange: insertMap[key],\n };\n out_conflicts.push(conflict);\n\n // Delete the modification from the rebased ChangeSet\n delete insertMap[key];\n }\n } else if (modification.own === \"remove_insert\" && modification.other === \"remove_insert\") {\n let insertMap = modification.otherTypeid ? io_rebasePropertyChangeSet.insert[modification.otherTypeid] :\n io_rebasePropertyChangeSet.insert;\n\n // Raise the duplicate inserts as a conflict\n let conflict = {\n path: newPath,\n type: ConflictType.COLLIDING_SET,\n conflictingChange: insertMap[key],\n };\n out_conflicts.push(conflict);\n } else {\n // All other operations are conflicting changes, which only occur for ChangeSets that are relative\n // to different bases\n\n // Create the conflict information\n let conflict = {\n path: newPath,\n type: ConflictType.INVALID_CHANGESET_BASE,\n conflictingChange: modification.change,\n };\n out_conflicts.push(conflict);\n\n // Remove the change from the ChangeSet\n if (modification.other !== \"remove\") {\n if (modification.otherTypeid !== undefined) {\n delete io_rebasePropertyChangeSet[modification.other][modification.otherTypeid][key];\n } else {\n delete io_rebasePropertyChangeSet[modification.other][key];\n }\n } else {\n // Remove remove operations from the ChangeSet\n if (Array.isArray(io_rebasePropertyChangeSet[modification.other])) {\n io_rebasePropertyChangeSet[modification.other] =\n without(io_rebasePropertyChangeSet[modification.other], key);\n } else {\n delete io_rebasePropertyChangeSet[modification.other][key];\n }\n }\n\n console.error(\"Rebase operation with conflicting ChangeSets. Probably incorrect bases.\");\n }\n }\n }\n\n // Remove unnecessary entries from the ChangeSet\n this._cleanIndexedCollectionChangeSet(io_rebasePropertyChangeSet, !isPrimitiveTypeid);\n };\n\n /**\n * Removes empty entries from the .children collection of the ChangeSet\n *\n * @param in_propertyChanges - The ChangeSet to clean up\n * @param in_containsTypeids - Does this ChangeSet contain typeids\n * @private\n */\n export const _cleanIndexedCollectionChangeSet = function(in_propertyChanges: SerializedChangeSet, in_containsTypeids: boolean) {\n const changes = in_propertyChanges;\n // Clean inserts\n\n // First remove unused typeid sections\n if (in_containsTypeids) {\n let typeidList = Object.keys(changes.insert || {});\n for (let j = 0; j < typeidList.length; j++) {\n if (_fastIsEmptyObject(changes.insert[typeidList[j]])) {\n delete changes.insert[typeidList[j]];\n }\n }\n }\n\n // Remove add group if no operations are present\n if (_fastIsEmptyObject(changes.insert)) {\n delete changes.insert;\n }\n\n // First remove unused typeid sections\n if (in_containsTypeids) {\n let typeidList = Object.keys(changes.remove || {});\n for (let j = 0; j < typeidList.length; j++) {\n if (_fastIsEmptyObject(changes.remove[typeidList[j]])) {\n delete changes.remove[typeidList[j]];\n }\n }\n }\n // Remove remove group if no operations are present\n if (_fastIsEmptyObject(changes.remove)) {\n delete changes.remove;\n }\n\n // Clean modifies\n\n // First remove unused typeid sections\n if (in_containsTypeids) {\n let typeidList = Object.keys(changes.modify || {});\n for (let j = 0; j < typeidList.length; j++) {\n const modifies = changes.modify[typeidList[j]];\n const modifyKeys = Object.keys(modifies);\n for (let k = 0; k < modifyKeys.length; k++) {\n if (isEmptyChangeSet(modifies[modifyKeys[k]])) {\n delete modifies[modifyKeys[k]];\n }\n }\n if (_fastIsEmptyObject(changes.modify[typeidList[j]])) {\n delete changes.modify[typeidList[j]];\n }\n }\n }\n\n // Remove modify group if no operations are present\n if (_fastIsEmptyObject(changes.modify)) {\n delete changes.modify;\n }\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"isEmptyChangeset.js","sourceRoot":"","sources":["../../src/changeset_operations/isEmptyChangeset.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH;;GAEG;AAEF,OAAO,OAAO,MAAM,gBAAgB,CAAC;AACrC,OAAO,GAAG,MAAM,YAAY,CAAC;AAC7B,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AAIxC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,YAAiC,EAAW,EAAE,CAAC,YAAY,KAAK,SAAS;IAClG,CAAC,QAAQ,CAAC,YAAY,CAAC;QACnB,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,MAAM,KAAK,CAAC,IAAI,GAAG,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/**\n * @fileoverview Helper function to check whether a changeset is empty\n */\n\n import isEmpty from \"lodash/isEmpty\";\n import has from \"lodash/has\";\n import isObject from \"lodash/isObject\";\n\n import { SerializedChangeSet } from \"../changeset\";\n\n/**\n * Helper function which checks whether a given serialized changeSet is an empty changeSet.\n *\n * @param in_changeSet - The changeset to test\n * @returns True if it is an empty changeset.\n */\nexport const isEmptyChangeSet = (in_changeSet: SerializedChangeSet): boolean => in_changeSet === undefined ||\n (isObject(in_changeSet) &&\n (isEmpty(in_changeSet) || (Object.keys(in_changeSet).length === 1 && has(in_changeSet, \"typeid\"))));\n\n"]}
1
+ {"version":3,"file":"isEmptyChangeset.js","sourceRoot":"","sources":["../../src/changeset_operations/isEmptyChangeset.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH;;GAEG;AAEF,OAAO,OAAO,MAAM,gBAAgB,CAAC;AACrC,OAAO,GAAG,MAAM,YAAY,CAAC;AAC7B,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AAIxC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,YAAiC,EAAW,EAAE,CAAC,YAAY,KAAK,SAAS;IAClG,CAAC,QAAQ,CAAC,YAAY,CAAC;QACnB,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,MAAM,KAAK,CAAC,IAAI,GAAG,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/**\n * @fileoverview Helper function to check whether a changeset is empty\n */\n\n import isEmpty from \"lodash/isEmpty\";\n import has from \"lodash/has\";\n import isObject from \"lodash/isObject\";\n\n import { SerializedChangeSet } from \"../changeset\";\n\n/**\n * Helper function which checks whether a given serialized changeSet is an empty changeSet.\n *\n * @param in_changeSet - The changeset to test\n * @returns True if it is an empty changeset.\n */\nexport const isEmptyChangeSet = (in_changeSet: SerializedChangeSet): boolean => in_changeSet === undefined ||\n (isObject(in_changeSet) &&\n (isEmpty(in_changeSet) || (Object.keys(in_changeSet).length === 1 && has(in_changeSet, \"typeid\"))));\n"]}
@@ -14,5 +14,4 @@ export var ArrayIteratorOperationTypes;
14
14
  // MOVE, // reserved, not implemented yet
15
15
  ArrayIteratorOperationTypes[ArrayIteratorOperationTypes["NOP"] = 3] = "NOP";
16
16
  })(ArrayIteratorOperationTypes || (ArrayIteratorOperationTypes = {}));
17
- ;
18
17
  //# sourceMappingURL=operationTypes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"operationTypes.js","sourceRoot":"","sources":["../../src/changeset_operations/operationTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,MAAM,CAAN,IAAY,2BAMX;AAND,WAAY,2BAA2B;IACnC,iFAAM,CAAA;IACN,iFAAM,CAAA;IACN,iFAAM,CAAA;IACN,yCAAyC;IACzC,2EAAG,CAAA;AACP,CAAC,EANW,2BAA2B,KAA3B,2BAA2B,QAMtC;AAAA,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Iterator types\n * The operations that can be performed on the array\n */\nexport enum ArrayIteratorOperationTypes {\n INSERT,\n REMOVE,\n MODIFY,\n // MOVE, // reserved, not implemented yet\n NOP\n};\n"]}
1
+ {"version":3,"file":"operationTypes.js","sourceRoot":"","sources":["../../src/changeset_operations/operationTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,MAAM,CAAN,IAAY,2BAMX;AAND,WAAY,2BAA2B;IACnC,iFAAM,CAAA;IACN,iFAAM,CAAA;IACN,iFAAM,CAAA;IACN,yCAAyC;IACzC,2EAAG,CAAA;AACP,CAAC,EANW,2BAA2B,KAA3B,2BAA2B,QAMtC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Iterator types\n * The operations that can be performed on the array\n */\nexport enum ArrayIteratorOperationTypes {\n INSERT,\n REMOVE,\n MODIFY,\n // MOVE, // reserved, not implemented yet\n NOP,\n}\n"]}
@@ -5,9 +5,9 @@
5
5
  /**
6
6
  * @fileoverview Helper functions to work with typeid strings
7
7
  */
8
- import { TemplateSchema as templateSchemaJson, NativeTypes } from "../templateSchema";
9
8
  // @ts-ignore
10
9
  import { constants } from "@fluid-experimental/property-common";
10
+ import { TemplateSchema as templateSchemaJson, NativeTypes } from "../templateSchema";
11
11
  const { MSG } = constants;
12
12
  /**
13
13
  * Helper for Type IDs
@@ -65,7 +65,7 @@ export var TypeIdHelper;
65
65
  const splitTypeId = in_typeid.split("-");
66
66
  return {
67
67
  version: splitTypeId[1],
68
- typeidWithoutVersion: splitTypeId[0]
68
+ typeidWithoutVersion: splitTypeId[0],
69
69
  };
70
70
  }
71
71
  TypeIdHelper.extractVersion = extractVersion;
@@ -105,14 +105,14 @@ export var TypeIdHelper;
105
105
  return {
106
106
  typeid,
107
107
  context,
108
- isEnum
108
+ isEnum,
109
109
  };
110
110
  }
111
111
  else {
112
112
  return {
113
113
  typeid: in_typeid,
114
114
  context: "single",
115
- isEnum: false
115
+ isEnum: false,
116
116
  };
117
117
  }
118
118
  }
@@ -264,5 +264,4 @@ export var TypeIdHelper;
264
264
  }
265
265
  TypeIdHelper.getReservedTypeIds = getReservedTypeIds;
266
266
  })(TypeIdHelper || (TypeIdHelper = {}));
267
- ;
268
267
  //# sourceMappingURL=typeidHelper.js.map