@fluidframework/runtime-definitions 2.0.0-dev.2.3.0.115467 → 2.0.0-dev.4.1.0.148229

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 (41) hide show
  1. package/.eslintrc.js +5 -7
  2. package/README.md +6 -6
  3. package/api-extractor.json +2 -2
  4. package/dist/attribution.d.ts +74 -0
  5. package/dist/attribution.d.ts.map +1 -0
  6. package/dist/attribution.js +7 -0
  7. package/dist/attribution.js.map +1 -0
  8. package/dist/dataStoreContext.d.ts +39 -14
  9. package/dist/dataStoreContext.d.ts.map +1 -1
  10. package/dist/dataStoreContext.js +17 -9
  11. package/dist/dataStoreContext.js.map +1 -1
  12. package/dist/dataStoreFactory.d.ts.map +1 -1
  13. package/dist/dataStoreFactory.js.map +1 -1
  14. package/dist/dataStoreRegistry.d.ts +1 -1
  15. package/dist/dataStoreRegistry.d.ts.map +1 -1
  16. package/dist/dataStoreRegistry.js.map +1 -1
  17. package/dist/garbageCollection.d.ts +17 -6
  18. package/dist/garbageCollection.d.ts.map +1 -1
  19. package/dist/garbageCollection.js +9 -3
  20. package/dist/garbageCollection.js.map +1 -1
  21. package/dist/index.d.ts +5 -4
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +6 -3
  24. package/dist/index.js.map +1 -1
  25. package/dist/protocol.d.ts +2 -2
  26. package/dist/protocol.d.ts.map +1 -1
  27. package/dist/protocol.js.map +1 -1
  28. package/dist/summary.d.ts +105 -15
  29. package/dist/summary.d.ts.map +1 -1
  30. package/dist/summary.js.map +1 -1
  31. package/package.json +30 -35
  32. package/prettier.config.cjs +1 -1
  33. package/src/attribution.ts +81 -0
  34. package/src/dataStoreContext.ts +418 -395
  35. package/src/dataStoreFactory.ts +14 -11
  36. package/src/dataStoreRegistry.ts +8 -6
  37. package/src/garbageCollection.ts +20 -10
  38. package/src/index.ts +26 -3
  39. package/src/protocol.ts +39 -38
  40. package/src/summary.ts +275 -175
  41. package/tsconfig.json +8 -12
@@ -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
- readonly IFluidDataStoreFactory: IFluidDataStoreFactory;
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
- * String that uniquely identifies the type of data store created by this factory.
21
- */
22
- type: string;
19
+ /**
20
+ * String that uniquely identifies the type of data store created by this factory.
21
+ */
22
+ type: string;
23
23
 
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(context: IFluidDataStoreContext, existing: boolean): Promise<IFluidDataStoreChannel>;
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
  }
@@ -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
- Readonly<Partial<IProvideFluidDataStoreRegistry & IProvideFluidDataStoreFactory>>;
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 = "IFluidDataStoreRegistry";
25
+ export const IFluidDataStoreRegistry: keyof IProvideFluidDataStoreRegistry =
26
+ "IFluidDataStoreRegistry";
25
27
 
26
28
  export interface IProvideFluidDataStoreRegistry {
27
- readonly IFluidDataStoreRegistry: IFluidDataStoreRegistry;
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
- get(name: string): Promise<FluidDataStoreRegistryEntry | undefined>;
37
+ get(name: string): Promise<FluidDataStoreRegistryEntry | undefined>;
36
38
  }
@@ -3,26 +3,36 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- // The key to use for storing garbage collection blob in summary.
7
- export const gcBlobKey = "gc";
6
+ /** The key for the GC tree in summary. */
7
+ export const gcTreeKey = "gc";
8
+ /** They prefix for GC blobs in the GC tree in summary. */
9
+ export const gcBlobPrefix = "__gc";
10
+ /** The key for tombstone blob in the GC tree in summary. */
11
+ export const gcTombstoneBlobKey = "__tombstones";
12
+ /** The key for deleted nodes blob in the GC tree in summary. */
13
+ export const gcDeletedBlobKey = "__deletedNodes";
8
14
 
9
15
  /**
10
16
  * Garbage collection data returned by nodes in a Container.
11
17
  * Used for running GC in the Container.
12
18
  */
13
19
  export interface IGarbageCollectionData {
14
- /** The GC nodes of a Fluid object in the Container. Each node has an id and a set of routes to other GC nodes. */
15
- gcNodes: { [ id: string ]: string[]; };
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[] };
16
24
  }
17
25
 
18
26
  /**
19
27
  * GC details provided to each node during creation.
20
28
  */
21
29
  export interface IGarbageCollectionDetailsBase {
22
- /** A list of routes to Fluid objects that are used in this node. */
23
- usedRoutes?: string[];
24
- /** The GC data of this node. */
25
- gcData?: IGarbageCollectionData;
26
- /** If this node is unreferenced, the time when it was marked as such. */
27
- unrefTimestamp?: number;
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;
28
38
  }
package/src/index.ts CHANGED
@@ -3,11 +3,18 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
+ export {
7
+ AttributionInfo,
8
+ AttributionKey,
9
+ DetachedAttributionKey,
10
+ LocalAttributionKey,
11
+ OpAttributionKey,
12
+ } from "./attribution";
6
13
  export {
7
14
  AliasResult,
8
- BindState,
9
15
  CreateChildSummarizerNodeFn,
10
16
  FlushMode,
17
+ FlushModeExperimental,
11
18
  IContainerRuntimeBase,
12
19
  IContainerRuntimeBaseEvents,
13
20
  IDataStore,
@@ -25,15 +32,31 @@ export {
25
32
  NamedFluidDataStoreRegistryEntries,
26
33
  NamedFluidDataStoreRegistryEntry,
27
34
  } from "./dataStoreRegistry";
28
- export { gcBlobKey, IGarbageCollectionData, IGarbageCollectionDetailsBase } from "./garbageCollection";
29
- export { IAttachMessage, IEnvelope, IInboundSignalMessage, InboundAttachMessage, ISignalEnvelope } from "./protocol";
35
+ export {
36
+ gcBlobPrefix,
37
+ gcDeletedBlobKey,
38
+ gcTombstoneBlobKey,
39
+ gcTreeKey,
40
+ IGarbageCollectionData,
41
+ IGarbageCollectionDetailsBase,
42
+ } from "./garbageCollection";
43
+ export {
44
+ IAttachMessage,
45
+ IEnvelope,
46
+ IInboundSignalMessage,
47
+ InboundAttachMessage,
48
+ ISignalEnvelope,
49
+ } from "./protocol";
30
50
  export {
31
51
  blobCountPropertyName,
32
52
  channelsTreeName,
33
53
  CreateChildSummarizerNodeParam,
34
54
  CreateSummarizerNodeSource,
35
55
  IGarbageCollectionNodeData,
56
+ IGarbageCollectionSnapshotData,
36
57
  IGarbageCollectionState,
58
+ IGarbageCollectionSummaryDetailsLegacy,
59
+ IExperimentalIncrementalSummaryContext,
37
60
  ISummarizeInternalResult,
38
61
  ISummarizeResult,
39
62
  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
- * The target for the envelope
14
- */
15
- address: string;
12
+ /**
13
+ * The target for the envelope
14
+ */
15
+ address: string;
16
16
 
17
- /**
18
- * The contents of the envelope
19
- */
20
- contents: any;
17
+ /**
18
+ * The contents of the envelope
19
+ */
20
+ contents: any;
21
21
  }
22
22
 
23
23
  export interface ISignalEnvelope {
24
- /**
25
- * The target for the envelope, undefined for the container
26
- */
27
- address?: string;
24
+ /**
25
+ * The target for the envelope, undefined for the container
26
+ */
27
+ address?: string;
28
28
 
29
- /**
30
- * Identifier for the signal being submitted.
31
- */
32
- clientSignalSequenceNumber: number;
29
+ /**
30
+ * Identifier for the signal being submitted.
31
+ */
32
+ clientSignalSequenceNumber: number;
33
33
 
34
- /**
35
- * The contents of the envelope
36
- */
37
- contents: {
38
- type: string;
39
- content: any;
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
- type: string;
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
- * The identifier for the object
57
- */
58
- id: string;
55
+ /**
56
+ * The identifier for the object
57
+ */
58
+ id: string;
59
59
 
60
- /**
61
- * The type of object
62
- */
63
- type: string;
60
+ /**
61
+ * The type of object
62
+ */
63
+ type: string;
64
64
 
65
- /**
66
- * Initial snapshot of the document (contains ownership)
67
- */
68
- snapshot: ITree;
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
- & { snapshot: IAttachMessage["snapshot"] | null; };
77
+ export type InboundAttachMessage = Omit<IAttachMessage, "snapshot"> & {
78
+ snapshot: IAttachMessage["snapshot"] | null;
79
+ };