@fluidframework/runtime-definitions 1.4.0-121020 → 2.0.0-dev-rc.1.0.0.225277

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 (55) hide show
  1. package/.eslintrc.cjs +12 -0
  2. package/CHANGELOG.md +330 -0
  3. package/README.md +43 -7
  4. package/api-extractor-lint.json +4 -0
  5. package/api-extractor.json +2 -2
  6. package/api-report/runtime-definitions.api.md +474 -0
  7. package/dist/attribution.d.ts +71 -0
  8. package/dist/attribution.d.ts.map +1 -0
  9. package/dist/attribution.js +7 -0
  10. package/dist/attribution.js.map +1 -0
  11. package/dist/dataStoreContext.d.ts +114 -61
  12. package/dist/dataStoreContext.d.ts.map +1 -1
  13. package/dist/dataStoreContext.js +27 -5
  14. package/dist/dataStoreContext.js.map +1 -1
  15. package/dist/dataStoreFactory.d.ts +7 -0
  16. package/dist/dataStoreFactory.d.ts.map +1 -1
  17. package/dist/dataStoreFactory.js +3 -0
  18. package/dist/dataStoreFactory.js.map +1 -1
  19. package/dist/dataStoreRegistry.d.ts +14 -4
  20. package/dist/dataStoreRegistry.d.ts.map +1 -1
  21. package/dist/dataStoreRegistry.js +3 -0
  22. package/dist/dataStoreRegistry.js.map +1 -1
  23. package/dist/garbageCollection.d.ts +35 -10
  24. package/dist/garbageCollection.d.ts.map +1 -1
  25. package/dist/garbageCollection.js +25 -3
  26. package/dist/garbageCollection.js.map +1 -1
  27. package/dist/index.d.ts +52 -6
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +26 -16
  30. package/dist/index.js.map +1 -1
  31. package/dist/protocol.d.ts +10 -3
  32. package/dist/protocol.d.ts.map +1 -1
  33. package/dist/protocol.js.map +1 -1
  34. package/dist/runtime-definitions-alpha.d.ts +993 -0
  35. package/dist/runtime-definitions-beta.d.ts +264 -0
  36. package/dist/runtime-definitions-public.d.ts +264 -0
  37. package/dist/runtime-definitions-untrimmed.d.ts +1068 -0
  38. package/dist/summary.d.ts +138 -70
  39. package/dist/summary.d.ts.map +1 -1
  40. package/dist/summary.js +13 -1
  41. package/dist/summary.js.map +1 -1
  42. package/dist/tsdoc-metadata.json +11 -0
  43. package/package.json +100 -40
  44. package/prettier.config.cjs +8 -0
  45. package/src/aliasing.md +42 -0
  46. package/src/attribution.ts +78 -0
  47. package/src/dataStoreContext.ts +432 -388
  48. package/src/dataStoreFactory.ts +21 -11
  49. package/src/dataStoreRegistry.ts +18 -6
  50. package/src/garbageCollection.ts +38 -15
  51. package/src/index.ts +111 -6
  52. package/src/protocol.ts +46 -38
  53. package/src/summary.ts +298 -225
  54. package/tsconfig.json +10 -12
  55. package/.eslintrc.js +0 -13
@@ -5,26 +5,36 @@
5
5
 
6
6
  import { IFluidDataStoreContext, IFluidDataStoreChannel } from "./dataStoreContext";
7
7
 
8
+ /**
9
+ * @alpha
10
+ */
8
11
  export const IFluidDataStoreFactory: keyof IProvideFluidDataStoreFactory = "IFluidDataStoreFactory";
9
12
 
13
+ /**
14
+ * @alpha
15
+ */
10
16
  export interface IProvideFluidDataStoreFactory {
11
- readonly IFluidDataStoreFactory: IFluidDataStoreFactory;
17
+ readonly IFluidDataStoreFactory: IFluidDataStoreFactory;
12
18
  }
13
19
 
14
20
  /**
15
21
  * IFluidDataStoreFactory create data stores. It is associated with an identifier (its `type` member)
16
22
  * and usually provided to consumers using this mapping through a data store registry.
23
+ * @alpha
17
24
  */
18
25
  export interface IFluidDataStoreFactory extends IProvideFluidDataStoreFactory {
19
- /**
20
- * String that uniquely identifies the type of data store created by this factory.
21
- */
22
- type: string;
26
+ /**
27
+ * String that uniquely identifies the type of data store created by this factory.
28
+ */
29
+ type: string;
23
30
 
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>;
31
+ /**
32
+ * Generates runtime for the data store from the data store context. Once created should be bound to the context.
33
+ * @param context - Context for the data store.
34
+ * @param existing - If instantiating from an existing file.
35
+ */
36
+ instantiateDataStore(
37
+ context: IFluidDataStoreContext,
38
+ existing: boolean,
39
+ ): Promise<IFluidDataStoreChannel>;
30
40
  }
@@ -7,30 +7,42 @@ 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
+ * @alpha
11
12
  */
12
- export type FluidDataStoreRegistryEntry =
13
- Readonly<Partial<IProvideFluidDataStoreRegistry & IProvideFluidDataStoreFactory>>;
13
+ export type FluidDataStoreRegistryEntry = Readonly<
14
+ Partial<IProvideFluidDataStoreRegistry & IProvideFluidDataStoreFactory>
15
+ >;
14
16
  /**
15
17
  * An associated pair of an identifier and registry entry. Registry entries
16
18
  * may be dynamically loaded.
19
+ * @alpha
17
20
  */
18
21
  export type NamedFluidDataStoreRegistryEntry = [string, Promise<FluidDataStoreRegistryEntry>];
19
22
  /**
20
23
  * An iterable identifier/registry entry pair list
24
+ * @alpha
21
25
  */
22
26
  export type NamedFluidDataStoreRegistryEntries = Iterable<NamedFluidDataStoreRegistryEntry>;
23
27
 
24
- export const IFluidDataStoreRegistry: keyof IProvideFluidDataStoreRegistry = "IFluidDataStoreRegistry";
28
+ /**
29
+ * @alpha
30
+ */
31
+ export const IFluidDataStoreRegistry: keyof IProvideFluidDataStoreRegistry =
32
+ "IFluidDataStoreRegistry";
25
33
 
34
+ /**
35
+ * @alpha
36
+ */
26
37
  export interface IProvideFluidDataStoreRegistry {
27
- readonly IFluidDataStoreRegistry: IFluidDataStoreRegistry;
38
+ readonly IFluidDataStoreRegistry: IFluidDataStoreRegistry;
28
39
  }
29
40
 
30
41
  /**
31
42
  * An association of identifiers to data store registry entries, where the
32
43
  * entries can be used to create data stores.
44
+ * @alpha
33
45
  */
34
46
  export interface IFluidDataStoreRegistry extends IProvideFluidDataStoreRegistry {
35
- get(name: string): Promise<FluidDataStoreRegistryEntry | undefined>;
47
+ get(name: string): Promise<FluidDataStoreRegistryEntry | undefined>;
36
48
  }
@@ -3,31 +3,54 @@
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
+ /**
7
+ * The key for the GC tree in summary.
8
+ *
9
+ * @internal
10
+ */
11
+ export const gcTreeKey = "gc";
12
+ /**
13
+ * They prefix for GC blobs in the GC tree in summary.
14
+ *
15
+ * @internal
16
+ */
17
+ export const gcBlobPrefix = "__gc";
18
+ /**
19
+ * The key for tombstone blob in the GC tree in summary.
20
+ *
21
+ * @internal
22
+ */
23
+ export const gcTombstoneBlobKey = "__tombstones";
24
+ /**
25
+ * The key for deleted nodes blob in the GC tree in summary.
26
+ *
27
+ * @internal
28
+ */
29
+ export const gcDeletedBlobKey = "__deletedNodes";
8
30
 
9
31
  /**
10
32
  * Garbage collection data returned by nodes in a Container.
11
33
  * Used for running GC in the Container.
34
+ * @public
12
35
  */
13
36
  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[]; };
37
+ /**
38
+ * The GC nodes of a Fluid object in the Container. Each node has an id and a set of routes to other GC nodes.
39
+ */
40
+ gcNodes: { [id: string]: string[] };
16
41
  }
17
42
 
18
43
  /**
19
44
  * GC details provided to each node during creation.
45
+ * @alpha
20
46
  */
21
47
  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;
48
+ /**
49
+ * A list of routes to Fluid objects that are used in this node.
50
+ */
51
+ usedRoutes?: string[];
52
+ /**
53
+ * The GC data of this node.
54
+ */
55
+ gcData?: IGarbageCollectionData;
28
56
  }
29
-
30
- /**
31
- * @deprecated - Kept for back-compat. This has been renamed to {@link IGarbageCollectionDetailsBase}.
32
- */
33
- export type IGarbageCollectionSummaryDetails = IGarbageCollectionDetailsBase;
package/src/index.ts CHANGED
@@ -3,9 +3,114 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- export * from "./dataStoreFactory";
7
- export * from "./dataStoreRegistry";
8
- export * from "./dataStoreContext";
9
- export * from "./garbageCollection";
10
- export * from "./protocol";
11
- export * from "./summary";
6
+ export {
7
+ AttributionInfo,
8
+ AttributionKey,
9
+ DetachedAttributionKey,
10
+ LocalAttributionKey,
11
+ OpAttributionKey,
12
+ } from "./attribution";
13
+ export {
14
+ AliasResult,
15
+ CreateChildSummarizerNodeFn,
16
+ FlushMode,
17
+ FlushModeExperimental,
18
+ IContainerRuntimeBase,
19
+ IContainerRuntimeBaseEvents,
20
+ IDataStore,
21
+ IFluidDataStoreChannel,
22
+ IFluidDataStoreContext,
23
+ IFluidDataStoreContextDetached,
24
+ IFluidDataStoreContextEvents,
25
+ VisibilityState,
26
+ } from "./dataStoreContext";
27
+ export { IFluidDataStoreFactory, IProvideFluidDataStoreFactory } from "./dataStoreFactory";
28
+ export {
29
+ FluidDataStoreRegistryEntry,
30
+ IFluidDataStoreRegistry,
31
+ IProvideFluidDataStoreRegistry,
32
+ NamedFluidDataStoreRegistryEntries,
33
+ NamedFluidDataStoreRegistryEntry,
34
+ } from "./dataStoreRegistry";
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";
50
+ export {
51
+ blobCountPropertyName,
52
+ channelsTreeName,
53
+ CreateChildSummarizerNodeParam,
54
+ CreateSummarizerNodeSource,
55
+ IExperimentalIncrementalSummaryContext,
56
+ ISummarizeInternalResult,
57
+ ISummarizeResult,
58
+ ISummarizerNode,
59
+ ISummarizerNodeConfig,
60
+ ISummarizerNodeConfigWithGC,
61
+ ISummarizerNodeWithGC,
62
+ ISummaryStats,
63
+ ISummaryTreeWithStats,
64
+ ITelemetryContext,
65
+ SummarizeInternalFn,
66
+ totalBlobSizePropertyName,
67
+ } from "./summary";
68
+
69
+ // Re-exports for backwards compatibility.
70
+ // Will be removed in the future.
71
+ export {
72
+ /**
73
+ * @deprecated Import from `@fluidframework/id-compressor` instead.
74
+ */
75
+ IdCompressor,
76
+ /**
77
+ * @deprecated Import from `@fluidframework/id-compressor` instead.
78
+ */
79
+ IIdCompressor,
80
+ /**
81
+ * @deprecated Import from `@fluidframework/id-compressor` instead.
82
+ */
83
+ IIdCompressorCore,
84
+ /**
85
+ * @deprecated Import from `@fluidframework/id-compressor` instead.
86
+ */
87
+ IdCreationRange,
88
+ /**
89
+ * @deprecated Import from `@fluidframework/id-compressor` instead.
90
+ */
91
+ OpSpaceCompressedId,
92
+ /**
93
+ * @deprecated Import from `@fluidframework/id-compressor` instead.
94
+ */
95
+ SerializedIdCompressor,
96
+ /**
97
+ * @deprecated Import from `@fluidframework/id-compressor` instead.
98
+ */
99
+ SerializedIdCompressorWithNoSession,
100
+ /**
101
+ * @deprecated Import from `@fluidframework/id-compressor` instead.
102
+ */
103
+ SerializedIdCompressorWithOngoingSession,
104
+ /**
105
+ * @deprecated Import from `@fluidframework/id-compressor` instead.
106
+ */
107
+ SessionId,
108
+ /**
109
+ * @deprecated Import from `@fluidframework/id-compressor` instead.
110
+ */
111
+ SessionSpaceCompressedId,
112
+ /**
113
+ * @deprecated Import from `@fluidframework/id-compressor` instead.
114
+ */
115
+ StableId,
116
+ } from "@fluidframework/id-compressor";
package/src/protocol.ts CHANGED
@@ -7,65 +7,71 @@ import { ISignalMessage, ITree } from "@fluidframework/protocol-definitions";
7
7
 
8
8
  /**
9
9
  * An envelope wraps the contents with the intended target
10
+ * @alpha
10
11
  */
11
12
  export interface IEnvelope {
12
- /**
13
- * The target for the envelope
14
- */
15
- address: string;
13
+ /**
14
+ * The target for the envelope
15
+ */
16
+ address: string;
16
17
 
17
- /**
18
- * The contents of the envelope
19
- */
20
- contents: any;
18
+ /**
19
+ * The contents of the envelope
20
+ */
21
+ contents: any;
21
22
  }
22
23
 
24
+ /**
25
+ * @internal
26
+ */
23
27
  export interface ISignalEnvelope {
24
- /**
25
- * The target for the envelope, undefined for the container
26
- */
27
- address?: string;
28
+ /**
29
+ * The target for the envelope, undefined for the container
30
+ */
31
+ address?: string;
28
32
 
29
- /**
30
- * Identifier for the signal being submitted.
31
- */
32
- clientSignalSequenceNumber: number;
33
+ /**
34
+ * Identifier for the signal being submitted.
35
+ */
36
+ clientSignalSequenceNumber: number;
33
37
 
34
- /**
35
- * The contents of the envelope
36
- */
37
- contents: {
38
- type: string;
39
- content: any;
40
- };
38
+ /**
39
+ * The contents of the envelope
40
+ */
41
+ contents: {
42
+ type: string;
43
+ content: any;
44
+ };
41
45
  }
42
46
 
43
47
  /**
44
48
  * Represents ISignalMessage with its type.
49
+ * @public
45
50
  */
46
51
  export interface IInboundSignalMessage extends ISignalMessage {
47
- type: string;
52
+ type: string;
48
53
  }
49
54
 
50
55
  /**
51
56
  * Message send by client attaching local data structure.
52
57
  * Contains snapshot of data structure which is the current state of this data structure.
58
+ * @alpha
53
59
  */
54
60
  export interface IAttachMessage {
55
- /**
56
- * The identifier for the object
57
- */
58
- id: string;
61
+ /**
62
+ * The identifier for the object
63
+ */
64
+ id: string;
59
65
 
60
- /**
61
- * The type of object
62
- */
63
- type: string;
66
+ /**
67
+ * The type of object
68
+ */
69
+ type: string;
64
70
 
65
- /**
66
- * Initial snapshot of the document (contains ownership)
67
- */
68
- snapshot: ITree;
71
+ /**
72
+ * Initial snapshot of the document (contains ownership)
73
+ */
74
+ snapshot: ITree;
69
75
  }
70
76
 
71
77
  /**
@@ -73,6 +79,8 @@ export interface IAttachMessage {
73
79
  * but it should not be used when creating a new attach op.
74
80
  * Older versions of attach messages could have null snapshots,
75
81
  * so this gives correct typings for writing backward compatible code.
82
+ * @alpha
76
83
  */
77
- export type InboundAttachMessage = Omit<IAttachMessage, "snapshot">
78
- & { snapshot: IAttachMessage["snapshot"] | null; };
84
+ export type InboundAttachMessage = Omit<IAttachMessage, "snapshot"> & {
85
+ snapshot: IAttachMessage["snapshot"] | null;
86
+ };