@fluid-experimental/last-edited 2.90.0-378676 → 2.90.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # @fluid-experimental/last-edited
2
2
 
3
+ ## 2.90.0
4
+
5
+ Dependency updates only.
6
+
3
7
  ## 2.83.0
4
8
 
5
9
  Dependency updates only.
@@ -1 +1 @@
1
- {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wDAAwD,CAAC;AAEhG,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AAE7F,OAAO,KAAK,EAAE,uBAAuB,EAAoB,MAAM,iBAAiB,CAAC;AAoCjF;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,kCAAkC,CACjD,iBAAiB,EAAE,uBAAuB,EAC1C,OAAO,EAAE,iBAAiB,EAC1B,sBAAsB,GAAE,CACvB,OAAO,EAAE,yBAAyB,KAC9B,OAAqC,GACxC,IAAI,CAkBN"}
1
+ {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wDAAwD,CAAC;AAEhG,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AAE7F,OAAO,KAAK,EAAE,uBAAuB,EAAoB,MAAM,iBAAiB,CAAC;AAmCjF;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,kCAAkC,CACjD,iBAAiB,EAAE,uBAAuB,EAC1C,OAAO,EAAE,iBAAiB,EAC1B,sBAAsB,GAAE,CACvB,OAAO,EAAE,yBAAyB,KAC9B,OAAqC,GACxC,IAAI,CAkBN"}
package/dist/setup.js CHANGED
@@ -22,7 +22,6 @@ const shouldDiscardMessageDefault = (message) => message.type !== internal_1.Con
22
22
  */
23
23
  function getLastEditDetailsFromMessage(message, quorum) {
24
24
  // TODO: Verify whether this should be able to handle server-generated ops (with null clientId)
25
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
26
25
  const sequencedClient = quorum.getMember(message.clientId);
27
26
  const user = sequencedClient?.client.user;
28
27
  if (user !== undefined) {
package/dist/setup.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"setup.js","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,yEAAkF;AAOlF;;;;;;GAMG;AACH,MAAM,2BAA2B,GAAG,CAAC,OAAkC,EAAW,EAAE,CACnF,OAAO,CAAC,IAAI,KAAK,+BAAoB,CAAC,MAAM;IAC5C,OAAO,CAAC,IAAI,KAAK,+BAAoB,CAAC,gBAAgB;IACtD,OAAO,CAAC,IAAI,KAAK,+BAAoB,CAAC,KAAK,CAAC;AAE7C;;;GAGG;AACH,SAAS,6BAA6B,CACrC,OAAkC,EAClC,MAAsB;IAEtB,+FAA+F;IAC/F,4EAA4E;IAC5E,MAAM,eAAe,GAAG,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,QAAkB,CAAC,CAAC;IACrE,MAAM,IAAI,GAAG,eAAe,EAAE,MAAM,CAAC,IAAI,CAAC;IAC1C,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACxB,MAAM,eAAe,GAAqB;YACzC,IAAI;YACJ,SAAS,EAAE,OAAO,CAAC,SAAS;SAC5B,CAAC;QACF,OAAO,eAAe,CAAC;IACxB,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,SAAgB,kCAAkC,CACjD,iBAA0C,EAC1C,OAA0B,EAC1B,yBAEe,2BAA2B;IAE1C,+EAA+E;IAC/E,+CAA+C;IAC/C,8GAA8G;IAC9G,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,OAAkC,EAAE,cAAwB,EAAE,EAAE;QACjF,6EAA6E;QAC7E,IAAI,cAAc,KAAK,KAAK,IAAI,sBAAsB,CAAC,OAAO,CAAC,EAAE,CAAC;YACjE,OAAO;QACR,CAAC;QAED,6EAA6E;QAC7E,MAAM,eAAe,GAAG,6BAA6B,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;QACpF,IAAI,eAAe,KAAK,SAAS,EAAE,CAAC;YACnC,OAAO;QACR,CAAC;QAED,iBAAiB,CAAC,qBAAqB,CAAC,eAAe,CAAC,CAAC;IAC1D,CAAC,CAAC,CAAC;AACJ,CAAC;AAxBD,gFAwBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ContainerMessageType } from \"@fluidframework/container-runtime/internal\";\nimport type { IContainerRuntime } from \"@fluidframework/container-runtime-definitions/internal\";\nimport type { IQuorumClients } from \"@fluidframework/driver-definitions\";\nimport type { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\n\nimport type { IFluidLastEditedTracker, ILastEditDetails } from \"./interfaces.js\";\n\n/**\n * Default implementation of {@link setupLastEditedTrackerForContainer}'s `shouldDiscardMessageFn` parameter,\n * which tells that all messages other than {@link @fluidframework/container-runtime#ContainerMessageType.Alias},\n * {@link @fluidframework/container-runtime#ContainerMessageType.Attach}, and\n * {@link @fluidframework/container-runtime#ContainerMessageType.FluidDataStoreOp} type messages should be\n * discarded.\n */\nconst shouldDiscardMessageDefault = (message: ISequencedDocumentMessage): boolean =>\n\tmessage.type !== ContainerMessageType.Attach &&\n\tmessage.type !== ContainerMessageType.FluidDataStoreOp &&\n\tmessage.type !== ContainerMessageType.Alias;\n\n/**\n * Extracts the user information and timestamp from a message. Returns undefined if the user information for the\n * client who sent the message doesn't exist in the quorum.\n */\nfunction getLastEditDetailsFromMessage(\n\tmessage: ISequencedDocumentMessage,\n\tquorum: IQuorumClients,\n): ILastEditDetails | undefined {\n\t// TODO: Verify whether this should be able to handle server-generated ops (with null clientId)\n\t// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n\tconst sequencedClient = quorum.getMember(message.clientId as string);\n\tconst user = sequencedClient?.client.user;\n\tif (user !== undefined) {\n\t\tconst lastEditDetails: ILastEditDetails = {\n\t\t\tuser,\n\t\t\ttimestamp: message.timestamp,\n\t\t};\n\t\treturn lastEditDetails;\n\t}\n\treturn undefined;\n}\n\n/**\n * Helper function to set up a data object that provides IFluidLastEditedTracker to track last edited in a Container.\n *\n * It does the following:\n *\n * - Registers an \"op\" listener on the runtime. On each message, it calls the shouldDiscardMessageFn to check\n * if the message should be discarded. It also discards all scheduler message. If a message is not discarded,\n * it passes the last edited information from the message to the last edited tracker.\n *\n * - The last edited information from the last message received before the lastEditedTracker is\n * loaded is stored and passed to the tracker once it loads.\n * @param lastEditedTracker - The last edited tracker.\n * @param runtime - The container runtime whose messages are to be tracked.\n * @param shouldDiscardMessageFn - Function that tells if a message should not be considered in computing last edited.\n * @internal\n */\nexport function setupLastEditedTrackerForContainer(\n\tlastEditedTracker: IFluidLastEditedTracker,\n\truntime: IContainerRuntime,\n\tshouldDiscardMessageFn: (\n\t\tmessage: ISequencedDocumentMessage,\n\t) => boolean = shouldDiscardMessageDefault,\n): void {\n\t// Register an op listener on the runtime. If the lastEditedTracker has loaded,\n\t// it passes the last edited information to its\n\t// last edited tracker. If the lastEditedTracker hasn't loaded, store the last edited information temporarily.\n\truntime.on(\"op\", (message: ISequencedDocumentMessage, runtimeMessage?: boolean) => {\n\t\t// If this message should be discarded as per shouldDiscardMessageFn, return.\n\t\tif (runtimeMessage === false || shouldDiscardMessageFn(message)) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Get the last edited details from the message. If it doesn't exist, return.\n\t\tconst lastEditDetails = getLastEditDetailsFromMessage(message, runtime.getQuorum());\n\t\tif (lastEditDetails === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\tlastEditedTracker.updateLastEditDetails(lastEditDetails);\n\t});\n}\n"]}
1
+ {"version":3,"file":"setup.js","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,yEAAkF;AAOlF;;;;;;GAMG;AACH,MAAM,2BAA2B,GAAG,CAAC,OAAkC,EAAW,EAAE,CACnF,OAAO,CAAC,IAAI,KAAK,+BAAoB,CAAC,MAAM;IAC5C,OAAO,CAAC,IAAI,KAAK,+BAAoB,CAAC,gBAAgB;IACtD,OAAO,CAAC,IAAI,KAAK,+BAAoB,CAAC,KAAK,CAAC;AAE7C;;;GAGG;AACH,SAAS,6BAA6B,CACrC,OAAkC,EAClC,MAAsB;IAEtB,+FAA+F;IAC/F,MAAM,eAAe,GAAG,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,QAAkB,CAAC,CAAC;IACrE,MAAM,IAAI,GAAG,eAAe,EAAE,MAAM,CAAC,IAAI,CAAC;IAC1C,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACxB,MAAM,eAAe,GAAqB;YACzC,IAAI;YACJ,SAAS,EAAE,OAAO,CAAC,SAAS;SAC5B,CAAC;QACF,OAAO,eAAe,CAAC;IACxB,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,SAAgB,kCAAkC,CACjD,iBAA0C,EAC1C,OAA0B,EAC1B,yBAEe,2BAA2B;IAE1C,+EAA+E;IAC/E,+CAA+C;IAC/C,8GAA8G;IAC9G,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,OAAkC,EAAE,cAAwB,EAAE,EAAE;QACjF,6EAA6E;QAC7E,IAAI,cAAc,KAAK,KAAK,IAAI,sBAAsB,CAAC,OAAO,CAAC,EAAE,CAAC;YACjE,OAAO;QACR,CAAC;QAED,6EAA6E;QAC7E,MAAM,eAAe,GAAG,6BAA6B,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;QACpF,IAAI,eAAe,KAAK,SAAS,EAAE,CAAC;YACnC,OAAO;QACR,CAAC;QAED,iBAAiB,CAAC,qBAAqB,CAAC,eAAe,CAAC,CAAC;IAC1D,CAAC,CAAC,CAAC;AACJ,CAAC;AAxBD,gFAwBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ContainerMessageType } from \"@fluidframework/container-runtime/internal\";\nimport type { IContainerRuntime } from \"@fluidframework/container-runtime-definitions/internal\";\nimport type { IQuorumClients } from \"@fluidframework/driver-definitions\";\nimport type { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\n\nimport type { IFluidLastEditedTracker, ILastEditDetails } from \"./interfaces.js\";\n\n/**\n * Default implementation of {@link setupLastEditedTrackerForContainer}'s `shouldDiscardMessageFn` parameter,\n * which tells that all messages other than {@link @fluidframework/container-runtime#ContainerMessageType.Alias},\n * {@link @fluidframework/container-runtime#ContainerMessageType.Attach}, and\n * {@link @fluidframework/container-runtime#ContainerMessageType.FluidDataStoreOp} type messages should be\n * discarded.\n */\nconst shouldDiscardMessageDefault = (message: ISequencedDocumentMessage): boolean =>\n\tmessage.type !== ContainerMessageType.Attach &&\n\tmessage.type !== ContainerMessageType.FluidDataStoreOp &&\n\tmessage.type !== ContainerMessageType.Alias;\n\n/**\n * Extracts the user information and timestamp from a message. Returns undefined if the user information for the\n * client who sent the message doesn't exist in the quorum.\n */\nfunction getLastEditDetailsFromMessage(\n\tmessage: ISequencedDocumentMessage,\n\tquorum: IQuorumClients,\n): ILastEditDetails | undefined {\n\t// TODO: Verify whether this should be able to handle server-generated ops (with null clientId)\n\tconst sequencedClient = quorum.getMember(message.clientId as string);\n\tconst user = sequencedClient?.client.user;\n\tif (user !== undefined) {\n\t\tconst lastEditDetails: ILastEditDetails = {\n\t\t\tuser,\n\t\t\ttimestamp: message.timestamp,\n\t\t};\n\t\treturn lastEditDetails;\n\t}\n\treturn undefined;\n}\n\n/**\n * Helper function to set up a data object that provides IFluidLastEditedTracker to track last edited in a Container.\n *\n * It does the following:\n *\n * - Registers an \"op\" listener on the runtime. On each message, it calls the shouldDiscardMessageFn to check\n * if the message should be discarded. It also discards all scheduler message. If a message is not discarded,\n * it passes the last edited information from the message to the last edited tracker.\n *\n * - The last edited information from the last message received before the lastEditedTracker is\n * loaded is stored and passed to the tracker once it loads.\n * @param lastEditedTracker - The last edited tracker.\n * @param runtime - The container runtime whose messages are to be tracked.\n * @param shouldDiscardMessageFn - Function that tells if a message should not be considered in computing last edited.\n * @internal\n */\nexport function setupLastEditedTrackerForContainer(\n\tlastEditedTracker: IFluidLastEditedTracker,\n\truntime: IContainerRuntime,\n\tshouldDiscardMessageFn: (\n\t\tmessage: ISequencedDocumentMessage,\n\t) => boolean = shouldDiscardMessageDefault,\n): void {\n\t// Register an op listener on the runtime. If the lastEditedTracker has loaded,\n\t// it passes the last edited information to its\n\t// last edited tracker. If the lastEditedTracker hasn't loaded, store the last edited information temporarily.\n\truntime.on(\"op\", (message: ISequencedDocumentMessage, runtimeMessage?: boolean) => {\n\t\t// If this message should be discarded as per shouldDiscardMessageFn, return.\n\t\tif (runtimeMessage === false || shouldDiscardMessageFn(message)) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Get the last edited details from the message. If it doesn't exist, return.\n\t\tconst lastEditDetails = getLastEditDetailsFromMessage(message, runtime.getQuorum());\n\t\tif (lastEditDetails === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\tlastEditedTracker.updateLastEditDetails(lastEditDetails);\n\t});\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wDAAwD,CAAC;AAEhG,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AAE7F,OAAO,KAAK,EAAE,uBAAuB,EAAoB,MAAM,iBAAiB,CAAC;AAoCjF;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,kCAAkC,CACjD,iBAAiB,EAAE,uBAAuB,EAC1C,OAAO,EAAE,iBAAiB,EAC1B,sBAAsB,GAAE,CACvB,OAAO,EAAE,yBAAyB,KAC9B,OAAqC,GACxC,IAAI,CAkBN"}
1
+ {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wDAAwD,CAAC;AAEhG,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AAE7F,OAAO,KAAK,EAAE,uBAAuB,EAAoB,MAAM,iBAAiB,CAAC;AAmCjF;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,kCAAkC,CACjD,iBAAiB,EAAE,uBAAuB,EAC1C,OAAO,EAAE,iBAAiB,EAC1B,sBAAsB,GAAE,CACvB,OAAO,EAAE,yBAAyB,KAC9B,OAAqC,GACxC,IAAI,CAkBN"}
package/lib/setup.js CHANGED
@@ -19,7 +19,6 @@ const shouldDiscardMessageDefault = (message) => message.type !== ContainerMessa
19
19
  */
20
20
  function getLastEditDetailsFromMessage(message, quorum) {
21
21
  // TODO: Verify whether this should be able to handle server-generated ops (with null clientId)
22
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
23
22
  const sequencedClient = quorum.getMember(message.clientId);
24
23
  const user = sequencedClient?.client.user;
25
24
  if (user !== undefined) {
package/lib/setup.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"setup.js","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAOlF;;;;;;GAMG;AACH,MAAM,2BAA2B,GAAG,CAAC,OAAkC,EAAW,EAAE,CACnF,OAAO,CAAC,IAAI,KAAK,oBAAoB,CAAC,MAAM;IAC5C,OAAO,CAAC,IAAI,KAAK,oBAAoB,CAAC,gBAAgB;IACtD,OAAO,CAAC,IAAI,KAAK,oBAAoB,CAAC,KAAK,CAAC;AAE7C;;;GAGG;AACH,SAAS,6BAA6B,CACrC,OAAkC,EAClC,MAAsB;IAEtB,+FAA+F;IAC/F,4EAA4E;IAC5E,MAAM,eAAe,GAAG,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,QAAkB,CAAC,CAAC;IACrE,MAAM,IAAI,GAAG,eAAe,EAAE,MAAM,CAAC,IAAI,CAAC;IAC1C,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACxB,MAAM,eAAe,GAAqB;YACzC,IAAI;YACJ,SAAS,EAAE,OAAO,CAAC,SAAS;SAC5B,CAAC;QACF,OAAO,eAAe,CAAC;IACxB,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,kCAAkC,CACjD,iBAA0C,EAC1C,OAA0B,EAC1B,yBAEe,2BAA2B;IAE1C,+EAA+E;IAC/E,+CAA+C;IAC/C,8GAA8G;IAC9G,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,OAAkC,EAAE,cAAwB,EAAE,EAAE;QACjF,6EAA6E;QAC7E,IAAI,cAAc,KAAK,KAAK,IAAI,sBAAsB,CAAC,OAAO,CAAC,EAAE,CAAC;YACjE,OAAO;QACR,CAAC;QAED,6EAA6E;QAC7E,MAAM,eAAe,GAAG,6BAA6B,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;QACpF,IAAI,eAAe,KAAK,SAAS,EAAE,CAAC;YACnC,OAAO;QACR,CAAC;QAED,iBAAiB,CAAC,qBAAqB,CAAC,eAAe,CAAC,CAAC;IAC1D,CAAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ContainerMessageType } from \"@fluidframework/container-runtime/internal\";\nimport type { IContainerRuntime } from \"@fluidframework/container-runtime-definitions/internal\";\nimport type { IQuorumClients } from \"@fluidframework/driver-definitions\";\nimport type { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\n\nimport type { IFluidLastEditedTracker, ILastEditDetails } from \"./interfaces.js\";\n\n/**\n * Default implementation of {@link setupLastEditedTrackerForContainer}'s `shouldDiscardMessageFn` parameter,\n * which tells that all messages other than {@link @fluidframework/container-runtime#ContainerMessageType.Alias},\n * {@link @fluidframework/container-runtime#ContainerMessageType.Attach}, and\n * {@link @fluidframework/container-runtime#ContainerMessageType.FluidDataStoreOp} type messages should be\n * discarded.\n */\nconst shouldDiscardMessageDefault = (message: ISequencedDocumentMessage): boolean =>\n\tmessage.type !== ContainerMessageType.Attach &&\n\tmessage.type !== ContainerMessageType.FluidDataStoreOp &&\n\tmessage.type !== ContainerMessageType.Alias;\n\n/**\n * Extracts the user information and timestamp from a message. Returns undefined if the user information for the\n * client who sent the message doesn't exist in the quorum.\n */\nfunction getLastEditDetailsFromMessage(\n\tmessage: ISequencedDocumentMessage,\n\tquorum: IQuorumClients,\n): ILastEditDetails | undefined {\n\t// TODO: Verify whether this should be able to handle server-generated ops (with null clientId)\n\t// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n\tconst sequencedClient = quorum.getMember(message.clientId as string);\n\tconst user = sequencedClient?.client.user;\n\tif (user !== undefined) {\n\t\tconst lastEditDetails: ILastEditDetails = {\n\t\t\tuser,\n\t\t\ttimestamp: message.timestamp,\n\t\t};\n\t\treturn lastEditDetails;\n\t}\n\treturn undefined;\n}\n\n/**\n * Helper function to set up a data object that provides IFluidLastEditedTracker to track last edited in a Container.\n *\n * It does the following:\n *\n * - Registers an \"op\" listener on the runtime. On each message, it calls the shouldDiscardMessageFn to check\n * if the message should be discarded. It also discards all scheduler message. If a message is not discarded,\n * it passes the last edited information from the message to the last edited tracker.\n *\n * - The last edited information from the last message received before the lastEditedTracker is\n * loaded is stored and passed to the tracker once it loads.\n * @param lastEditedTracker - The last edited tracker.\n * @param runtime - The container runtime whose messages are to be tracked.\n * @param shouldDiscardMessageFn - Function that tells if a message should not be considered in computing last edited.\n * @internal\n */\nexport function setupLastEditedTrackerForContainer(\n\tlastEditedTracker: IFluidLastEditedTracker,\n\truntime: IContainerRuntime,\n\tshouldDiscardMessageFn: (\n\t\tmessage: ISequencedDocumentMessage,\n\t) => boolean = shouldDiscardMessageDefault,\n): void {\n\t// Register an op listener on the runtime. If the lastEditedTracker has loaded,\n\t// it passes the last edited information to its\n\t// last edited tracker. If the lastEditedTracker hasn't loaded, store the last edited information temporarily.\n\truntime.on(\"op\", (message: ISequencedDocumentMessage, runtimeMessage?: boolean) => {\n\t\t// If this message should be discarded as per shouldDiscardMessageFn, return.\n\t\tif (runtimeMessage === false || shouldDiscardMessageFn(message)) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Get the last edited details from the message. If it doesn't exist, return.\n\t\tconst lastEditDetails = getLastEditDetailsFromMessage(message, runtime.getQuorum());\n\t\tif (lastEditDetails === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\tlastEditedTracker.updateLastEditDetails(lastEditDetails);\n\t});\n}\n"]}
1
+ {"version":3,"file":"setup.js","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAOlF;;;;;;GAMG;AACH,MAAM,2BAA2B,GAAG,CAAC,OAAkC,EAAW,EAAE,CACnF,OAAO,CAAC,IAAI,KAAK,oBAAoB,CAAC,MAAM;IAC5C,OAAO,CAAC,IAAI,KAAK,oBAAoB,CAAC,gBAAgB;IACtD,OAAO,CAAC,IAAI,KAAK,oBAAoB,CAAC,KAAK,CAAC;AAE7C;;;GAGG;AACH,SAAS,6BAA6B,CACrC,OAAkC,EAClC,MAAsB;IAEtB,+FAA+F;IAC/F,MAAM,eAAe,GAAG,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,QAAkB,CAAC,CAAC;IACrE,MAAM,IAAI,GAAG,eAAe,EAAE,MAAM,CAAC,IAAI,CAAC;IAC1C,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACxB,MAAM,eAAe,GAAqB;YACzC,IAAI;YACJ,SAAS,EAAE,OAAO,CAAC,SAAS;SAC5B,CAAC;QACF,OAAO,eAAe,CAAC;IACxB,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,kCAAkC,CACjD,iBAA0C,EAC1C,OAA0B,EAC1B,yBAEe,2BAA2B;IAE1C,+EAA+E;IAC/E,+CAA+C;IAC/C,8GAA8G;IAC9G,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,OAAkC,EAAE,cAAwB,EAAE,EAAE;QACjF,6EAA6E;QAC7E,IAAI,cAAc,KAAK,KAAK,IAAI,sBAAsB,CAAC,OAAO,CAAC,EAAE,CAAC;YACjE,OAAO;QACR,CAAC;QAED,6EAA6E;QAC7E,MAAM,eAAe,GAAG,6BAA6B,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;QACpF,IAAI,eAAe,KAAK,SAAS,EAAE,CAAC;YACnC,OAAO;QACR,CAAC;QAED,iBAAiB,CAAC,qBAAqB,CAAC,eAAe,CAAC,CAAC;IAC1D,CAAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ContainerMessageType } from \"@fluidframework/container-runtime/internal\";\nimport type { IContainerRuntime } from \"@fluidframework/container-runtime-definitions/internal\";\nimport type { IQuorumClients } from \"@fluidframework/driver-definitions\";\nimport type { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\n\nimport type { IFluidLastEditedTracker, ILastEditDetails } from \"./interfaces.js\";\n\n/**\n * Default implementation of {@link setupLastEditedTrackerForContainer}'s `shouldDiscardMessageFn` parameter,\n * which tells that all messages other than {@link @fluidframework/container-runtime#ContainerMessageType.Alias},\n * {@link @fluidframework/container-runtime#ContainerMessageType.Attach}, and\n * {@link @fluidframework/container-runtime#ContainerMessageType.FluidDataStoreOp} type messages should be\n * discarded.\n */\nconst shouldDiscardMessageDefault = (message: ISequencedDocumentMessage): boolean =>\n\tmessage.type !== ContainerMessageType.Attach &&\n\tmessage.type !== ContainerMessageType.FluidDataStoreOp &&\n\tmessage.type !== ContainerMessageType.Alias;\n\n/**\n * Extracts the user information and timestamp from a message. Returns undefined if the user information for the\n * client who sent the message doesn't exist in the quorum.\n */\nfunction getLastEditDetailsFromMessage(\n\tmessage: ISequencedDocumentMessage,\n\tquorum: IQuorumClients,\n): ILastEditDetails | undefined {\n\t// TODO: Verify whether this should be able to handle server-generated ops (with null clientId)\n\tconst sequencedClient = quorum.getMember(message.clientId as string);\n\tconst user = sequencedClient?.client.user;\n\tif (user !== undefined) {\n\t\tconst lastEditDetails: ILastEditDetails = {\n\t\t\tuser,\n\t\t\ttimestamp: message.timestamp,\n\t\t};\n\t\treturn lastEditDetails;\n\t}\n\treturn undefined;\n}\n\n/**\n * Helper function to set up a data object that provides IFluidLastEditedTracker to track last edited in a Container.\n *\n * It does the following:\n *\n * - Registers an \"op\" listener on the runtime. On each message, it calls the shouldDiscardMessageFn to check\n * if the message should be discarded. It also discards all scheduler message. If a message is not discarded,\n * it passes the last edited information from the message to the last edited tracker.\n *\n * - The last edited information from the last message received before the lastEditedTracker is\n * loaded is stored and passed to the tracker once it loads.\n * @param lastEditedTracker - The last edited tracker.\n * @param runtime - The container runtime whose messages are to be tracked.\n * @param shouldDiscardMessageFn - Function that tells if a message should not be considered in computing last edited.\n * @internal\n */\nexport function setupLastEditedTrackerForContainer(\n\tlastEditedTracker: IFluidLastEditedTracker,\n\truntime: IContainerRuntime,\n\tshouldDiscardMessageFn: (\n\t\tmessage: ISequencedDocumentMessage,\n\t) => boolean = shouldDiscardMessageDefault,\n): void {\n\t// Register an op listener on the runtime. If the lastEditedTracker has loaded,\n\t// it passes the last edited information to its\n\t// last edited tracker. If the lastEditedTracker hasn't loaded, store the last edited information temporarily.\n\truntime.on(\"op\", (message: ISequencedDocumentMessage, runtimeMessage?: boolean) => {\n\t\t// If this message should be discarded as per shouldDiscardMessageFn, return.\n\t\tif (runtimeMessage === false || shouldDiscardMessageFn(message)) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Get the last edited details from the message. If it doesn't exist, return.\n\t\tconst lastEditDetails = getLastEditDetailsFromMessage(message, runtime.getQuorum());\n\t\tif (lastEditDetails === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\tlastEditedTracker.updateLastEditDetails(lastEditDetails);\n\t});\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-experimental/last-edited",
3
- "version": "2.90.0-378676",
3
+ "version": "2.90.0",
4
4
  "description": "Tracks the last edited information in the Container.",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -27,13 +27,13 @@
27
27
  "main": "lib/index.js",
28
28
  "types": "lib/index.d.ts",
29
29
  "dependencies": {
30
- "@fluidframework/aqueduct": "2.90.0-378676",
31
- "@fluidframework/container-runtime": "2.90.0-378676",
32
- "@fluidframework/container-runtime-definitions": "2.90.0-378676",
33
- "@fluidframework/core-interfaces": "2.90.0-378676",
34
- "@fluidframework/driver-definitions": "2.90.0-378676",
35
- "@fluidframework/runtime-utils": "2.90.0-378676",
36
- "@fluidframework/shared-summary-block": "2.90.0-378676"
30
+ "@fluidframework/aqueduct": "~2.90.0",
31
+ "@fluidframework/container-runtime": "~2.90.0",
32
+ "@fluidframework/container-runtime-definitions": "~2.90.0",
33
+ "@fluidframework/core-interfaces": "~2.90.0",
34
+ "@fluidframework/driver-definitions": "~2.90.0",
35
+ "@fluidframework/runtime-utils": "~2.90.0",
36
+ "@fluidframework/shared-summary-block": "~2.90.0"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@arethetypeswrong/cli": "^0.18.2",
@@ -41,14 +41,14 @@
41
41
  "@fluid-tools/build-cli": "^0.63.0",
42
42
  "@fluidframework/build-common": "^2.0.3",
43
43
  "@fluidframework/build-tools": "^0.63.0",
44
- "@fluidframework/eslint-config-fluid": "2.90.0-378676",
44
+ "@fluidframework/eslint-config-fluid": "~2.90.0",
45
45
  "@microsoft/api-extractor": "7.52.11",
46
46
  "@types/node": "~20.19.30",
47
47
  "concurrently": "^9.2.1",
48
48
  "copyfiles": "^2.4.1",
49
49
  "eslint": "~9.39.1",
50
50
  "jiti": "^2.6.1",
51
- "rimraf": "^6.1.2",
51
+ "rimraf": "^6.1.3",
52
52
  "typescript": "~5.4.5"
53
53
  },
54
54
  "typeValidation": {
package/src/setup.ts CHANGED
@@ -31,7 +31,6 @@ function getLastEditDetailsFromMessage(
31
31
  quorum: IQuorumClients,
32
32
  ): ILastEditDetails | undefined {
33
33
  // TODO: Verify whether this should be able to handle server-generated ops (with null clientId)
34
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
35
34
  const sequencedClient = quorum.getMember(message.clientId as string);
36
35
  const user = sequencedClient?.client.user;
37
36
  if (user !== undefined) {