@fluid-experimental/last-edited 2.0.0-dev.7.4.0.217884 → 2.0.0-dev.7.4.0.221926

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.0.0-internal.7.4.0
4
+
5
+ Dependency updates only.
6
+
3
7
  ## 2.0.0-internal.7.3.0
4
8
 
5
9
  Dependency updates only.
@@ -0,0 +1,22 @@
1
+ import { DataObject } from '@fluidframework/aqueduct';
2
+ import { DataObjectFactory } from '@fluidframework/aqueduct';
3
+ import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
4
+ import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
5
+ import { IUser } from '@fluidframework/protocol-definitions';
6
+ import { SharedSummaryBlock } from '@fluidframework/shared-summary-block';
7
+
8
+ /* Excluded from this release type: IFluidLastEditedTracker */
9
+
10
+ /* Excluded from this release type: ILastEditDetails */
11
+
12
+ /* Excluded from this release type: IProvideFluidLastEditedTracker */
13
+
14
+ /* Excluded from this release type: LastEditedTracker */
15
+
16
+ /* Excluded from this release type: LastEditedTrackerDataObject */
17
+
18
+ /* Excluded from this release type: setupLastEditedTrackerForContainer */
19
+
20
+ /* Excluded from this release type: SharedSummaryBlock */
21
+
22
+ export { }
@@ -0,0 +1,28 @@
1
+ import { DataObject } from '@fluidframework/aqueduct';
2
+ import { DataObjectFactory } from '@fluidframework/aqueduct';
3
+ import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
4
+ import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
5
+ import { IUser } from '@fluidframework/protocol-definitions';
6
+ import { SharedSummaryBlock } from '@fluidframework/shared-summary-block';
7
+
8
+ /* Excluded from this release type: DataObject */
9
+
10
+ /* Excluded from this release type: DataObjectFactory */
11
+
12
+ /* Excluded from this release type: IContainerRuntime */
13
+
14
+ /* Excluded from this release type: IFluidLastEditedTracker */
15
+
16
+ /* Excluded from this release type: ILastEditDetails */
17
+
18
+ /* Excluded from this release type: IProvideFluidLastEditedTracker */
19
+
20
+ /* Excluded from this release type: LastEditedTracker */
21
+
22
+ /* Excluded from this release type: LastEditedTrackerDataObject */
23
+
24
+ /* Excluded from this release type: setupLastEditedTrackerForContainer */
25
+
26
+ /* Excluded from this release type: SharedSummaryBlock */
27
+
28
+ export { }
@@ -0,0 +1,28 @@
1
+ import { DataObject } from '@fluidframework/aqueduct';
2
+ import { DataObjectFactory } from '@fluidframework/aqueduct';
3
+ import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
4
+ import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
5
+ import { IUser } from '@fluidframework/protocol-definitions';
6
+ import { SharedSummaryBlock } from '@fluidframework/shared-summary-block';
7
+
8
+ /* Excluded from this release type: DataObject */
9
+
10
+ /* Excluded from this release type: DataObjectFactory */
11
+
12
+ /* Excluded from this release type: IContainerRuntime */
13
+
14
+ /* Excluded from this release type: IFluidLastEditedTracker */
15
+
16
+ /* Excluded from this release type: ILastEditDetails */
17
+
18
+ /* Excluded from this release type: IProvideFluidLastEditedTracker */
19
+
20
+ /* Excluded from this release type: LastEditedTracker */
21
+
22
+ /* Excluded from this release type: LastEditedTrackerDataObject */
23
+
24
+ /* Excluded from this release type: setupLastEditedTrackerForContainer */
25
+
26
+ /* Excluded from this release type: SharedSummaryBlock */
27
+
28
+ export { }
@@ -0,0 +1,100 @@
1
+ import { DataObject } from '@fluidframework/aqueduct';
2
+ import { DataObjectFactory } from '@fluidframework/aqueduct';
3
+ import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
4
+ import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
5
+ import { IUser } from '@fluidframework/protocol-definitions';
6
+ import { SharedSummaryBlock } from '@fluidframework/shared-summary-block';
7
+
8
+ /**
9
+ * @internal
10
+ */
11
+ export declare const IFluidLastEditedTracker: keyof IProvideFluidLastEditedTracker;
12
+
13
+ /**
14
+ * @internal
15
+ */
16
+ export declare interface IFluidLastEditedTracker extends IProvideFluidLastEditedTracker {
17
+ /**
18
+ * Returns the details of the last edit to the container.
19
+ */
20
+ getLastEditDetails(): ILastEditDetails | undefined;
21
+ /**
22
+ * Updates the details of last edit to the container.
23
+ */
24
+ updateLastEditDetails(lastEditDetails: ILastEditDetails): void;
25
+ }
26
+
27
+ /**
28
+ * @internal
29
+ */
30
+ export declare interface ILastEditDetails {
31
+ user: IUser;
32
+ timestamp: number;
33
+ }
34
+
35
+ /**
36
+ * @internal
37
+ */
38
+ export declare interface IProvideFluidLastEditedTracker {
39
+ readonly IFluidLastEditedTracker: IFluidLastEditedTracker;
40
+ }
41
+
42
+ /**
43
+ * Tracks the last edit details such as the last edited user details and the last edited timestamp. The last edited
44
+ * details should be updated (via updateLastEditDetails) in response to a remote op since it uses shared summary block
45
+ * as storage.
46
+ * @internal
47
+ */
48
+ export declare class LastEditedTracker implements IFluidLastEditedTracker {
49
+ private readonly sharedSummaryBlock;
50
+ private readonly lastEditedDetailsKey;
51
+ /**
52
+ * Creates a LastEditedTracker object.
53
+ * @param sharedSummaryBlock - The shared summary block where the details will be stored.
54
+ */
55
+ constructor(sharedSummaryBlock: SharedSummaryBlock);
56
+ get IFluidLastEditedTracker(): LastEditedTracker;
57
+ /**
58
+ * {@inheritDoc (IFluidLastEditedTracker:interface).getLastEditDetails}
59
+ */
60
+ getLastEditDetails(): ILastEditDetails | undefined;
61
+ /**
62
+ * {@inheritDoc (IFluidLastEditedTracker:interface).updateLastEditDetails}
63
+ */
64
+ updateLastEditDetails(lastEditDetails: ILastEditDetails): void;
65
+ }
66
+
67
+ /**
68
+ * LastEditedTrackerDataObject creates a LastEditedTracker that keeps track of the latest edits to the document.
69
+ * @internal
70
+ */
71
+ export declare class LastEditedTrackerDataObject extends DataObject implements IProvideFluidLastEditedTracker {
72
+ private static readonly factory;
73
+ static getFactory(): DataObjectFactory<LastEditedTrackerDataObject>;
74
+ private readonly sharedSummaryBlockId;
75
+ private _lastEditedTracker;
76
+ private get lastEditedTracker();
77
+ get IFluidLastEditedTracker(): LastEditedTracker;
78
+ protected initializingFirstTime(): Promise<void>;
79
+ protected hasInitialized(): Promise<void>;
80
+ }
81
+
82
+ /**
83
+ * Helper function to set up a data object that provides IFluidLastEditedTracker to track last edited in a Container.
84
+ *
85
+ * It does the following:
86
+ *
87
+ * - Registers an "op" listener on the runtime. On each message, it calls the shouldDiscardMessageFn to check
88
+ * if the message should be discarded. It also discards all scheduler message. If a message is not discarded,
89
+ * it passes the last edited information from the message to the last edited tracker.
90
+ *
91
+ * - The last edited information from the last message received before the lastEditedTracker is
92
+ * loaded is stored and passed to the tracker once it loads.
93
+ * @param lastEditedTracker - The last edited tracker.
94
+ * @param runtime - The container runtime whose messages are to be tracked.
95
+ * @param shouldDiscardMessageFn - Function that tells if a message should not be considered in computing last edited.
96
+ * @internal
97
+ */
98
+ export declare function setupLastEditedTrackerForContainer(lastEditedTracker: IFluidLastEditedTracker, runtime: IContainerRuntime, shouldDiscardMessageFn?: (message: ISequencedDocumentMessage) => boolean): void;
99
+
100
+ export { }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-experimental/last-edited",
3
- "version": "2.0.0-dev.7.4.0.217884",
3
+ "version": "2.0.0-dev.7.4.0.221926",
4
4
  "description": "Tracks the last edited information in the Container.",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -35,20 +35,20 @@
35
35
  "temp-directory": "nyc/.nyc_output"
36
36
  },
37
37
  "dependencies": {
38
- "@fluidframework/aqueduct": "2.0.0-dev.7.4.0.217884",
39
- "@fluidframework/container-runtime": "2.0.0-dev.7.4.0.217884",
40
- "@fluidframework/container-runtime-definitions": "2.0.0-dev.7.4.0.217884",
41
- "@fluidframework/core-interfaces": "2.0.0-dev.7.4.0.217884",
38
+ "@fluidframework/aqueduct": "2.0.0-dev.7.4.0.221926",
39
+ "@fluidframework/container-runtime": "2.0.0-dev.7.4.0.221926",
40
+ "@fluidframework/container-runtime-definitions": "2.0.0-dev.7.4.0.221926",
41
+ "@fluidframework/core-interfaces": "2.0.0-dev.7.4.0.221926",
42
42
  "@fluidframework/protocol-definitions": "^3.0.0",
43
- "@fluidframework/runtime-utils": "2.0.0-dev.7.4.0.217884",
44
- "@fluidframework/shared-summary-block": "2.0.0-dev.7.4.0.217884"
43
+ "@fluidframework/runtime-utils": "2.0.0-dev.7.4.0.221926",
44
+ "@fluidframework/shared-summary-block": "2.0.0-dev.7.4.0.221926"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@fluid-tools/build-cli": "^0.28.0",
48
48
  "@fluidframework/build-common": "^2.0.3",
49
49
  "@fluidframework/build-tools": "^0.28.0",
50
50
  "@fluidframework/eslint-config-fluid": "^3.1.0",
51
- "@fluidframework/mocha-test-setup": "2.0.0-dev.7.4.0.217884",
51
+ "@fluidframework/mocha-test-setup": "2.0.0-dev.7.4.0.221926",
52
52
  "@microsoft/api-extractor": "^7.38.3",
53
53
  "@types/node": "^18.19.0",
54
54
  "eslint": "~8.50.0",