@fluidframework/runtime-definitions 2.0.0-internal.3.0.1 → 2.0.0-internal.3.1.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/.eslintrc.js +5 -7
- package/README.md +6 -6
- package/api-extractor.json +2 -2
- package/dist/attribution.d.ts +66 -0
- package/dist/attribution.d.ts.map +1 -0
- package/dist/attribution.js +7 -0
- package/dist/attribution.js.map +1 -0
- package/dist/dataStoreContext.d.ts +3 -3
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStoreFactory.d.ts.map +1 -1
- package/dist/dataStoreFactory.js.map +1 -1
- package/dist/dataStoreRegistry.d.ts +1 -1
- package/dist/dataStoreRegistry.d.ts.map +1 -1
- package/dist/dataStoreRegistry.js.map +1 -1
- package/dist/garbageCollection.d.ts.map +1 -1
- package/dist/garbageCollection.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/protocol.d.ts +2 -2
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js.map +1 -1
- package/dist/summary.d.ts.map +1 -1
- package/dist/summary.js.map +1 -1
- package/package.json +64 -74
- package/prettier.config.cjs +1 -1
- package/src/attribution.ts +72 -0
- package/src/dataStoreContext.ts +405 -407
- package/src/dataStoreFactory.ts +14 -11
- package/src/dataStoreRegistry.ts +8 -6
- package/src/garbageCollection.ts +12 -12
- package/src/index.ts +21 -9
- package/src/protocol.ts +39 -38
- package/src/summary.ts +210 -211
- package/tsconfig.json +8 -12
package/src/dataStoreFactory.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { IFluidDataStoreContext, IFluidDataStoreChannel } from "./dataStoreConte
|
|
|
8
8
|
export const IFluidDataStoreFactory: keyof IProvideFluidDataStoreFactory = "IFluidDataStoreFactory";
|
|
9
9
|
|
|
10
10
|
export interface IProvideFluidDataStoreFactory {
|
|
11
|
-
|
|
11
|
+
readonly IFluidDataStoreFactory: IFluidDataStoreFactory;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -16,15 +16,18 @@ export interface IProvideFluidDataStoreFactory {
|
|
|
16
16
|
* and usually provided to consumers using this mapping through a data store registry.
|
|
17
17
|
*/
|
|
18
18
|
export interface IFluidDataStoreFactory extends IProvideFluidDataStoreFactory {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
/**
|
|
20
|
+
* String that uniquely identifies the type of data store created by this factory.
|
|
21
|
+
*/
|
|
22
|
+
type: string;
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
/**
|
|
25
|
+
* Generates runtime for the data store from the data store context. Once created should be bound to the context.
|
|
26
|
+
* @param context - Context for the data store.
|
|
27
|
+
* @param existing - If instantiating from an existing file.
|
|
28
|
+
*/
|
|
29
|
+
instantiateDataStore(
|
|
30
|
+
context: IFluidDataStoreContext,
|
|
31
|
+
existing: boolean,
|
|
32
|
+
): Promise<IFluidDataStoreChannel>;
|
|
30
33
|
}
|
package/src/dataStoreRegistry.ts
CHANGED
|
@@ -7,10 +7,11 @@ import { IProvideFluidDataStoreFactory } from "./dataStoreFactory";
|
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* A single registry entry that may be used to create data stores
|
|
10
|
-
* It has to have either factory or registry, or both.
|
|
10
|
+
* It has to have either factory or registry, or both.
|
|
11
11
|
*/
|
|
12
|
-
export type FluidDataStoreRegistryEntry =
|
|
13
|
-
|
|
12
|
+
export type FluidDataStoreRegistryEntry = Readonly<
|
|
13
|
+
Partial<IProvideFluidDataStoreRegistry & IProvideFluidDataStoreFactory>
|
|
14
|
+
>;
|
|
14
15
|
/**
|
|
15
16
|
* An associated pair of an identifier and registry entry. Registry entries
|
|
16
17
|
* may be dynamically loaded.
|
|
@@ -21,10 +22,11 @@ export type NamedFluidDataStoreRegistryEntry = [string, Promise<FluidDataStoreRe
|
|
|
21
22
|
*/
|
|
22
23
|
export type NamedFluidDataStoreRegistryEntries = Iterable<NamedFluidDataStoreRegistryEntry>;
|
|
23
24
|
|
|
24
|
-
export const IFluidDataStoreRegistry: keyof IProvideFluidDataStoreRegistry =
|
|
25
|
+
export const IFluidDataStoreRegistry: keyof IProvideFluidDataStoreRegistry =
|
|
26
|
+
"IFluidDataStoreRegistry";
|
|
25
27
|
|
|
26
28
|
export interface IProvideFluidDataStoreRegistry {
|
|
27
|
-
|
|
29
|
+
readonly IFluidDataStoreRegistry: IFluidDataStoreRegistry;
|
|
28
30
|
}
|
|
29
31
|
|
|
30
32
|
/**
|
|
@@ -32,5 +34,5 @@ export interface IProvideFluidDataStoreRegistry {
|
|
|
32
34
|
* entries can be used to create data stores.
|
|
33
35
|
*/
|
|
34
36
|
export interface IFluidDataStoreRegistry extends IProvideFluidDataStoreRegistry {
|
|
35
|
-
|
|
37
|
+
get(name: string): Promise<FluidDataStoreRegistryEntry | undefined>;
|
|
36
38
|
}
|
package/src/garbageCollection.ts
CHANGED
|
@@ -17,22 +17,22 @@ export const gcDeletedBlobKey = "__deletedNodes";
|
|
|
17
17
|
* Used for running GC in the Container.
|
|
18
18
|
*/
|
|
19
19
|
export interface IGarbageCollectionData {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
/**
|
|
21
|
+
* The GC nodes of a Fluid object in the Container. Each node has an id and a set of routes to other GC nodes.
|
|
22
|
+
*/
|
|
23
|
+
gcNodes: { [id: string]: string[] };
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* GC details provided to each node during creation.
|
|
28
28
|
*/
|
|
29
29
|
export interface IGarbageCollectionDetailsBase {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
30
|
+
/**
|
|
31
|
+
* A list of routes to Fluid objects that are used in this node.
|
|
32
|
+
*/
|
|
33
|
+
usedRoutes?: string[];
|
|
34
|
+
/**
|
|
35
|
+
* The GC data of this node.
|
|
36
|
+
*/
|
|
37
|
+
gcData?: IGarbageCollectionData;
|
|
38
38
|
}
|
package/src/index.ts
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
export {
|
|
7
|
+
AttributionInfo,
|
|
8
|
+
AttributionKey,
|
|
9
|
+
DetachedAttributionKey,
|
|
10
|
+
OpAttributionKey,
|
|
11
|
+
} from "./attribution";
|
|
6
12
|
export {
|
|
7
13
|
AliasResult,
|
|
8
14
|
BindState,
|
|
@@ -26,23 +32,29 @@ export {
|
|
|
26
32
|
NamedFluidDataStoreRegistryEntry,
|
|
27
33
|
} from "./dataStoreRegistry";
|
|
28
34
|
export {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
gcBlobPrefix,
|
|
36
|
+
gcDeletedBlobKey,
|
|
37
|
+
gcTombstoneBlobKey,
|
|
38
|
+
gcTreeKey,
|
|
39
|
+
IGarbageCollectionData,
|
|
40
|
+
IGarbageCollectionDetailsBase,
|
|
35
41
|
} from "./garbageCollection";
|
|
36
|
-
export {
|
|
42
|
+
export {
|
|
43
|
+
IAttachMessage,
|
|
44
|
+
IEnvelope,
|
|
45
|
+
IInboundSignalMessage,
|
|
46
|
+
InboundAttachMessage,
|
|
47
|
+
ISignalEnvelope,
|
|
48
|
+
} from "./protocol";
|
|
37
49
|
export {
|
|
38
50
|
blobCountPropertyName,
|
|
39
51
|
channelsTreeName,
|
|
40
52
|
CreateChildSummarizerNodeParam,
|
|
41
53
|
CreateSummarizerNodeSource,
|
|
42
54
|
IGarbageCollectionNodeData,
|
|
43
|
-
|
|
55
|
+
IGarbageCollectionSnapshotData,
|
|
44
56
|
IGarbageCollectionState,
|
|
45
|
-
|
|
57
|
+
IGarbageCollectionSummaryDetailsLegacy,
|
|
46
58
|
ISummarizeInternalResult,
|
|
47
59
|
ISummarizeResult,
|
|
48
60
|
ISummarizerNode,
|
package/src/protocol.ts
CHANGED
|
@@ -9,42 +9,42 @@ import { ISignalMessage, ITree } from "@fluidframework/protocol-definitions";
|
|
|
9
9
|
* An envelope wraps the contents with the intended target
|
|
10
10
|
*/
|
|
11
11
|
export interface IEnvelope {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
/**
|
|
13
|
+
* The target for the envelope
|
|
14
|
+
*/
|
|
15
|
+
address: string;
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
/**
|
|
18
|
+
* The contents of the envelope
|
|
19
|
+
*/
|
|
20
|
+
contents: any;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export interface ISignalEnvelope {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
/**
|
|
25
|
+
* The target for the envelope, undefined for the container
|
|
26
|
+
*/
|
|
27
|
+
address?: string;
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Identifier for the signal being submitted.
|
|
31
|
+
*/
|
|
32
|
+
clientSignalSequenceNumber: number;
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
/**
|
|
35
|
+
* The contents of the envelope
|
|
36
|
+
*/
|
|
37
|
+
contents: {
|
|
38
|
+
type: string;
|
|
39
|
+
content: any;
|
|
40
|
+
};
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
44
|
* Represents ISignalMessage with its type.
|
|
45
45
|
*/
|
|
46
46
|
export interface IInboundSignalMessage extends ISignalMessage {
|
|
47
|
-
|
|
47
|
+
type: string;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
/**
|
|
@@ -52,20 +52,20 @@ export interface IInboundSignalMessage extends ISignalMessage {
|
|
|
52
52
|
* Contains snapshot of data structure which is the current state of this data structure.
|
|
53
53
|
*/
|
|
54
54
|
export interface IAttachMessage {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
/**
|
|
56
|
+
* The identifier for the object
|
|
57
|
+
*/
|
|
58
|
+
id: string;
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
/**
|
|
61
|
+
* The type of object
|
|
62
|
+
*/
|
|
63
|
+
type: string;
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
/**
|
|
66
|
+
* Initial snapshot of the document (contains ownership)
|
|
67
|
+
*/
|
|
68
|
+
snapshot: ITree;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
/**
|
|
@@ -74,5 +74,6 @@ export interface IAttachMessage {
|
|
|
74
74
|
* Older versions of attach messages could have null snapshots,
|
|
75
75
|
* so this gives correct typings for writing backward compatible code.
|
|
76
76
|
*/
|
|
77
|
-
export type InboundAttachMessage = Omit<IAttachMessage, "snapshot">
|
|
78
|
-
|
|
77
|
+
export type InboundAttachMessage = Omit<IAttachMessage, "snapshot"> & {
|
|
78
|
+
snapshot: IAttachMessage["snapshot"] | null;
|
|
79
|
+
};
|