@fluidframework/sequence 2.32.0 → 2.33.0-333010

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 (35) hide show
  1. package/dist/intervalCollection.d.ts +7 -5
  2. package/dist/intervalCollection.d.ts.map +1 -1
  3. package/dist/intervalCollection.js +59 -46
  4. package/dist/intervalCollection.js.map +1 -1
  5. package/dist/intervalCollectionMap.d.ts +4 -4
  6. package/dist/intervalCollectionMap.d.ts.map +1 -1
  7. package/dist/intervalCollectionMap.js +16 -50
  8. package/dist/intervalCollectionMap.js.map +1 -1
  9. package/dist/intervalCollectionMapInterfaces.d.ts +21 -15
  10. package/dist/intervalCollectionMapInterfaces.d.ts.map +1 -1
  11. package/dist/intervalCollectionMapInterfaces.js.map +1 -1
  12. package/dist/packageVersion.d.ts +1 -1
  13. package/dist/packageVersion.d.ts.map +1 -1
  14. package/dist/packageVersion.js +1 -1
  15. package/dist/packageVersion.js.map +1 -1
  16. package/lib/intervalCollection.d.ts +7 -5
  17. package/lib/intervalCollection.d.ts.map +1 -1
  18. package/lib/intervalCollection.js +60 -47
  19. package/lib/intervalCollection.js.map +1 -1
  20. package/lib/intervalCollectionMap.d.ts +4 -4
  21. package/lib/intervalCollectionMap.d.ts.map +1 -1
  22. package/lib/intervalCollectionMap.js +17 -51
  23. package/lib/intervalCollectionMap.js.map +1 -1
  24. package/lib/intervalCollectionMapInterfaces.d.ts +21 -15
  25. package/lib/intervalCollectionMapInterfaces.d.ts.map +1 -1
  26. package/lib/intervalCollectionMapInterfaces.js.map +1 -1
  27. package/lib/packageVersion.d.ts +1 -1
  28. package/lib/packageVersion.d.ts.map +1 -1
  29. package/lib/packageVersion.js +1 -1
  30. package/lib/packageVersion.js.map +1 -1
  31. package/package.json +16 -16
  32. package/src/intervalCollection.ts +76 -54
  33. package/src/intervalCollectionMap.ts +19 -61
  34. package/src/intervalCollectionMapInterfaces.ts +33 -29
  35. package/src/packageVersion.ts +1 -1
@@ -10,7 +10,6 @@ const internal_1 = require("@fluidframework/core-utils/internal");
10
10
  const internal_2 = require("@fluidframework/shared-object-base/internal");
11
11
  const IntervalCollectionValues_js_1 = require("./IntervalCollectionValues.js");
12
12
  const intervalCollection_js_1 = require("./intervalCollection.js");
13
- const index_js_1 = require("./intervals/index.js");
14
13
  function isMapOperation(op) {
15
14
  return typeof op === "object" && op !== null && "type" in op && op.type === "act";
16
15
  }
@@ -116,59 +115,28 @@ class IntervalCollectionMap {
116
115
  }
117
116
  /**
118
117
  * Submit the given op if a handler is registered.
119
- * @param op - The operation to attempt to submit
118
+ * @param content - The operation to attempt to submit
120
119
  * @param localOpMetadata - The local metadata associated with the op. This is kept locally by the runtime
121
120
  * and not sent to the server. This will be sent back when this message is received back from the server. This is
122
121
  * also sent if we are asked to resubmit the message.
123
122
  * @returns True if the operation was submitted, false otherwise.
124
123
  */
125
- tryResubmitMessage(op, localOpMetadata) {
126
- if (isMapOperation(op)) {
127
- const localValue = this.data.get(op.key);
124
+ tryResubmitMessage(content, localOpMetadata) {
125
+ if (isMapOperation(content)) {
126
+ const { value, key } = content;
127
+ const localValue = this.data.get(key);
128
128
  (0, internal_1.assert)(localValue !== undefined, 0x3f8 /* Local value expected on resubmission */);
129
- const handler = intervalCollection_js_1.opsMap[op.value.opName];
130
- const rebased = handler.rebase(localValue, op.value, localOpMetadata);
131
- if (rebased !== undefined) {
132
- const { rebasedOp, rebasedLocalOpMetadata } = rebased;
133
- this.submitMessage({ ...op, value: rebasedOp }, rebasedLocalOpMetadata);
134
- }
129
+ localValue.resubmitMessage(value, localOpMetadata);
135
130
  return true;
136
131
  }
137
132
  return false;
138
133
  }
139
- tryApplyStashedOp(op) {
140
- if (isMapOperation(op)) {
141
- const { value, key } = op;
134
+ tryApplyStashedOp(content) {
135
+ if (isMapOperation(content)) {
136
+ const { value, key } = content;
142
137
  const map = this.get(key);
143
- const { id, properties } = (0, index_js_1.getSerializedProperties)(value.value);
144
- switch (value.opName) {
145
- case "add": {
146
- map.add({
147
- id,
148
- // Todo: we should improve typing so we know add ops always have start and end
149
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
150
- start: (0, intervalCollection_js_1.toSequencePlace)(value.value.start, value.value.startSide),
151
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
152
- end: (0, intervalCollection_js_1.toSequencePlace)(value.value.end, value.value.endSide),
153
- props: properties,
154
- });
155
- return true;
156
- }
157
- case "change": {
158
- map.change(id, {
159
- start: (0, intervalCollection_js_1.toOptionalSequencePlace)(value.value.start, value.value.startSide),
160
- end: (0, intervalCollection_js_1.toOptionalSequencePlace)(value.value.end, value.value.endSide),
161
- props: properties,
162
- });
163
- return true;
164
- }
165
- case "delete": {
166
- map.removeIntervalById(id);
167
- return true;
168
- }
169
- default:
170
- throw new Error("unknown ops should not be stashed");
171
- }
138
+ map.applyStashedOp(value);
139
+ return true;
172
140
  }
173
141
  return false;
174
142
  }
@@ -187,13 +155,11 @@ class IntervalCollectionMap {
187
155
  * Therefore, in such cases the caller should typically throw an error, ensuring that this client treats the situation as data corruption
188
156
  * (since its data no longer matches what other clients think the data should be) and will avoid overriding document content or misleading the users into thinking their current state is accurate.
189
157
  */
190
- tryProcessMessage(op, local, message, localOpMetadata) {
191
- if (isMapOperation(op)) {
192
- const localValue = this.data.get(op.key) ?? this.createCore(op.key, local);
193
- const handler = intervalCollection_js_1.opsMap[op.value.opName];
194
- const previousValue = localValue;
195
- const translatedValue = op.value.value;
196
- handler.process(previousValue, translatedValue, local, message, localOpMetadata);
158
+ tryProcessMessage(content, local, message, localOpMetadata) {
159
+ if (isMapOperation(content)) {
160
+ const { value, key } = content;
161
+ const localValue = this.data.get(key) ?? this.createCore(key, local);
162
+ localValue.process(value, local, message, localOpMetadata);
197
163
  return true;
198
164
  }
199
165
  return false;
@@ -1 +1 @@
1
- {"version":3,"file":"intervalCollectionMap.js","sourceRoot":"","sources":["../src/intervalCollectionMap.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA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B,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,0BAA0B,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QAClF,OAAO,UAAU,CAAC;IACnB,CAAC;CACD;AA1PD,sDA0PC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport { IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport type { IEvent, IEventProvider } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\nimport { ValueType, IFluidSerializer } from \"@fluidframework/shared-object-base/internal\";\n\nimport { makeSerializable } from \"./IntervalCollectionValues.js\";\nimport {\n\tIntervalCollection,\n\topsMap,\n\ttoOptionalSequencePlace,\n\ttoSequencePlace,\n\ttype ISerializedIntervalCollectionV1,\n\ttype ISerializedIntervalCollectionV2,\n} from \"./intervalCollection.js\";\nimport {\n\tIIntervalCollectionTypeOperationValue,\n\tIMapMessageLocalMetadata,\n\tISerializableIntervalCollection,\n\tSequenceOptions,\n} from \"./intervalCollectionMapInterfaces.js\";\nimport { getSerializedProperties } from \"./intervals/index.js\";\n\nfunction isMapOperation(op: unknown): op is IMapOperation {\n\treturn typeof op === \"object\" && op !== null && \"type\" in op && op.type === \"act\";\n}\n\n/**\n * Description of a map delta operation\n */\nexport interface IMapOperation {\n\t/**\n\t * String identifier of the operation type.\n\t */\n\ttype: \"act\";\n\n\t/**\n\t * Map key being modified.\n\t */\n\tkey: string;\n\n\t/**\n\t * Value of the operation, specific to the value type.\n\t */\n\tvalue: IIntervalCollectionTypeOperationValue;\n}\n/**\n * Defines the in-memory object structure to be used for the conversion to/from serialized.\n * Directly used in JSON.stringify, direct result from JSON.parse\n */\nexport interface IMapDataObjectSerializable {\n\t[key: string]: ISerializableIntervalCollection;\n}\n\nexport interface IntervalCollectionMapEvents extends IEvent {\n\t(event: \"createIntervalCollection\", listener: (key: string, local: boolean) => void): void;\n}\n\n/**\n * A DefaultMap is a map-like distributed data structure, supporting operations on values stored by\n * string key locations.\n *\n * Creation of values is implicit on access (either via `get` or a remote op application referring to\n * a collection that wasn't previously known)\n */\nexport class IntervalCollectionMap {\n\t/**\n\t * The number of key/value pairs stored in the map.\n\t */\n\tpublic get size(): number {\n\t\treturn this.data.size;\n\t}\n\n\t/**\n\t * The in-memory data the map is storing.\n\t */\n\tprivate readonly data = new Map<string, IntervalCollection>();\n\n\tprivate readonly eventEmitter = new TypedEventEmitter<IntervalCollectionMapEvents>();\n\tpublic get events(): IEventProvider<IntervalCollectionMapEvents> {\n\t\treturn this.eventEmitter;\n\t}\n\n\t/**\n\t * Create a new default map.\n\t * @param serializer - The serializer to serialize / parse handles\n\t * @param handle - The handle of the shared object using the kernel\n\t * @param submitMessage - A callback to submit a message through the shared object\n\t * @param type - The value type to create at values of this map\n\t * @param eventEmitter - The object that will emit map events\n\t */\n\tconstructor(\n\t\tprivate readonly serializer: IFluidSerializer,\n\t\tprivate readonly handle: IFluidHandle,\n\t\tprivate readonly submitMessage: (\n\t\t\top: IMapOperation,\n\t\t\tlocalOpMetadata: IMapMessageLocalMetadata,\n\t\t) => void,\n\t\tprivate readonly options?: Partial<SequenceOptions>,\n\t) {}\n\n\t/**\n\t * Get an iterator over the keys in this map.\n\t * @returns The iterator\n\t */\n\tpublic keys(): IterableIterator<string> {\n\t\treturn this.data.keys();\n\t}\n\n\t/**\n\t * Get an iterator over the values in this map.\n\t * @returns The iterator\n\t */\n\tpublic values(): IterableIterator<any> {\n\t\tconst localValuesIterator = this.data.values();\n\t\tconst iterator = {\n\t\t\tnext(): IteratorResult<any> {\n\t\t\t\tconst nextVal = localValuesIterator.next();\n\t\t\t\treturn nextVal.done\n\t\t\t\t\t? { value: undefined, done: true }\n\t\t\t\t\t: { value: nextVal.value, done: false }; // Unpack the stored value\n\t\t\t},\n\t\t\t[Symbol.iterator]() {\n\t\t\t\treturn this;\n\t\t\t},\n\t\t};\n\t\treturn iterator;\n\t}\n\t/**\n\t * {@inheritDoc ISharedMap.get}\n\t */\n\tpublic get(key: string): IntervalCollection {\n\t\tconst localValue = this.data.get(key) ?? this.createCore(key, true);\n\n\t\treturn localValue;\n\t}\n\n\tpublic serialize(serializer: IFluidSerializer): string {\n\t\tconst serializableMapData: IMapDataObjectSerializable = {};\n\t\tthis.data.forEach((localValue, key) => {\n\t\t\tserializableMapData[key] = makeSerializable(\n\t\t\t\tlocalValue,\n\t\t\t\tserializer,\n\t\t\t\tthis.handle,\n\t\t\t\tthis.options?.intervalSerializationFormat ?? \"2\",\n\t\t\t);\n\t\t});\n\t\treturn JSON.stringify(serializableMapData);\n\t}\n\n\t/**\n\t * Populate the kernel with the given map data.\n\t *\n\t * @param serialized - A JSON string containing serialized map data\n\t */\n\tpublic populate(serialized: string): void {\n\t\tconst parsed = this.serializer.parse(serialized) as IMapDataObjectSerializable;\n\n\t\tfor (const [key, serializable] of Object.entries(parsed)) {\n\t\t\t// Back-compat: legacy documents may have handles to an intervalCollection map kernel.\n\t\t\t// These collections should be empty, and ValueTypes are no longer supported.\n\t\t\tif (\n\t\t\t\tserializable.type === ValueType[ValueType.Plain] ||\n\t\t\t\tserializable.type === ValueType[ValueType.Shared]\n\t\t\t) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Back-compat: Sequence previously arbitrarily prefixed all interval collection keys with\n\t\t\t// \"intervalCollections/\". This would burden users trying to iterate the collection and\n\t\t\t// access its value, as well as those trying to match a create message to its underlying\n\t\t\t// collection. See https://github.com/microsoft/FluidFramework/issues/10557 for more context.\n\t\t\tconst normalizedKey = key.startsWith(\"intervalCollections/\") ? key.substring(20) : key;\n\n\t\t\tassert(\n\t\t\t\tserializable.type !== ValueType[ValueType.Plain] &&\n\t\t\t\t\tserializable.type !== ValueType[ValueType.Shared],\n\t\t\t\t0x2e1 /* \"Support for plain value types removed.\" */,\n\t\t\t);\n\n\t\t\tthis.createCore(normalizedKey, false, serializable.value);\n\t\t}\n\t}\n\n\t/**\n\t * Submit the given op if a handler is registered.\n\t * @param op - The operation to attempt to submit\n\t * @param localOpMetadata - The local metadata associated with the op. This is kept locally by the runtime\n\t * and not sent to the server. This will be sent back when this message is received back from the server. This is\n\t * also sent if we are asked to resubmit the message.\n\t * @returns True if the operation was submitted, false otherwise.\n\t */\n\tpublic tryResubmitMessage(op: unknown, localOpMetadata: IMapMessageLocalMetadata): boolean {\n\t\tif (isMapOperation(op)) {\n\t\t\tconst localValue = this.data.get(op.key);\n\n\t\t\tassert(localValue !== undefined, 0x3f8 /* Local value expected on resubmission */);\n\n\t\t\tconst handler = opsMap[op.value.opName];\n\t\t\tconst rebased = handler.rebase(localValue, op.value, localOpMetadata);\n\t\t\tif (rebased !== undefined) {\n\t\t\t\tconst { rebasedOp, rebasedLocalOpMetadata } = rebased;\n\t\t\t\tthis.submitMessage({ ...op, value: rebasedOp }, rebasedLocalOpMetadata);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic tryApplyStashedOp(op: unknown): boolean {\n\t\tif (isMapOperation(op)) {\n\t\t\tconst { value, key } = op;\n\t\t\tconst map = this.get(key);\n\t\t\tconst { id, properties } = getSerializedProperties(value.value);\n\n\t\t\tswitch (value.opName) {\n\t\t\t\tcase \"add\": {\n\t\t\t\t\tmap.add({\n\t\t\t\t\t\tid,\n\t\t\t\t\t\t// Todo: we should improve typing so we know add ops always have start and end\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\t\t\tstart: toSequencePlace(value.value.start!, value.value.startSide),\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\t\t\tend: toSequencePlace(value.value.end!, value.value.endSide),\n\t\t\t\t\t\tprops: properties,\n\t\t\t\t\t});\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tcase \"change\": {\n\t\t\t\t\tmap.change(id, {\n\t\t\t\t\t\tstart: toOptionalSequencePlace(value.value.start, value.value.startSide),\n\t\t\t\t\t\tend: toOptionalSequencePlace(value.value.end, value.value.endSide),\n\t\t\t\t\t\tprops: properties,\n\t\t\t\t\t});\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tcase \"delete\": {\n\t\t\t\t\tmap.removeIntervalById(id);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error(\"unknown ops should not be stashed\");\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * Process the given op if a handler is registered.\n\t * @param message - The message to process\n\t * @param local - Whether the message originated from the local client\n\t * @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.\n\t * For messages from a remote client, this will be undefined.\n\t * @returns True if the operation was recognized and thus processed, false otherwise.\n\t *\n\t * @remarks\n\t * When this returns false and the caller doesn't handle the op itself, then the op could be from a different version of this code.\n\t * In such a case, not applying the op would result in this client becoming out of sync with clients that do handle the op\n\t * and could result in data corruption or data loss as well.\n\t * Therefore, in such cases the caller should typically throw an error, ensuring that this client treats the situation as data corruption\n\t * (since its data no longer matches what other clients think the data should be) and will avoid overriding document content or misleading the users into thinking their current state is accurate.\n\t */\n\tpublic tryProcessMessage(\n\t\top: unknown,\n\t\tlocal: boolean,\n\t\tmessage: ISequencedDocumentMessage,\n\t\tlocalOpMetadata: unknown,\n\t): boolean {\n\t\tif (isMapOperation(op)) {\n\t\t\tconst localValue = this.data.get(op.key) ?? this.createCore(op.key, local);\n\t\t\tconst handler = opsMap[op.value.opName];\n\t\t\tconst previousValue = localValue;\n\t\t\tconst translatedValue = op.value.value as any;\n\t\t\thandler.process(\n\t\t\t\tpreviousValue,\n\t\t\t\ttranslatedValue,\n\t\t\t\tlocal,\n\t\t\t\tmessage,\n\t\t\t\tlocalOpMetadata as IMapMessageLocalMetadata,\n\t\t\t);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * Initializes a default ValueType at the provided key.\n\t * Should be used when a map operation incurs creation.\n\t * @param key - The key being initialized\n\t */\n\tprivate createCore(\n\t\tkey: string,\n\t\tlocal: boolean,\n\t\tserializedIntervals?: ISerializedIntervalCollectionV1 | ISerializedIntervalCollectionV2,\n\t): IntervalCollection {\n\t\tconst localValue = new IntervalCollection(\n\t\t\t(op, md) => {\n\t\t\t\t{\n\t\t\t\t\tthis.submitMessage(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\ttype: \"act\",\n\t\t\t\t\t\t\tvalue: op,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tmd,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t},\n\t\t\tserializedIntervals ?? [],\n\t\t\tthis.options,\n\t\t);\n\t\tthis.data.set(key, localValue);\n\t\tthis.eventEmitter.emit(\"createIntervalCollection\", key, local, this.eventEmitter);\n\t\treturn localValue;\n\t}\n}\n"]}
1
+ {"version":3,"file":"intervalCollectionMap.js","sourceRoot":"","sources":["../src/intervalCollectionMap.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAiE;AAGjE,kEAA6D;AAE7D,0EAA0F;AAE1F,+EAAiE;AACjE,mEAIiC;AAQjC,SAAS,cAAc,CAAC,EAAW;IAClC,OAAO,OAAO,EAAE,KAAK,QAAQ,IAAI,EAAE,KAAK,IAAI,IAAI,MAAM,IAAI,EAAE,IAAI,EAAE,CAAC,IAAI,KAAK,KAAK,CAAC;AACnF,CAAC;AAiCD;;;;;;GAMG;AACH,MAAa,qBAAqB;IACjC;;OAEG;IACH,IAAW,IAAI;QACd,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;IACvB,CAAC;IAQD,IAAW,MAAM;QAChB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC1B,CAAC;IAED;;;;;;;OAOG;IACH,YACkB,UAA4B,EAC5B,MA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,CAAC;IACd,CAAC;IAED;;;;OAIG;IACK,UAAU,CACjB,GAAW,EACX,KAAc,EACd,mBAAuF;QAEvF,MAAM,UAAU,GAAG,IAAI,0CAAkB,CACxC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;YACV,CAAC;gBACA,IAAI,CAAC,aAAa,CACjB;oBACC,GAAG;oBACH,IAAI,EAAE,KAAK;oBACX,KAAK,EAAE,EAAE;iBACT,EACD,EAAE,CACF,CAAC;YACH,CAAC;QACF,CAAC,EACD,mBAAmB,IAAI,EAAE,EACzB,IAAI,CAAC,OAAO,CACZ,CAAC;QACF,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;QAC/B,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,0BAA0B,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QAClF,OAAO,UAAU,CAAC;IACnB,CAAC;CACD;AApND,sDAoNC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport { IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport type { IEvent, IEventProvider } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\nimport { ValueType, IFluidSerializer } from \"@fluidframework/shared-object-base/internal\";\n\nimport { makeSerializable } from \"./IntervalCollectionValues.js\";\nimport {\n\tIntervalCollection,\n\ttype ISerializedIntervalCollectionV1,\n\ttype ISerializedIntervalCollectionV2,\n} from \"./intervalCollection.js\";\nimport {\n\tIIntervalCollectionTypeOperationValue,\n\tIMapMessageLocalMetadata,\n\tISerializableIntervalCollection,\n\tSequenceOptions,\n} from \"./intervalCollectionMapInterfaces.js\";\n\nfunction isMapOperation(op: unknown): op is IMapOperation {\n\treturn typeof op === \"object\" && op !== null && \"type\" in op && op.type === \"act\";\n}\n\n/**\n * Description of a map delta operation\n */\nexport interface IMapOperation {\n\t/**\n\t * String identifier of the operation type.\n\t */\n\ttype: \"act\";\n\n\t/**\n\t * Map key being modified.\n\t */\n\tkey: string;\n\n\t/**\n\t * Value of the operation, specific to the value type.\n\t */\n\tvalue: IIntervalCollectionTypeOperationValue;\n}\n/**\n * Defines the in-memory object structure to be used for the conversion to/from serialized.\n * Directly used in JSON.stringify, direct result from JSON.parse\n */\nexport interface IMapDataObjectSerializable {\n\t[key: string]: ISerializableIntervalCollection;\n}\n\nexport interface IntervalCollectionMapEvents extends IEvent {\n\t(event: \"createIntervalCollection\", listener: (key: string, local: boolean) => void): void;\n}\n\n/**\n * A DefaultMap is a map-like distributed data structure, supporting operations on values stored by\n * string key locations.\n *\n * Creation of values is implicit on access (either via `get` or a remote op application referring to\n * a collection that wasn't previously known)\n */\nexport class IntervalCollectionMap {\n\t/**\n\t * The number of key/value pairs stored in the map.\n\t */\n\tpublic get size(): number {\n\t\treturn this.data.size;\n\t}\n\n\t/**\n\t * The in-memory data the map is storing.\n\t */\n\tprivate readonly data = new Map<string, IntervalCollection>();\n\n\tprivate readonly eventEmitter = new TypedEventEmitter<IntervalCollectionMapEvents>();\n\tpublic get events(): IEventProvider<IntervalCollectionMapEvents> {\n\t\treturn this.eventEmitter;\n\t}\n\n\t/**\n\t * Create a new default map.\n\t * @param serializer - The serializer to serialize / parse handles\n\t * @param handle - The handle of the shared object using the kernel\n\t * @param submitMessage - A callback to submit a message through the shared object\n\t * @param type - The value type to create at values of this map\n\t * @param eventEmitter - The object that will emit map events\n\t */\n\tconstructor(\n\t\tprivate readonly serializer: IFluidSerializer,\n\t\tprivate readonly handle: IFluidHandle,\n\t\tprivate readonly submitMessage: (\n\t\t\top: IMapOperation,\n\t\t\tlocalOpMetadata: IMapMessageLocalMetadata,\n\t\t) => void,\n\t\tprivate readonly options?: Partial<SequenceOptions>,\n\t) {}\n\n\t/**\n\t * Get an iterator over the keys in this map.\n\t * @returns The iterator\n\t */\n\tpublic keys(): IterableIterator<string> {\n\t\treturn this.data.keys();\n\t}\n\n\t/**\n\t * Get an iterator over the values in this map.\n\t * @returns The iterator\n\t */\n\tpublic values(): IterableIterator<any> {\n\t\tconst localValuesIterator = this.data.values();\n\t\tconst iterator = {\n\t\t\tnext(): IteratorResult<any> {\n\t\t\t\tconst nextVal = localValuesIterator.next();\n\t\t\t\treturn nextVal.done\n\t\t\t\t\t? { value: undefined, done: true }\n\t\t\t\t\t: { value: nextVal.value, done: false }; // Unpack the stored value\n\t\t\t},\n\t\t\t[Symbol.iterator]() {\n\t\t\t\treturn this;\n\t\t\t},\n\t\t};\n\t\treturn iterator;\n\t}\n\t/**\n\t * {@inheritDoc ISharedMap.get}\n\t */\n\tpublic get(key: string): IntervalCollection {\n\t\tconst localValue = this.data.get(key) ?? this.createCore(key, true);\n\n\t\treturn localValue;\n\t}\n\n\tpublic serialize(serializer: IFluidSerializer): string {\n\t\tconst serializableMapData: IMapDataObjectSerializable = {};\n\t\tthis.data.forEach((localValue, key) => {\n\t\t\tserializableMapData[key] = makeSerializable(\n\t\t\t\tlocalValue,\n\t\t\t\tserializer,\n\t\t\t\tthis.handle,\n\t\t\t\tthis.options?.intervalSerializationFormat ?? \"2\",\n\t\t\t);\n\t\t});\n\t\treturn JSON.stringify(serializableMapData);\n\t}\n\n\t/**\n\t * Populate the kernel with the given map data.\n\t *\n\t * @param serialized - A JSON string containing serialized map data\n\t */\n\tpublic populate(serialized: string): void {\n\t\tconst parsed = this.serializer.parse(serialized) as IMapDataObjectSerializable;\n\n\t\tfor (const [key, serializable] of Object.entries(parsed)) {\n\t\t\t// Back-compat: legacy documents may have handles to an intervalCollection map kernel.\n\t\t\t// These collections should be empty, and ValueTypes are no longer supported.\n\t\t\tif (\n\t\t\t\tserializable.type === ValueType[ValueType.Plain] ||\n\t\t\t\tserializable.type === ValueType[ValueType.Shared]\n\t\t\t) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Back-compat: Sequence previously arbitrarily prefixed all interval collection keys with\n\t\t\t// \"intervalCollections/\". This would burden users trying to iterate the collection and\n\t\t\t// access its value, as well as those trying to match a create message to its underlying\n\t\t\t// collection. See https://github.com/microsoft/FluidFramework/issues/10557 for more context.\n\t\t\tconst normalizedKey = key.startsWith(\"intervalCollections/\") ? key.substring(20) : key;\n\n\t\t\tassert(\n\t\t\t\tserializable.type !== ValueType[ValueType.Plain] &&\n\t\t\t\t\tserializable.type !== ValueType[ValueType.Shared],\n\t\t\t\t0x2e1 /* \"Support for plain value types removed.\" */,\n\t\t\t);\n\n\t\t\tthis.createCore(normalizedKey, false, serializable.value);\n\t\t}\n\t}\n\n\t/**\n\t * Submit the given op if a handler is registered.\n\t * @param content - The operation to attempt to submit\n\t * @param localOpMetadata - The local metadata associated with the op. This is kept locally by the runtime\n\t * and not sent to the server. This will be sent back when this message is received back from the server. This is\n\t * also sent if we are asked to resubmit the message.\n\t * @returns True if the operation was submitted, false otherwise.\n\t */\n\tpublic tryResubmitMessage(\n\t\tcontent: unknown,\n\t\tlocalOpMetadata: IMapMessageLocalMetadata,\n\t): boolean {\n\t\tif (isMapOperation(content)) {\n\t\t\tconst { value, key } = content;\n\t\t\tconst localValue = this.data.get(key);\n\t\t\tassert(localValue !== undefined, 0x3f8 /* Local value expected on resubmission */);\n\t\t\tlocalValue.resubmitMessage(value, localOpMetadata);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic tryApplyStashedOp(content: unknown): boolean {\n\t\tif (isMapOperation(content)) {\n\t\t\tconst { value, key } = content;\n\t\t\tconst map = this.get(key);\n\n\t\t\tmap.applyStashedOp(value);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * Process the given op if a handler is registered.\n\t * @param message - The message to process\n\t * @param local - Whether the message originated from the local client\n\t * @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.\n\t * For messages from a remote client, this will be undefined.\n\t * @returns True if the operation was recognized and thus processed, false otherwise.\n\t *\n\t * @remarks\n\t * When this returns false and the caller doesn't handle the op itself, then the op could be from a different version of this code.\n\t * In such a case, not applying the op would result in this client becoming out of sync with clients that do handle the op\n\t * and could result in data corruption or data loss as well.\n\t * Therefore, in such cases the caller should typically throw an error, ensuring that this client treats the situation as data corruption\n\t * (since its data no longer matches what other clients think the data should be) and will avoid overriding document content or misleading the users into thinking their current state is accurate.\n\t */\n\tpublic tryProcessMessage(\n\t\tcontent: unknown,\n\t\tlocal: boolean,\n\t\tmessage: ISequencedDocumentMessage,\n\t\tlocalOpMetadata: unknown,\n\t): boolean {\n\t\tif (isMapOperation(content)) {\n\t\t\tconst { value, key } = content;\n\t\t\tconst localValue = this.data.get(key) ?? this.createCore(key, local);\n\t\t\tlocalValue.process(value, local, message, localOpMetadata as IMapMessageLocalMetadata);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * Initializes a default ValueType at the provided key.\n\t * Should be used when a map operation incurs creation.\n\t * @param key - The key being initialized\n\t */\n\tprivate createCore(\n\t\tkey: string,\n\t\tlocal: boolean,\n\t\tserializedIntervals?: ISerializedIntervalCollectionV1 | ISerializedIntervalCollectionV2,\n\t): IntervalCollection {\n\t\tconst localValue = new IntervalCollection(\n\t\t\t(op, md) => {\n\t\t\t\t{\n\t\t\t\t\tthis.submitMessage(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\ttype: \"act\",\n\t\t\t\t\t\t\tvalue: op,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tmd,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t},\n\t\t\tserializedIntervals ?? [],\n\t\t\tthis.options,\n\t\t);\n\t\tthis.data.set(key, localValue);\n\t\tthis.eventEmitter.emit(\"createIntervalCollection\", key, local, this.eventEmitter);\n\t\treturn localValue;\n\t}\n}\n"]}
@@ -47,18 +47,6 @@ export interface IIntervalCollectionOperation {
47
47
  * @param localOpMetadata - any local metadata submitted by `IValueOpEmitter.emit`.
48
48
  */
49
49
  process(value: IntervalCollection, params: ISerializedInterval, local: boolean, message: ISequencedDocumentMessage | undefined, localOpMetadata: IMapMessageLocalMetadata | undefined): void;
50
- /**
51
- * Rebases an `op` on `value` from its original perspective (ref/local seq) to the current
52
- * perspective. Should be invoked on reconnection.
53
- * @param value - The current value stored at the given key, which should be the value type.
54
- * @param op - The op to be rebased.
55
- * @param localOpMetadata - Any local metadata that was originally submitted with the op.
56
- * @returns A rebased version of the op and any local metadata that should be submitted with it.
57
- */
58
- rebase(value: IntervalCollection, op: IIntervalCollectionTypeOperationValue, localOpMetadata: IMapMessageLocalMetadata): {
59
- rebasedOp: IIntervalCollectionTypeOperationValue;
60
- rebasedLocalOpMetadata: IMapMessageLocalMetadata;
61
- } | undefined;
62
50
  }
63
51
  /**
64
52
  * The _ready-for-serialization_ format of values contained in DDS contents. This allows us to use
@@ -99,14 +87,32 @@ export interface ISerializedIntervalCollection {
99
87
  * serializable via JSON.stringify/parse but differs in that it has no equivalency with an in-memory value - rather
100
88
  * it just describes an operation to be applied to an already-in-memory value.
101
89
  */
102
- export interface IIntervalCollectionTypeOperationValue {
90
+ export type IIntervalCollectionTypeOperationValue = {
91
+ /**
92
+ * The name of the operation.
93
+ */
94
+ opName: typeof IntervalDeltaOpType.ADD;
95
+ /**
96
+ * The payload that is submitted along with the operation.
97
+ */
98
+ value: ISerializedInterval;
99
+ } | {
103
100
  /**
104
101
  * The name of the operation.
105
102
  */
106
- opName: IntervalDeltaOpType;
103
+ opName: typeof IntervalDeltaOpType.CHANGE;
107
104
  /**
108
105
  * The payload that is submitted along with the operation.
109
106
  */
110
107
  value: SerializedIntervalDelta;
111
- }
108
+ } | {
109
+ /**
110
+ * The name of the operation.
111
+ */
112
+ opName: typeof IntervalDeltaOpType.DELETE;
113
+ /**
114
+ * The payload that is submitted along with the operation.
115
+ */
116
+ value: SerializedIntervalDelta;
117
+ };
112
118
  //# sourceMappingURL=intervalCollectionMapInterfaces.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"intervalCollectionMapInterfaces.d.ts","sourceRoot":"","sources":["../src/intervalCollectionMapInterfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AACxF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAE7E,OAAO,KAAK,EACX,kBAAkB,EAClB,+BAA+B,EAC/B,+BAA+B,EAC/B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACN,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,EACvB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,WAAW,wBAAwB;IACxC,QAAQ,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,WAAW,eAChB,SAAQ,IAAI,CACX,iBAAiB,EACf,uCAAuC,GACvC,2BAA2B,GAC3B,gCAAgC,GAChC,+BAA+B,CACjC;IACD;;;;;;;;;;;;OAYG;IACH,yBAAyB,EAAE,OAAO,CAAC;IAEnC;;OAEG;IACH,2BAA2B,EAAE,GAAG,GAAG,GAAG,CAAC;CACvC;AAED;;;GAGG;AACH,MAAM,WAAW,4BAA4B;IAC5C;;;;;;;OAOG;IACH,OAAO,CACN,KAAK,EAAE,kBAAkB,EACzB,MAAM,EAAE,mBAAmB,EAC3B,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,yBAAyB,GAAG,SAAS,EAC9C,eAAe,EAAE,wBAAwB,GAAG,SAAS,GACnD,IAAI,CAAC;IAER;;;;;;;OAOG;IACH,MAAM,CACL,KAAK,EAAE,kBAAkB,EACzB,EAAE,EAAE,qCAAqC,EACzC,eAAe,EAAE,wBAAwB,GAEvC;QACA,SAAS,EAAE,qCAAqC,CAAC;QACjD,sBAAsB,EAAE,wBAAwB,CAAC;KAChD,GACD,SAAS,CAAC;CACb;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,+BAA+B;IAC/C;;OAEG;IACH,IAAI,EAAE,gCAAgC,CAAC;IAEvC;;OAEG;IACH,KAAK,EAAE,+BAA+B,GAAG,+BAA+B,CAAC;CACzE;AAED,MAAM,WAAW,6BAA6B;IAC7C;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;CAC1B;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,qCAAqC;IACrD;;OAEG;IACH,MAAM,EAAE,mBAAmB,CAAC;IAE5B;;OAEG;IACH,KAAK,EAAE,uBAAuB,CAAC;CAC/B"}
1
+ {"version":3,"file":"intervalCollectionMapInterfaces.d.ts","sourceRoot":"","sources":["../src/intervalCollectionMapInterfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AACxF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAE7E,OAAO,KAAK,EACX,kBAAkB,EAClB,+BAA+B,EAC/B,+BAA+B,EAC/B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACN,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,EACvB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,WAAW,wBAAwB;IACxC,QAAQ,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,WAAW,eAChB,SAAQ,IAAI,CACX,iBAAiB,EACf,uCAAuC,GACvC,2BAA2B,GAC3B,gCAAgC,GAChC,+BAA+B,CACjC;IACD;;;;;;;;;;;;OAYG;IACH,yBAAyB,EAAE,OAAO,CAAC;IAEnC;;OAEG;IACH,2BAA2B,EAAE,GAAG,GAAG,GAAG,CAAC;CACvC;AAED;;;GAGG;AACH,MAAM,WAAW,4BAA4B;IAC5C;;;;;;;OAOG;IACH,OAAO,CACN,KAAK,EAAE,kBAAkB,EACzB,MAAM,EAAE,mBAAmB,EAC3B,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,yBAAyB,GAAG,SAAS,EAC9C,eAAe,EAAE,wBAAwB,GAAG,SAAS,GACnD,IAAI,CAAC;CACR;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,+BAA+B;IAC/C;;OAEG;IACH,IAAI,EAAE,gCAAgC,CAAC;IAEvC;;OAEG;IACH,KAAK,EAAE,+BAA+B,GAAG,+BAA+B,CAAC;CACzE;AAED,MAAM,WAAW,6BAA6B;IAC7C;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;CAC1B;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,qCAAqC,GAC9C;IACA;;OAEG;IACH,MAAM,EAAE,OAAO,mBAAmB,CAAC,GAAG,CAAC;IAEvC;;OAEG;IACH,KAAK,EAAE,mBAAmB,CAAC;CAC1B,GACD;IACA;;OAEG;IACH,MAAM,EAAE,OAAO,mBAAmB,CAAC,MAAM,CAAC;IAE1C;;OAEG;IACH,KAAK,EAAE,uBAAuB,CAAC;CAC9B,GACD;IACA;;OAEG;IACH,MAAM,EAAE,OAAO,mBAAmB,CAAC,MAAM,CAAC;IAE1C;;OAEG;IACH,KAAK,EAAE,uBAAuB,CAAC;CAC9B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"intervalCollectionMapInterfaces.js","sourceRoot":"","sources":["../src/intervalCollectionMapInterfaces.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\nimport type { IMergeTreeOptions } from \"@fluidframework/merge-tree/internal\";\n\nimport type {\n\tIntervalCollection,\n\tISerializedIntervalCollectionV1,\n\tISerializedIntervalCollectionV2,\n} from \"./intervalCollection.js\";\nimport {\n\tISerializedInterval,\n\tIntervalDeltaOpType,\n\tSerializedIntervalDelta,\n} from \"./intervals/index.js\";\n\nexport interface IMapMessageLocalMetadata {\n\tlocalSeq: number;\n}\n\n/**\n * Optional flags that configure options for sequence DDSs\n * @internal\n */\nexport interface SequenceOptions\n\textends Pick<\n\t\tIMergeTreeOptions,\n\t\t| \"mergeTreeReferencesCanSlideToEndpoint\"\n\t\t| \"mergeTreeEnableObliterate\"\n\t\t| \"mergeTreeEnableSidedObliterate\"\n\t\t| \"mergeTreeEnableAnnotateAdjust\"\n\t> {\n\t/**\n\t * Enable the ability to use interval APIs that rely on positions before and\n\t * after individual characters, referred to as \"sides\". See {@link @fluidframework/merge-tree#SequencePlace}\n\t * for additional context.\n\t *\n\t * This flag must be enabled to pass instances of {@link @fluidframework/merge-tree#SequencePlace} to\n\t * any IIntervalCollection API.\n\t *\n\t * Also see the feature flag `mergeTreeReferencesCanSlideToEndpoint` to allow\n\t * endpoints to slide to the special endpoint segments.\n\t *\n\t * The default value is false.\n\t */\n\tintervalStickinessEnabled: boolean;\n\n\t/**\n\t * This is for testing, and allows us to output intervals in the older formats.\n\t */\n\tintervalSerializationFormat: \"1\" | \"2\";\n}\n\n/**\n * Defines an operation that a value type is able to handle.\n *\n */\nexport interface IIntervalCollectionOperation {\n\t/**\n\t * Performs the actual processing on the incoming operation.\n\t * @param value - The current value stored at the given key, which should be the value type\n\t * @param params - The params on the incoming operation\n\t * @param local - Whether the operation originated from this client\n\t * @param message - The operation itself\n\t * @param localOpMetadata - any local metadata submitted by `IValueOpEmitter.emit`.\n\t */\n\tprocess(\n\t\tvalue: IntervalCollection,\n\t\tparams: ISerializedInterval,\n\t\tlocal: boolean,\n\t\tmessage: ISequencedDocumentMessage | undefined,\n\t\tlocalOpMetadata: IMapMessageLocalMetadata | undefined,\n\t): void;\n\n\t/**\n\t * Rebases an `op` on `value` from its original perspective (ref/local seq) to the current\n\t * perspective. Should be invoked on reconnection.\n\t * @param value - The current value stored at the given key, which should be the value type.\n\t * @param op - The op to be rebased.\n\t * @param localOpMetadata - Any local metadata that was originally submitted with the op.\n\t * @returns A rebased version of the op and any local metadata that should be submitted with it.\n\t */\n\trebase(\n\t\tvalue: IntervalCollection,\n\t\top: IIntervalCollectionTypeOperationValue,\n\t\tlocalOpMetadata: IMapMessageLocalMetadata,\n\t):\n\t\t| {\n\t\t\t\trebasedOp: IIntervalCollectionTypeOperationValue;\n\t\t\t\trebasedLocalOpMetadata: IMapMessageLocalMetadata;\n\t\t }\n\t\t| undefined;\n}\n\n/**\n * The _ready-for-serialization_ format of values contained in DDS contents. This allows us to use\n * ISerializableValue.type to understand whether they're storing a Plain JS object, a SharedObject, or a value type.\n * Note that the in-memory equivalent of ISerializableValue is ILocalValue (similarly holding a type, but with\n * the _in-memory representation_ of the value instead). An ISerializableValue is what gets passed to\n * JSON.stringify and comes out of JSON.parse. This format is used both for snapshots (loadCore/populate)\n * and ops (set).\n *\n * The DefaultMap implementation for sequence has been specialized to only support a single ValueType, which serializes\n * and deserializes via .store() and .load().\n */\nexport interface ISerializableIntervalCollection {\n\t/**\n\t * A type annotation to help indicate how the value serializes.\n\t */\n\ttype: \"sharedStringIntervalCollection\";\n\n\t/**\n\t * The JSONable representation of the value.\n\t */\n\tvalue: ISerializedIntervalCollectionV1 | ISerializedIntervalCollectionV2;\n}\n\nexport interface ISerializedIntervalCollection {\n\t/**\n\t * A type annotation to help indicate how the value serializes.\n\t */\n\ttype: string;\n\n\t/**\n\t * String representation of the value.\n\t */\n\tvalue: string | undefined;\n}\n\n/**\n * ValueTypes handle ops slightly differently from SharedObjects or plain JS objects. Since the Map/Directory doesn't\n * know how to handle the ValueType's ops, those ops are instead passed along to the ValueType for processing.\n * IValueTypeOperationValue is that passed-along op. The opName on it is the ValueType-specific operation and the\n * value is whatever params the ValueType needs to complete that operation. Similar to ISerializableValue, it is\n * serializable via JSON.stringify/parse but differs in that it has no equivalency with an in-memory value - rather\n * it just describes an operation to be applied to an already-in-memory value.\n */\nexport interface IIntervalCollectionTypeOperationValue {\n\t/**\n\t * The name of the operation.\n\t */\n\topName: IntervalDeltaOpType;\n\n\t/**\n\t * The payload that is submitted along with the operation.\n\t */\n\tvalue: SerializedIntervalDelta;\n}\n"]}
1
+ {"version":3,"file":"intervalCollectionMapInterfaces.js","sourceRoot":"","sources":["../src/intervalCollectionMapInterfaces.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\nimport type { IMergeTreeOptions } from \"@fluidframework/merge-tree/internal\";\n\nimport type {\n\tIntervalCollection,\n\tISerializedIntervalCollectionV1,\n\tISerializedIntervalCollectionV2,\n} from \"./intervalCollection.js\";\nimport {\n\tISerializedInterval,\n\tIntervalDeltaOpType,\n\tSerializedIntervalDelta,\n} from \"./intervals/index.js\";\n\nexport interface IMapMessageLocalMetadata {\n\tlocalSeq: number;\n}\n\n/**\n * Optional flags that configure options for sequence DDSs\n * @internal\n */\nexport interface SequenceOptions\n\textends Pick<\n\t\tIMergeTreeOptions,\n\t\t| \"mergeTreeReferencesCanSlideToEndpoint\"\n\t\t| \"mergeTreeEnableObliterate\"\n\t\t| \"mergeTreeEnableSidedObliterate\"\n\t\t| \"mergeTreeEnableAnnotateAdjust\"\n\t> {\n\t/**\n\t * Enable the ability to use interval APIs that rely on positions before and\n\t * after individual characters, referred to as \"sides\". See {@link @fluidframework/merge-tree#SequencePlace}\n\t * for additional context.\n\t *\n\t * This flag must be enabled to pass instances of {@link @fluidframework/merge-tree#SequencePlace} to\n\t * any IIntervalCollection API.\n\t *\n\t * Also see the feature flag `mergeTreeReferencesCanSlideToEndpoint` to allow\n\t * endpoints to slide to the special endpoint segments.\n\t *\n\t * The default value is false.\n\t */\n\tintervalStickinessEnabled: boolean;\n\n\t/**\n\t * This is for testing, and allows us to output intervals in the older formats.\n\t */\n\tintervalSerializationFormat: \"1\" | \"2\";\n}\n\n/**\n * Defines an operation that a value type is able to handle.\n *\n */\nexport interface IIntervalCollectionOperation {\n\t/**\n\t * Performs the actual processing on the incoming operation.\n\t * @param value - The current value stored at the given key, which should be the value type\n\t * @param params - The params on the incoming operation\n\t * @param local - Whether the operation originated from this client\n\t * @param message - The operation itself\n\t * @param localOpMetadata - any local metadata submitted by `IValueOpEmitter.emit`.\n\t */\n\tprocess(\n\t\tvalue: IntervalCollection,\n\t\tparams: ISerializedInterval,\n\t\tlocal: boolean,\n\t\tmessage: ISequencedDocumentMessage | undefined,\n\t\tlocalOpMetadata: IMapMessageLocalMetadata | undefined,\n\t): void;\n}\n\n/**\n * The _ready-for-serialization_ format of values contained in DDS contents. This allows us to use\n * ISerializableValue.type to understand whether they're storing a Plain JS object, a SharedObject, or a value type.\n * Note that the in-memory equivalent of ISerializableValue is ILocalValue (similarly holding a type, but with\n * the _in-memory representation_ of the value instead). An ISerializableValue is what gets passed to\n * JSON.stringify and comes out of JSON.parse. This format is used both for snapshots (loadCore/populate)\n * and ops (set).\n *\n * The DefaultMap implementation for sequence has been specialized to only support a single ValueType, which serializes\n * and deserializes via .store() and .load().\n */\nexport interface ISerializableIntervalCollection {\n\t/**\n\t * A type annotation to help indicate how the value serializes.\n\t */\n\ttype: \"sharedStringIntervalCollection\";\n\n\t/**\n\t * The JSONable representation of the value.\n\t */\n\tvalue: ISerializedIntervalCollectionV1 | ISerializedIntervalCollectionV2;\n}\n\nexport interface ISerializedIntervalCollection {\n\t/**\n\t * A type annotation to help indicate how the value serializes.\n\t */\n\ttype: string;\n\n\t/**\n\t * String representation of the value.\n\t */\n\tvalue: string | undefined;\n}\n\n/**\n * ValueTypes handle ops slightly differently from SharedObjects or plain JS objects. Since the Map/Directory doesn't\n * know how to handle the ValueType's ops, those ops are instead passed along to the ValueType for processing.\n * IValueTypeOperationValue is that passed-along op. The opName on it is the ValueType-specific operation and the\n * value is whatever params the ValueType needs to complete that operation. Similar to ISerializableValue, it is\n * serializable via JSON.stringify/parse but differs in that it has no equivalency with an in-memory value - rather\n * it just describes an operation to be applied to an already-in-memory value.\n */\nexport type IIntervalCollectionTypeOperationValue =\n\t| {\n\t\t\t/**\n\t\t\t * The name of the operation.\n\t\t\t */\n\t\t\topName: typeof IntervalDeltaOpType.ADD;\n\n\t\t\t/**\n\t\t\t * The payload that is submitted along with the operation.\n\t\t\t */\n\t\t\tvalue: ISerializedInterval;\n\t }\n\t| {\n\t\t\t/**\n\t\t\t * The name of the operation.\n\t\t\t */\n\t\t\topName: typeof IntervalDeltaOpType.CHANGE;\n\n\t\t\t/**\n\t\t\t * The payload that is submitted along with the operation.\n\t\t\t */\n\t\t\tvalue: SerializedIntervalDelta;\n\t }\n\t| {\n\t\t\t/**\n\t\t\t * The name of the operation.\n\t\t\t */\n\t\t\topName: typeof IntervalDeltaOpType.DELETE;\n\n\t\t\t/**\n\t\t\t * The payload that is submitted along with the operation.\n\t\t\t */\n\t\t\tvalue: SerializedIntervalDelta;\n\t };\n"]}
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export declare const pkgName = "@fluidframework/sequence";
8
- export declare const pkgVersion = "2.32.0";
8
+ export declare const pkgVersion = "2.33.0-333010";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,6BAA6B,CAAC;AAClD,eAAO,MAAM,UAAU,WAAW,CAAC"}
1
+ {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,6BAA6B,CAAC;AAClD,eAAO,MAAM,UAAU,kBAAkB,CAAC"}
@@ -8,5 +8,5 @@
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.pkgVersion = exports.pkgName = void 0;
10
10
  exports.pkgName = "@fluidframework/sequence";
11
- exports.pkgVersion = "2.32.0";
11
+ exports.pkgVersion = "2.33.0-333010";
12
12
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,0BAA0B,CAAC;AACrC,QAAA,UAAU,GAAG,QAAQ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/sequence\";\nexport const pkgVersion = \"2.32.0\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,0BAA0B,CAAC;AACrC,QAAA,UAAU,GAAG,eAAe,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/sequence\";\nexport const pkgVersion = \"2.33.0-333010\";\n"]}
@@ -6,9 +6,9 @@ import { TypedEventEmitter } from "@fluid-internal/client-utils";
6
6
  import { IEvent } from "@fluidframework/core-interfaces";
7
7
  import { ISequencedDocumentMessage } from "@fluidframework/driver-definitions/internal";
8
8
  import { Client, LocalReferencePosition, PropertySet, Side, SequencePlace } from "@fluidframework/merge-tree/internal";
9
- import { IIntervalCollectionOperation, IMapMessageLocalMetadata, SequenceOptions, type IIntervalCollectionTypeOperationValue } from "./intervalCollectionMapInterfaces.js";
9
+ import { IMapMessageLocalMetadata, SequenceOptions, type IIntervalCollectionTypeOperationValue } from "./intervalCollectionMapInterfaces.js";
10
10
  import { type IEndpointIndex, type IIdIntervalIndex, type IntervalIndex, type ISequenceOverlappingIntervalsIndex, type SequenceIntervalIndex } from "./intervalIndex/index.js";
11
- import { CompressedSerializedInterval, ISerializedInterval, IntervalDeltaOpType, IntervalStickiness, SequenceInterval, SequenceIntervalClass, SerializedIntervalDelta, type ISerializableInterval } from "./intervals/index.js";
11
+ import { CompressedSerializedInterval, ISerializedInterval, IntervalStickiness, SequenceInterval, SequenceIntervalClass, SerializedIntervalDelta, type ISerializableInterval } from "./intervals/index.js";
12
12
  export type ISerializedIntervalCollectionV1 = ISerializedInterval[];
13
13
  export interface ISerializedIntervalCollectionV2 {
14
14
  label: string;
@@ -55,7 +55,6 @@ export declare class LocalIntervalCollection {
55
55
  private addIntervalListeners;
56
56
  private removeIntervalListeners;
57
57
  }
58
- export declare const opsMap: Record<IntervalDeltaOpType, IIntervalCollectionOperation>;
59
58
  /**
60
59
  * @legacy
61
60
  * @alpha
@@ -585,6 +584,9 @@ export declare class IntervalCollection extends TypedEventEmitter<ISequenceInter
585
584
  * {@inheritdoc IIntervalCollection.detachIndex}
586
585
  */
587
586
  detachIndex(index: SequenceIntervalIndex): boolean;
587
+ process(op: IIntervalCollectionTypeOperationValue, local: boolean, message: ISequencedDocumentMessage, localOpMetadata: IMapMessageLocalMetadata): void;
588
+ resubmitMessage(op: IIntervalCollectionTypeOperationValue, localOpMetadata: IMapMessageLocalMetadata): void;
589
+ applyStashedOp(op: IIntervalCollectionTypeOperationValue): void;
588
590
  private rebasePositionWithSegmentSlide;
589
591
  private computeRebasedPositions;
590
592
  attachGraph(client: Client, label: string): void;
@@ -627,7 +629,7 @@ export declare class IntervalCollection extends TypedEventEmitter<ISequenceInter
627
629
  private removePendingChangeHelper;
628
630
  private hasPendingChangeStart;
629
631
  private hasPendingChangeEnd;
630
- ackChange(serializedInterval: ISerializedInterval, local: boolean, op: ISequencedDocumentMessage, localOpMetadata: IMapMessageLocalMetadata | undefined): void;
632
+ ackChange(serializedInterval: SerializedIntervalDelta, local: boolean, op: ISequencedDocumentMessage, localOpMetadata: IMapMessageLocalMetadata | undefined): void;
631
633
  /**
632
634
  * {@inheritdoc IIntervalCollection.attachDeserializer}
633
635
  */
@@ -642,7 +644,7 @@ export declare class IntervalCollection extends TypedEventEmitter<ISequenceInter
642
644
  private getSlideToSegment;
643
645
  private ackInterval;
644
646
  ackAdd(serializedInterval: ISerializedInterval, local: boolean, op: ISequencedDocumentMessage, localOpMetadata: IMapMessageLocalMetadata | undefined): SequenceIntervalClass | undefined;
645
- ackDelete(serializedInterval: ISerializedInterval, local: boolean, op: ISequencedDocumentMessage): void;
647
+ ackDelete(serializedInterval: SerializedIntervalDelta, local: boolean, op: ISequencedDocumentMessage): void;
646
648
  serializeInternal(version: "1" | "2"): ISerializedIntervalCollectionV1 | ISerializedIntervalCollectionV2;
647
649
  /**
648
650
  * @returns an iterator over all intervals in this collection.
@@ -1 +1 @@
1
- {"version":3,"file":"intervalCollection.d.ts","sourceRoot":"","sources":["../src/intervalCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AAEzD,OAAO,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AACxF,OAAO,EACN,MAAM,EAGN,sBAAsB,EACtB,WAAW,EAMX,IAAI,EACJ,aAAa,EAIb,MAAM,qCAAqC,CAAC;AAI7C,OAAO,EACN,4BAA4B,EAC5B,wBAAwB,EACxB,eAAe,EACf,KAAK,qCAAqC,EAC1C,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAIN,KAAK,cAAc,EACnB,KAAK,gBAAgB,EAErB,KAAK,aAAa,EAClB,KAAK,kCAAkC,EACvC,KAAK,qBAAqB,EAC1B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACN,4BAA4B,EAC5B,mBAAmB,EACn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B;IAK7B;;OAEG;IACI,qCAAqC,CAC3C,WAAW,EAAE,MAAM,GACjB,0BAA0B;IAK7B;;OAEG;IACI,sBAAsB,CAC5B,OAAO,EAAE,qBAAqB,EAAE,EAChC,eAAe,EAAE,OAAO,EACxB,KAAK,CAAC,EAAE,MAAM,EACd,GAAG,CAAC,EAAE,MAAM;IAcb;;OAEG;IACI,wBAAwB,CAC9B,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,MAAM,GACjB,gBAAgB,EAAE;IAWrB;;OAEG;IACI,GAAG,CAAC,EAAE,EAAE,CAAC,QAAQ,EAAE,qBAAqB,KAAK,IAAI;IAUxD;;OAEG;IACI,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS;IAQlE;;OAEG;IACI,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS;CAO9D;AASD;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC/B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,EAAE,qBAAqB,CAAC;CAChC;AAED;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAC1C,iBAAiB,EAAE,sBAAsB,GACvC,eAAe,GAAG,SAAS,CAM7B"}
@@ -4,12 +4,12 @@
4
4
  */
5
5
  /* eslint-disable no-bitwise */
6
6
  import { TypedEventEmitter } from "@fluid-internal/client-utils";
7
- import { assert } from "@fluidframework/core-utils/internal";
7
+ import { assert, unreachableCase } from "@fluidframework/core-utils/internal";
8
8
  import { DetachedReferencePosition, ReferenceType, SlidingPreference, getSlideToSegoff, refTypeIncludesFlag, reservedRangeLabelsKey, Side, endpointPosAndSide, createLocalReconnectingPerspective, } from "@fluidframework/merge-tree/internal";
9
9
  import { LoggingError, UsageError } from "@fluidframework/telemetry-utils/internal";
10
10
  import { v4 as uuid } from "uuid";
11
11
  import { createIdIntervalIndex, EndpointIndex, OverlappingIntervalsIndex, } from "./intervalIndex/index.js";
12
- import { IntervalDeltaOpType, IntervalStickiness, IntervalType, createPositionReferenceFromSegoff, createSequenceInterval, endReferenceSlidingPreference, getSerializedProperties, startReferenceSlidingPreference, } from "./intervals/index.js";
12
+ import { IntervalStickiness, IntervalType, createPositionReferenceFromSegoff, createSequenceInterval, endReferenceSlidingPreference, getSerializedProperties, startReferenceSlidingPreference, } from "./intervals/index.js";
13
13
  export function sidesFromStickiness(stickiness) {
14
14
  const startSide = (stickiness & IntervalStickiness.START) !== 0 ? Side.After : Side.Before;
15
15
  const endSide = (stickiness & IntervalStickiness.END) !== 0 ? Side.Before : Side.After;
@@ -189,51 +189,6 @@ export class LocalIntervalCollection {
189
189
  interval.removePositionChangeListeners();
190
190
  }
191
191
  }
192
- const rebase = (collection, op, localOpMetadata) => {
193
- const { localSeq } = localOpMetadata;
194
- const rebasedValue = collection.rebaseLocalInterval(op.opName, op.value, localSeq);
195
- if (rebasedValue === undefined) {
196
- return undefined;
197
- }
198
- const rebasedOp = { ...op, value: rebasedValue };
199
- return { rebasedOp, rebasedLocalOpMetadata: localOpMetadata };
200
- };
201
- export const opsMap = {
202
- [IntervalDeltaOpType.ADD]: {
203
- process: (collection, params, local, op, localOpMetadata) => {
204
- // if params is undefined, the interval was deleted during
205
- // rebasing
206
- if (!params) {
207
- return;
208
- }
209
- assert(op !== undefined, 0x3fb /* op should exist here */);
210
- collection.ackAdd(params, local, op, localOpMetadata);
211
- },
212
- rebase,
213
- },
214
- [IntervalDeltaOpType.DELETE]: {
215
- process: (collection, params, local, op) => {
216
- assert(op !== undefined, 0x3fc /* op should exist here */);
217
- collection.ackDelete(params, local, op);
218
- },
219
- rebase: (collection, op, localOpMetadata) => {
220
- // Deletion of intervals is based on id, so requires no rebasing.
221
- return { rebasedOp: op, rebasedLocalOpMetadata: localOpMetadata };
222
- },
223
- },
224
- [IntervalDeltaOpType.CHANGE]: {
225
- process: (collection, params, local, op, localOpMetadata) => {
226
- // if params is undefined, the interval was deleted during
227
- // rebasing
228
- if (!params) {
229
- return;
230
- }
231
- assert(op !== undefined, 0x3fd /* op should exist here */);
232
- collection.ackChange(params, local, op, localOpMetadata);
233
- },
234
- rebase,
235
- },
236
- };
237
192
  class IntervalCollectionIterator {
238
193
  constructor(collection, iteratesForward = true, start, end) {
239
194
  this.results = [];
@@ -300,6 +255,64 @@ export class IntervalCollection extends TypedEventEmitter {
300
255
  }
301
256
  return true;
302
257
  }
258
+ process(op, local, message, localOpMetadata) {
259
+ const { opName, value } = op;
260
+ switch (opName) {
261
+ case "add": {
262
+ this.ackAdd(value, local, message, localOpMetadata);
263
+ break;
264
+ }
265
+ case "delete": {
266
+ this.ackDelete(value, local, message);
267
+ break;
268
+ }
269
+ case "change": {
270
+ this.ackChange(value, local, message, localOpMetadata);
271
+ break;
272
+ }
273
+ default:
274
+ unreachableCase(opName);
275
+ }
276
+ }
277
+ resubmitMessage(op, localOpMetadata) {
278
+ const { opName, value } = op;
279
+ const { localSeq } = localOpMetadata;
280
+ const rebasedValue = opName === "delete" ? value : this.rebaseLocalInterval(opName, value, localSeq);
281
+ if (rebasedValue === undefined) {
282
+ return undefined;
283
+ }
284
+ this.submitDelta({ opName, value: rebasedValue }, localOpMetadata);
285
+ }
286
+ applyStashedOp(op) {
287
+ const { opName, value } = op;
288
+ const { id, properties } = getSerializedProperties(value);
289
+ switch (opName) {
290
+ case "add": {
291
+ this.add({
292
+ id,
293
+ // Todo: we should improve typing so we know add ops always have start and end
294
+ start: toSequencePlace(value.start, value.startSide),
295
+ end: toSequencePlace(value.end, value.endSide),
296
+ props: properties,
297
+ });
298
+ break;
299
+ }
300
+ case "change": {
301
+ this.change(id, {
302
+ start: toOptionalSequencePlace(value.start, value.startSide),
303
+ end: toOptionalSequencePlace(value.end, value.endSide),
304
+ props: properties,
305
+ });
306
+ break;
307
+ }
308
+ case "delete": {
309
+ this.removeIntervalById(id);
310
+ break;
311
+ }
312
+ default:
313
+ throw new Error("unknown ops should not be stashed");
314
+ }
315
+ }
303
316
  rebasePositionWithSegmentSlide(pos, seqNumberFrom, localSeq) {
304
317
  if (!this.client) {
305
318
  throw new LoggingError("mergeTree client must exist");