@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
package/dist/index.js CHANGED
@@ -4,17 +4,20 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.totalBlobSizePropertyName = exports.CreateSummarizerNodeSource = exports.channelsTreeName = exports.blobCountPropertyName = exports.gcBlobKey = exports.IFluidDataStoreRegistry = exports.IFluidDataStoreFactory = exports.VisibilityState = exports.FlushMode = exports.BindState = void 0;
7
+ exports.totalBlobSizePropertyName = exports.CreateSummarizerNodeSource = exports.channelsTreeName = exports.blobCountPropertyName = exports.gcTreeKey = exports.gcTombstoneBlobKey = exports.gcDeletedBlobKey = exports.gcBlobPrefix = exports.IFluidDataStoreRegistry = exports.IFluidDataStoreFactory = exports.VisibilityState = exports.FlushModeExperimental = exports.FlushMode = void 0;
8
8
  var dataStoreContext_1 = require("./dataStoreContext");
9
- Object.defineProperty(exports, "BindState", { enumerable: true, get: function () { return dataStoreContext_1.BindState; } });
10
9
  Object.defineProperty(exports, "FlushMode", { enumerable: true, get: function () { return dataStoreContext_1.FlushMode; } });
10
+ Object.defineProperty(exports, "FlushModeExperimental", { enumerable: true, get: function () { return dataStoreContext_1.FlushModeExperimental; } });
11
11
  Object.defineProperty(exports, "VisibilityState", { enumerable: true, get: function () { return dataStoreContext_1.VisibilityState; } });
12
12
  var dataStoreFactory_1 = require("./dataStoreFactory");
13
13
  Object.defineProperty(exports, "IFluidDataStoreFactory", { enumerable: true, get: function () { return dataStoreFactory_1.IFluidDataStoreFactory; } });
14
14
  var dataStoreRegistry_1 = require("./dataStoreRegistry");
15
15
  Object.defineProperty(exports, "IFluidDataStoreRegistry", { enumerable: true, get: function () { return dataStoreRegistry_1.IFluidDataStoreRegistry; } });
16
16
  var garbageCollection_1 = require("./garbageCollection");
17
- Object.defineProperty(exports, "gcBlobKey", { enumerable: true, get: function () { return garbageCollection_1.gcBlobKey; } });
17
+ Object.defineProperty(exports, "gcBlobPrefix", { enumerable: true, get: function () { return garbageCollection_1.gcBlobPrefix; } });
18
+ Object.defineProperty(exports, "gcDeletedBlobKey", { enumerable: true, get: function () { return garbageCollection_1.gcDeletedBlobKey; } });
19
+ Object.defineProperty(exports, "gcTombstoneBlobKey", { enumerable: true, get: function () { return garbageCollection_1.gcTombstoneBlobKey; } });
20
+ Object.defineProperty(exports, "gcTreeKey", { enumerable: true, get: function () { return garbageCollection_1.gcTreeKey; } });
18
21
  var summary_1 = require("./summary");
19
22
  Object.defineProperty(exports, "blobCountPropertyName", { enumerable: true, get: function () { return summary_1.blobCountPropertyName; } });
20
23
  Object.defineProperty(exports, "channelsTreeName", { enumerable: true, get: function () { return summary_1.channelsTreeName; } });
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,uDAa4B;AAX3B,6GAAA,SAAS,OAAA;AAET,6GAAA,SAAS,OAAA;AAQT,mHAAA,eAAe,OAAA;AAEhB,uDAA2F;AAAlF,0HAAA,sBAAsB,OAAA;AAC/B,yDAM6B;AAJ5B,4HAAA,uBAAuB,OAAA;AAKxB,yDAAuG;AAA9F,8GAAA,SAAS,OAAA;AAElB,qCAkBmB;AAjBlB,gHAAA,qBAAqB,OAAA;AACrB,2GAAA,gBAAgB,OAAA;AAEhB,qHAAA,0BAA0B,OAAA;AAa1B,oHAAA,yBAAyB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tAliasResult,\n\tBindState,\n\tCreateChildSummarizerNodeFn,\n\tFlushMode,\n\tIContainerRuntimeBase,\n\tIContainerRuntimeBaseEvents,\n\tIDataStore,\n\tIFluidDataStoreChannel,\n\tIFluidDataStoreContext,\n\tIFluidDataStoreContextDetached,\n\tIFluidDataStoreContextEvents,\n\tVisibilityState,\n} from \"./dataStoreContext\";\nexport { IFluidDataStoreFactory, IProvideFluidDataStoreFactory } from \"./dataStoreFactory\";\nexport {\n\tFluidDataStoreRegistryEntry,\n\tIFluidDataStoreRegistry,\n\tIProvideFluidDataStoreRegistry,\n\tNamedFluidDataStoreRegistryEntries,\n\tNamedFluidDataStoreRegistryEntry,\n} from \"./dataStoreRegistry\";\nexport { gcBlobKey, IGarbageCollectionData, IGarbageCollectionDetailsBase } from \"./garbageCollection\";\nexport { IAttachMessage, IEnvelope, IInboundSignalMessage, InboundAttachMessage, ISignalEnvelope } from \"./protocol\";\nexport {\n\tblobCountPropertyName,\n\tchannelsTreeName,\n\tCreateChildSummarizerNodeParam,\n\tCreateSummarizerNodeSource,\n\tIGarbageCollectionNodeData,\n\tIGarbageCollectionState,\n\tISummarizeInternalResult,\n\tISummarizeResult,\n\tISummarizerNode,\n\tISummarizerNodeConfig,\n\tISummarizerNodeConfigWithGC,\n\tISummarizerNodeWithGC,\n\tISummaryStats,\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n\tSummarizeInternalFn,\n\ttotalBlobSizePropertyName,\n} from \"./summary\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AASH,uDAa4B;AAV3B,6GAAA,SAAS,OAAA;AACT,yHAAA,qBAAqB,OAAA;AAQrB,mHAAA,eAAe,OAAA;AAEhB,uDAA2F;AAAlF,0HAAA,sBAAsB,OAAA;AAC/B,yDAM6B;AAJ5B,4HAAA,uBAAuB,OAAA;AAKxB,yDAO6B;AAN5B,iHAAA,YAAY,OAAA;AACZ,qHAAA,gBAAgB,OAAA;AAChB,uHAAA,kBAAkB,OAAA;AAClB,8GAAA,SAAS,OAAA;AAWV,qCAqBmB;AApBlB,gHAAA,qBAAqB,OAAA;AACrB,2GAAA,gBAAgB,OAAA;AAEhB,qHAAA,0BAA0B,OAAA;AAgB1B,oHAAA,yBAAyB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tAttributionInfo,\n\tAttributionKey,\n\tDetachedAttributionKey,\n\tLocalAttributionKey,\n\tOpAttributionKey,\n} from \"./attribution\";\nexport {\n\tAliasResult,\n\tCreateChildSummarizerNodeFn,\n\tFlushMode,\n\tFlushModeExperimental,\n\tIContainerRuntimeBase,\n\tIContainerRuntimeBaseEvents,\n\tIDataStore,\n\tIFluidDataStoreChannel,\n\tIFluidDataStoreContext,\n\tIFluidDataStoreContextDetached,\n\tIFluidDataStoreContextEvents,\n\tVisibilityState,\n} from \"./dataStoreContext\";\nexport { IFluidDataStoreFactory, IProvideFluidDataStoreFactory } from \"./dataStoreFactory\";\nexport {\n\tFluidDataStoreRegistryEntry,\n\tIFluidDataStoreRegistry,\n\tIProvideFluidDataStoreRegistry,\n\tNamedFluidDataStoreRegistryEntries,\n\tNamedFluidDataStoreRegistryEntry,\n} from \"./dataStoreRegistry\";\nexport {\n\tgcBlobPrefix,\n\tgcDeletedBlobKey,\n\tgcTombstoneBlobKey,\n\tgcTreeKey,\n\tIGarbageCollectionData,\n\tIGarbageCollectionDetailsBase,\n} from \"./garbageCollection\";\nexport {\n\tIAttachMessage,\n\tIEnvelope,\n\tIInboundSignalMessage,\n\tInboundAttachMessage,\n\tISignalEnvelope,\n} from \"./protocol\";\nexport {\n\tblobCountPropertyName,\n\tchannelsTreeName,\n\tCreateChildSummarizerNodeParam,\n\tCreateSummarizerNodeSource,\n\tIGarbageCollectionNodeData,\n\tIGarbageCollectionSnapshotData,\n\tIGarbageCollectionState,\n\tIGarbageCollectionSummaryDetailsLegacy,\n\tIExperimentalIncrementalSummaryContext,\n\tISummarizeInternalResult,\n\tISummarizeResult,\n\tISummarizerNode,\n\tISummarizerNodeConfig,\n\tISummarizerNodeConfigWithGC,\n\tISummarizerNodeWithGC,\n\tISummaryStats,\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n\tSummarizeInternalFn,\n\ttotalBlobSizePropertyName,\n} from \"./summary\";\n"]}
@@ -26,8 +26,8 @@ export interface ISignalEnvelope {
26
26
  */
27
27
  clientSignalSequenceNumber: number;
28
28
  /**
29
- * The contents of the envelope
30
- */
29
+ * The contents of the envelope
30
+ */
31
31
  contents: {
32
32
  type: string;
33
33
  content: any;
@@ -1 +1 @@
1
- {"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,sCAAsC,CAAC;AAE7E;;GAEG;AACH,MAAM,WAAW,SAAS;IACtB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,QAAQ,EAAE,GAAG,CAAC;CACjB;AAED,MAAM,WAAW,eAAe;IAC5B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,0BAA0B,EAAE,MAAM,CAAC;IAElC;;MAEE;IACH,QAAQ,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,GAAG,CAAC;KAChB,CAAC;CACL;AAED;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,cAAc;IACzD,IAAI,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC3B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC;CACnB;AAED;;;;;GAKG;AACH,oBAAY,oBAAoB,GAAG,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC,GAC7D;IAAE,QAAQ,EAAE,cAAc,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC;CAAE,CAAC"}
1
+ {"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,sCAAsC,CAAC;AAE7E;;GAEG;AACH,MAAM,WAAW,SAAS;IACzB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,QAAQ,EAAE,GAAG,CAAC;CACd;AAED,MAAM,WAAW,eAAe;IAC/B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,0BAA0B,EAAE,MAAM,CAAC;IAEnC;;OAEG;IACH,QAAQ,EAAE;QACT,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,GAAG,CAAC;KACb,CAAC;CACF;AAED;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,cAAc;IAC5D,IAAI,EAAE,MAAM,CAAC;CACb;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC9B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC;CAChB;AAED;;;;;GAKG;AACH,oBAAY,oBAAoB,GAAG,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC,GAAG;IACrE,QAAQ,EAAE,cAAc,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC;CAC5C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"protocol.js","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ISignalMessage, ITree } from \"@fluidframework/protocol-definitions\";\n\n/**\n * An envelope wraps the contents with the intended target\n */\nexport interface IEnvelope {\n /**\n * The target for the envelope\n */\n address: string;\n\n /**\n * The contents of the envelope\n */\n contents: any;\n}\n\nexport interface ISignalEnvelope {\n /**\n * The target for the envelope, undefined for the container\n */\n address?: string;\n\n /**\n * Identifier for the signal being submitted.\n */\n clientSignalSequenceNumber: number;\n\n /**\n * The contents of the envelope\n */\n contents: {\n type: string;\n content: any;\n };\n}\n\n/**\n * Represents ISignalMessage with its type.\n */\nexport interface IInboundSignalMessage extends ISignalMessage {\n type: string;\n}\n\n/**\n * Message send by client attaching local data structure.\n * Contains snapshot of data structure which is the current state of this data structure.\n */\nexport interface IAttachMessage {\n /**\n * The identifier for the object\n */\n id: string;\n\n /**\n * The type of object\n */\n type: string;\n\n /**\n * Initial snapshot of the document (contains ownership)\n */\n snapshot: ITree;\n}\n\n/**\n * This type should be used when reading an incoming attach op,\n * but it should not be used when creating a new attach op.\n * Older versions of attach messages could have null snapshots,\n * so this gives correct typings for writing backward compatible code.\n */\nexport type InboundAttachMessage = Omit<IAttachMessage, \"snapshot\">\n & { snapshot: IAttachMessage[\"snapshot\"] | null; };\n"]}
1
+ {"version":3,"file":"protocol.js","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ISignalMessage, ITree } from \"@fluidframework/protocol-definitions\";\n\n/**\n * An envelope wraps the contents with the intended target\n */\nexport interface IEnvelope {\n\t/**\n\t * The target for the envelope\n\t */\n\taddress: string;\n\n\t/**\n\t * The contents of the envelope\n\t */\n\tcontents: any;\n}\n\nexport interface ISignalEnvelope {\n\t/**\n\t * The target for the envelope, undefined for the container\n\t */\n\taddress?: string;\n\n\t/**\n\t * Identifier for the signal being submitted.\n\t */\n\tclientSignalSequenceNumber: number;\n\n\t/**\n\t * The contents of the envelope\n\t */\n\tcontents: {\n\t\ttype: string;\n\t\tcontent: any;\n\t};\n}\n\n/**\n * Represents ISignalMessage with its type.\n */\nexport interface IInboundSignalMessage extends ISignalMessage {\n\ttype: string;\n}\n\n/**\n * Message send by client attaching local data structure.\n * Contains snapshot of data structure which is the current state of this data structure.\n */\nexport interface IAttachMessage {\n\t/**\n\t * The identifier for the object\n\t */\n\tid: string;\n\n\t/**\n\t * The type of object\n\t */\n\ttype: string;\n\n\t/**\n\t * Initial snapshot of the document (contains ownership)\n\t */\n\tsnapshot: ITree;\n}\n\n/**\n * This type should be used when reading an incoming attach op,\n * but it should not be used when creating a new attach op.\n * Older versions of attach messages could have null snapshots,\n * so this gives correct typings for writing backward compatible code.\n */\nexport type InboundAttachMessage = Omit<IAttachMessage, \"snapshot\"> & {\n\tsnapshot: IAttachMessage[\"snapshot\"] | null;\n};\n"]}
package/dist/summary.d.ts CHANGED
@@ -23,7 +23,9 @@ export interface ISummaryStats {
23
23
  * will be taking part of the summarization process.
24
24
  */
25
25
  export interface ISummaryTreeWithStats {
26
- /** Represents an aggregation of node counts and blob sizes associated to the current summary information */
26
+ /**
27
+ * Represents an aggregation of node counts and blob sizes associated to the current summary information
28
+ */
27
29
  stats: ISummaryStats;
28
30
  /**
29
31
  * A recursive data structure that will be converted to a snapshot tree and uploaded
@@ -54,26 +56,85 @@ export interface ISummarizeResult {
54
56
  */
55
57
  export interface ISummarizeInternalResult extends ISummarizeResult {
56
58
  id: string;
57
- /** Additional path parts between this node's ID and its children's IDs. */
59
+ /**
60
+ * Additional path parts between this node's ID and its children's IDs.
61
+ */
58
62
  pathPartsForChildren?: string[];
59
63
  }
60
- /** The garbage collection data of each node in the reference graph. */
64
+ /**
65
+ * The garbage collection data of each node in the reference graph.
66
+ *
67
+ * @deprecated Internal implementation detail and will no longer be exported in an upcoming release.
68
+ */
61
69
  export interface IGarbageCollectionNodeData {
62
- /** The set of routes to other nodes in the graph. */
70
+ /**
71
+ * The set of routes to other nodes in the graph.
72
+ */
63
73
  outboundRoutes: string[];
64
- /** If the node is unreferenced, the timestamp of when it was marked unreferenced. */
74
+ /**
75
+ * If the node is unreferenced, the timestamp of when it was marked unreferenced.
76
+ */
65
77
  unreferencedTimestampMs?: number;
66
78
  }
67
79
  /**
68
80
  * The garbage collection state of the reference graph. It contains a list of all the nodes in the graph and their
69
81
  * GC data.
82
+ *
83
+ * @deprecated Internal implementation detail and will no longer be exported in an upcoming release.
70
84
  */
71
85
  export interface IGarbageCollectionState {
72
86
  gcNodes: {
73
87
  [id: string]: IGarbageCollectionNodeData;
74
88
  };
75
89
  }
76
- export declare type SummarizeInternalFn = (fullTree: boolean, trackState: boolean, telemetryContext?: ITelemetryContext) => Promise<ISummarizeInternalResult>;
90
+ /**
91
+ * @deprecated - IGarbageCollectionState is written in the root of the summary now.
92
+ * Legacy GC details from when the GC details were written at the data store's summary tree.
93
+ */
94
+ export interface IGarbageCollectionSummaryDetailsLegacy {
95
+ /** A list of routes to Fluid objects that are used in this node. */
96
+ usedRoutes?: string[];
97
+ /** The GC data of this node. */
98
+ gcData?: IGarbageCollectionData;
99
+ /** If this node is unreferenced, the time when it was marked as such. */
100
+ unrefTimestamp?: number;
101
+ }
102
+ /**
103
+ * The GC data that is read from a snapshot. It contains the Garbage CollectionState state and tombstone state.
104
+ *
105
+ * @deprecated Internal implementation detail and will no longer be exported in an upcoming release.
106
+ */
107
+ export interface IGarbageCollectionSnapshotData {
108
+ gcState: IGarbageCollectionState;
109
+ tombstones: string[] | undefined;
110
+ deletedNodes: string[] | undefined;
111
+ }
112
+ /**
113
+ * @experimental - Can be deleted/changed at any time
114
+ * Contains the necessary information to allow DDSes to do incremental summaries
115
+ */
116
+ export interface IExperimentalIncrementalSummaryContext {
117
+ /**
118
+ * The sequence number of the summary generated that will be sent to the server.
119
+ */
120
+ summarySequenceNumber: number;
121
+ /**
122
+ * The sequence number of the most recent summary that was acknowledged by the server.
123
+ */
124
+ latestSummarySequenceNumber: number;
125
+ /**
126
+ * The path to the runtime/datastore/dds that is used to generate summary handles
127
+ * Note: Summary handles are nodes of the summary tree that point to previous parts of the last successful summary
128
+ * instead of being a blob or tree node
129
+ *
130
+ * This path contains the id of the data store and dds which should not be leaked to layers below them. Ideally,
131
+ * a layer should not know its own id. This is important for channel unification work and there has been a lot of
132
+ * work to remove these kinds of leakages. Some still exist, which have to be fixed but we should not be adding
133
+ * more dependencies.
134
+ */
135
+ summaryPath: string;
136
+ }
137
+ export declare type SummarizeInternalFn = (fullTree: boolean, trackState: boolean, telemetryContext?: ITelemetryContext, incrementalSummaryContext?: IExperimentalIncrementalSummaryContext) => Promise<ISummarizeInternalResult>;
77
138
  export interface ISummarizerNodeConfig {
78
139
  /**
79
140
  * True to reuse previous handle when unchanged since last acked summary.
@@ -113,7 +174,9 @@ export declare type CreateChildSummarizerNodeParam = {
113
174
  type: CreateSummarizerNodeSource.Local;
114
175
  };
115
176
  export interface ISummarizerNode {
116
- /** Latest successfully acked summary reference sequence number */
177
+ /**
178
+ * Latest successfully acked summary reference sequence number
179
+ */
117
180
  readonly referenceSequenceNumber: number;
118
181
  /**
119
182
  * Marks the node as having a change with the given sequence number.
@@ -145,9 +208,13 @@ export interface ISummarizerNode {
145
208
  */
146
209
  recordChange(op: ISequencedDocumentMessage): void;
147
210
  createChild(
148
- /** Summarize function */
211
+ /**
212
+ * Summarize function
213
+ */
149
214
  summarizeInternalFn: SummarizeInternalFn,
150
- /** Initial id or path part of this node */
215
+ /**
216
+ * Initial id or path part of this node
217
+ */
151
218
  id: string,
152
219
  /**
153
220
  * Information needed to create the node.
@@ -156,9 +223,13 @@ export interface ISummarizerNode {
156
223
  * If it is local, it will throw unsupported errors on calls to summarize.
157
224
  */
158
225
  createParam: CreateChildSummarizerNodeParam,
159
- /** Optional configuration affecting summarize behavior */
226
+ /**
227
+ * Optional configuration affecting summarize behavior
228
+ */
160
229
  config?: ISummarizerNodeConfig): ISummarizerNode;
161
230
  getChild(id: string): ISummarizerNode | undefined;
231
+ /** True if a summary is currently in progress */
232
+ isSummaryInProgress?(): boolean;
162
233
  }
163
234
  /**
164
235
  * Extends the functionality of ISummarizerNode to support garbage collection. It adds / updates the following APIs:
@@ -184,9 +255,13 @@ export interface ISummarizerNode {
184
255
  */
185
256
  export interface ISummarizerNodeWithGC extends ISummarizerNode {
186
257
  createChild(
187
- /** Summarize function */
258
+ /**
259
+ * Summarize function
260
+ */
188
261
  summarizeInternalFn: SummarizeInternalFn,
189
- /** Initial id or path part of this node */
262
+ /**
263
+ * Initial id or path part of this node
264
+ */
190
265
  id: string,
191
266
  /**
192
267
  * Information needed to create the node.
@@ -195,8 +270,14 @@ export interface ISummarizerNodeWithGC extends ISummarizerNode {
195
270
  * If it is local, it will throw unsupported errors on calls to summarize.
196
271
  */
197
272
  createParam: CreateChildSummarizerNodeParam,
198
- /** Optional configuration affecting summarize behavior */
199
- config?: ISummarizerNodeConfigWithGC, getGCDataFn?: (fullGC?: boolean) => Promise<IGarbageCollectionData>, getBaseGCDetailsFn?: () => Promise<IGarbageCollectionDetailsBase>): ISummarizerNodeWithGC;
273
+ /**
274
+ * Optional configuration affecting summarize behavior
275
+ */
276
+ config?: ISummarizerNodeConfigWithGC, getGCDataFn?: (fullGC?: boolean) => Promise<IGarbageCollectionData>,
277
+ /**
278
+ * @deprecated - The functionality to update child's base GC details is incorporated in the summarizer node.
279
+ */
280
+ getBaseGCDetailsFn?: () => Promise<IGarbageCollectionDetailsBase>): ISummarizerNodeWithGC;
200
281
  /**
201
282
  * Delete the child with the given id..
202
283
  */
@@ -208,7 +289,9 @@ export interface ISummarizerNodeWithGC extends ISummarizerNode {
208
289
  * @param fullGC - true to bypass optimizations and force full generation of GC data.
209
290
  */
210
291
  getGCData(fullGC?: boolean): Promise<IGarbageCollectionData>;
211
- /** Tells whether this node is being referenced in this document or not. Unreferenced node will get GC'd */
292
+ /**
293
+ * Tells whether this node is being referenced in this document or not. Unreferenced node will get GC'd
294
+ */
212
295
  isReferenced(): boolean;
213
296
  /**
214
297
  * After GC has run, called to notify this node of routes that are used in it. These are used for the following:
@@ -232,6 +315,13 @@ export interface ITelemetryContext {
232
315
  * @param value - value to attribute to this summary telemetry data
233
316
  */
234
317
  set(prefix: string, property: string, value: TelemetryEventPropertyType): void;
318
+ /**
319
+ * Sets multiple values for telemetry data being tracked.
320
+ * @param prefix - unique prefix to tag this data with (ex: "fluid:summarize:")
321
+ * @param property - property name of the telemetry data being tracked (ex: "Options")
322
+ * @param values - A set of values to attribute to this summary telemetry data.
323
+ */
324
+ setMultiple(prefix: string, property: string, values: Record<string, TelemetryEventPropertyType>): void;
235
325
  /**
236
326
  * Get the telemetry data being tracked
237
327
  * @param prefix - unique prefix for this data (ex: "fluid:map:")
@@ -1 +1 @@
1
- {"version":3,"file":"summary.d.ts","sourceRoot":"","sources":["../src/summary.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,EACH,WAAW,EACX,YAAY,EACZ,yBAAyB,EACzB,aAAa,EACb,KAAK,EACR,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACH,sBAAsB,EACtB,6BAA6B,EAChC,MAAM,qBAAqB,CAAC;AAE7B;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,oBAAoB,EAAE,MAAM,CAAC;CAChC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,qBAAqB;IAClC,4GAA4G;IAC5G,KAAK,EAAE,aAAa,CAAC;IACrB;;;OAGG;IACH,OAAO,EAAE,YAAY,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B,KAAK,EAAE,aAAa,CAAC;IACrB,OAAO,EAAE,WAAW,CAAC;CACxB;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,wBAAyB,SAAQ,gBAAgB;IAC9D,EAAE,EAAE,MAAM,CAAC;IACX,2EAA2E;IAC3E,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;CACnC;AAED,uEAAuE;AACvE,MAAM,WAAW,0BAA0B;IACvC,qDAAqD;IACrD,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,qFAAqF;IACrF,uBAAuB,CAAC,EAAE,MAAM,CAAC;CACpC;AAED;;;GAGG;AAC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,IAAI,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,qBAAqB,cAAc,CAAC;AAEjD,eAAO,MAAM,yBAAyB,kBAAkB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"summary.js","sourceRoot":"","sources":["../src/summary.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAuHH,IAAY,0BAIX;AAJD,WAAY,0BAA0B;IAClC,yFAAW,CAAA;IACX,uFAAU,CAAA;IACV,6EAAK,CAAA;AACT,CAAC,EAJW,0BAA0B,GAA1B,kCAA0B,KAA1B,kCAA0B,QAIrC;AAuIY,QAAA,gBAAgB,GAAG,WAAW,CAAC;AA8B/B,QAAA,qBAAqB,GAAG,WAAW,CAAC;AAEpC,QAAA,yBAAyB,GAAG,eAAe,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TelemetryEventPropertyType } from \"@fluidframework/common-definitions\";\nimport {\n SummaryTree,\n ISummaryTree,\n ISequencedDocumentMessage,\n ISnapshotTree,\n ITree,\n} from \"@fluidframework/protocol-definitions\";\nimport {\n IGarbageCollectionData,\n IGarbageCollectionDetailsBase,\n} from \"./garbageCollection\";\n\n/**\n * Contains the aggregation data from a Tree/Subtree.\n */\nexport interface ISummaryStats {\n treeNodeCount: number;\n blobNodeCount: number;\n handleNodeCount: number;\n totalBlobSize: number;\n unreferencedBlobSize: number;\n}\n\n/**\n * Represents the summary tree for a node along with the statistics for that tree.\n * For example, for a given data store, it contains the data for data store along with a subtree for\n * each of its DDS.\n * Any component that implements IChannelContext, IFluidDataStoreChannel or extends SharedObject\n * will be taking part of the summarization process.\n */\nexport interface ISummaryTreeWithStats {\n /** Represents an aggregation of node counts and blob sizes associated to the current summary information */\n stats: ISummaryStats;\n /**\n * A recursive data structure that will be converted to a snapshot tree and uploaded\n * to the backend.\n */\n summary: ISummaryTree;\n}\n\n/**\n * Represents a summary at a current sequence number.\n */\nexport interface ISummarizeResult {\n stats: ISummaryStats;\n summary: SummaryTree;\n}\n\n/**\n * Contains the same data as ISummaryResult but in order to avoid naming collisions,\n * the data store summaries are wrapped around an array of labels identified by pathPartsForChildren.\n *\n * @example\n * ```\n * id:\"\"\n * pathPartsForChildren: [\"path1\"]\n * stats: ...\n * summary:\n * ...\n * \"path1\":\n * ```\n */\nexport interface ISummarizeInternalResult extends ISummarizeResult {\n id: string;\n /** Additional path parts between this node's ID and its children's IDs. */\n pathPartsForChildren?: string[];\n}\n\n/** The garbage collection data of each node in the reference graph. */\nexport interface IGarbageCollectionNodeData {\n /** The set of routes to other nodes in the graph. */\n outboundRoutes: string[];\n /** If the node is unreferenced, the timestamp of when it was marked unreferenced. */\n unreferencedTimestampMs?: number;\n}\n\n/**\n * The garbage collection state of the reference graph. It contains a list of all the nodes in the graph and their\n * GC data.\n */\nexport interface IGarbageCollectionState {\n gcNodes: { [ id: string ]: IGarbageCollectionNodeData; };\n}\n\nexport type SummarizeInternalFn = (\n fullTree: boolean,\n trackState: boolean,\n telemetryContext?: ITelemetryContext,\n) => Promise<ISummarizeInternalResult>;\n\nexport interface ISummarizerNodeConfig {\n /**\n * True to reuse previous handle when unchanged since last acked summary.\n * Defaults to true.\n */\n readonly canReuseHandle?: boolean;\n /**\n * True to always stop execution on error during summarize, or false to\n * attempt creating a summary that is a pointer ot the last acked summary\n * plus outstanding ops in case of internal summarize failure.\n * Defaults to false.\n *\n * BUG BUG: Default to true while we investigate problem\n * with differential summaries\n */\n readonly throwOnFailure?: true;\n}\n\nexport interface ISummarizerNodeConfigWithGC extends ISummarizerNodeConfig {\n /**\n * True if GC is disabled. If so, don't track GC related state for a summary.\n * This is propagated to all child nodes.\n */\n readonly gcDisabled?: boolean;\n}\n\nexport enum CreateSummarizerNodeSource {\n FromSummary,\n FromAttach,\n Local,\n}\nexport type CreateChildSummarizerNodeParam = {\n type: CreateSummarizerNodeSource.FromSummary;\n} | {\n type: CreateSummarizerNodeSource.FromAttach;\n sequenceNumber: number;\n snapshot: ITree;\n} | {\n type: CreateSummarizerNodeSource.Local;\n};\n\nexport interface ISummarizerNode {\n /** Latest successfully acked summary reference sequence number */\n readonly referenceSequenceNumber: number;\n /**\n * Marks the node as having a change with the given sequence number.\n * @param sequenceNumber - sequence number of change\n */\n invalidate(sequenceNumber: number): void;\n /**\n * Calls the internal summarize function and handles internal state tracking.\n * If unchanged and fullTree is false, it will reuse previous summary subtree.\n * If an error is encountered and throwOnFailure is false, it will try to make\n * a summary with a pointer to the previous summary + a blob of outstanding ops.\n * @param fullTree - true to skip optimizations and always generate the full tree\n * @param trackState - indicates whether the summarizer node should track the state of the summary or not\n * @param telemetryContext - summary data passed through the layers for telemetry purposes\n */\n summarize(\n fullTree: boolean,\n trackState?: boolean,\n telemetryContext?: ITelemetryContext,\n ): Promise<ISummarizeResult>;\n /**\n * Checks if there are any additional path parts for children that need to\n * be loaded from the base summary. Additional path parts represent parts\n * of the path between this SummarizerNode and any child SummarizerNodes\n * that it might have. For example: if datastore \"a\" contains dds \"b\", but the\n * path is \"/a/.channels/b\", then the additional path part is \".channels\".\n * @param snapshot - the base summary to parse\n */\n updateBaseSummaryState(snapshot: ISnapshotTree): void;\n /**\n * Records an op representing a change to this node/subtree.\n * @param op - op of change to record\n */\n recordChange(op: ISequencedDocumentMessage): void;\n\n createChild(\n /** Summarize function */\n summarizeInternalFn: SummarizeInternalFn,\n /** Initial id or path part of this node */\n id: string,\n /**\n * Information needed to create the node.\n * If it is from a base summary, it will assert that a summary has been seen.\n * Attach information if it is created from an attach op.\n * If it is local, it will throw unsupported errors on calls to summarize.\n */\n createParam: CreateChildSummarizerNodeParam,\n /** Optional configuration affecting summarize behavior */\n config?: ISummarizerNodeConfig,\n ): ISummarizerNode;\n\n getChild(id: string): ISummarizerNode | undefined;\n}\n\n/**\n * Extends the functionality of ISummarizerNode to support garbage collection. It adds / updates the following APIs:\n *\n * `usedRoutes`: The routes in this node that are currently in use.\n *\n * `getGCData`: A new API that can be used to get the garbage collection data for this node.\n *\n * `summarize`: Added a trackState flag which indicates whether the summarizer node should track the state of the\n * summary or not.\n *\n * `createChild`: Added the following params:\n *\n * - `getGCDataFn`: This gets the GC data from the caller. This must be provided in order for getGCData to work.\n *\n * - `getInitialGCDetailsFn`: This gets the initial GC details from the caller.\n *\n * `deleteChild`: Deletes a child node.\n *\n * `isReferenced`: This tells whether this node is referenced in the document or not.\n *\n * `updateUsedRoutes`: Used to notify this node of routes that are currently in use in it.\n */\nexport interface ISummarizerNodeWithGC extends ISummarizerNode {\n createChild(\n /** Summarize function */\n summarizeInternalFn: SummarizeInternalFn,\n /** Initial id or path part of this node */\n id: string,\n /**\n * Information needed to create the node.\n * If it is from a base summary, it will assert that a summary has been seen.\n * Attach information if it is created from an attach op.\n * If it is local, it will throw unsupported errors on calls to summarize.\n */\n createParam: CreateChildSummarizerNodeParam,\n /** Optional configuration affecting summarize behavior */\n config?: ISummarizerNodeConfigWithGC,\n getGCDataFn?: (fullGC?: boolean) => Promise<IGarbageCollectionData>,\n getBaseGCDetailsFn?: () => Promise<IGarbageCollectionDetailsBase>,\n ): ISummarizerNodeWithGC;\n\n /**\n * Delete the child with the given id..\n */\n deleteChild(id: string): void;\n\n getChild(id: string): ISummarizerNodeWithGC | undefined;\n\n /**\n * Returns this node's data that is used for garbage collection. This includes a list of GC nodes that represent\n * this node. Each node has a set of outbound routes to other GC nodes in the document.\n * @param fullGC - true to bypass optimizations and force full generation of GC data.\n */\n getGCData(fullGC?: boolean): Promise<IGarbageCollectionData>;\n\n /** Tells whether this node is being referenced in this document or not. Unreferenced node will get GC'd */\n isReferenced(): boolean;\n\n /**\n * After GC has run, called to notify this node of routes that are used in it. These are used for the following:\n * 1. To identify if this node is being referenced in the document or not.\n * 2. To identify if this node or any of its children's used routes changed since last summary.\n *\n * @param usedRoutes - The routes that are used in this node.\n */\n updateUsedRoutes(usedRoutes: string[]): void;\n}\n\nexport const channelsTreeName = \".channels\";\n\n/**\n * Contains telemetry data relevant to summarization workflows.\n * This object is expected to be modified directly by various summarize methods.\n */\nexport interface ITelemetryContext {\n /**\n * Sets value for telemetry data being tracked.\n * @param prefix - unique prefix to tag this data with (ex: \"fluid:map:\")\n * @param property - property name of the telemetry data being tracked (ex: \"DirectoryCount\")\n * @param value - value to attribute to this summary telemetry data\n */\n set(prefix: string, property: string, value: TelemetryEventPropertyType): void;\n\n /**\n * Get the telemetry data being tracked\n * @param prefix - unique prefix for this data (ex: \"fluid:map:\")\n * @param property - property name of the telemetry data being tracked (ex: \"DirectoryCount\")\n * @returns undefined if item not found\n */\n get(prefix: string, property: string): TelemetryEventPropertyType;\n\n /**\n * Returns a serialized version of all the telemetry data.\n * Should be used when logging in telemetry events.\n */\n serialize(): string;\n}\n\nexport const blobCountPropertyName = \"BlobCount\";\n\nexport const totalBlobSizePropertyName = \"TotalBlobSize\";\n"]}
1
+ {"version":3,"file":"summary.js","sourceRoot":"","sources":["../src/summary.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAsLH,IAAY,0BAIX;AAJD,WAAY,0BAA0B;IACrC,yFAAW,CAAA;IACX,uFAAU,CAAA;IACV,6EAAK,CAAA;AACN,CAAC,EAJW,0BAA0B,GAA1B,kCAA0B,KAA1B,kCAA0B,QAIrC;AAgKY,QAAA,gBAAgB,GAAG,WAAW,CAAC;AA0C/B,QAAA,qBAAqB,GAAG,WAAW,CAAC;AAEpC,QAAA,yBAAyB,GAAG,eAAe,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TelemetryEventPropertyType } from \"@fluidframework/common-definitions\";\nimport {\n\tSummaryTree,\n\tISummaryTree,\n\tISequencedDocumentMessage,\n\tISnapshotTree,\n\tITree,\n} from \"@fluidframework/protocol-definitions\";\nimport { IGarbageCollectionData, IGarbageCollectionDetailsBase } from \"./garbageCollection\";\n\n/**\n * Contains the aggregation data from a Tree/Subtree.\n */\nexport interface ISummaryStats {\n\ttreeNodeCount: number;\n\tblobNodeCount: number;\n\thandleNodeCount: number;\n\ttotalBlobSize: number;\n\tunreferencedBlobSize: number;\n}\n\n/**\n * Represents the summary tree for a node along with the statistics for that tree.\n * For example, for a given data store, it contains the data for data store along with a subtree for\n * each of its DDS.\n * Any component that implements IChannelContext, IFluidDataStoreChannel or extends SharedObject\n * will be taking part of the summarization process.\n */\nexport interface ISummaryTreeWithStats {\n\t/**\n\t * Represents an aggregation of node counts and blob sizes associated to the current summary information\n\t */\n\tstats: ISummaryStats;\n\t/**\n\t * A recursive data structure that will be converted to a snapshot tree and uploaded\n\t * to the backend.\n\t */\n\tsummary: ISummaryTree;\n}\n\n/**\n * Represents a summary at a current sequence number.\n */\nexport interface ISummarizeResult {\n\tstats: ISummaryStats;\n\tsummary: SummaryTree;\n}\n\n/**\n * Contains the same data as ISummaryResult but in order to avoid naming collisions,\n * the data store summaries are wrapped around an array of labels identified by pathPartsForChildren.\n *\n * @example\n * ```\n * id:\"\"\n * pathPartsForChildren: [\"path1\"]\n * stats: ...\n * summary:\n * ...\n * \"path1\":\n * ```\n */\nexport interface ISummarizeInternalResult extends ISummarizeResult {\n\tid: string;\n\t/**\n\t * Additional path parts between this node's ID and its children's IDs.\n\t */\n\tpathPartsForChildren?: string[];\n}\n\n/**\n * The garbage collection data of each node in the reference graph.\n *\n * @deprecated Internal implementation detail and will no longer be exported in an upcoming release.\n */\nexport interface IGarbageCollectionNodeData {\n\t/**\n\t * The set of routes to other nodes in the graph.\n\t */\n\toutboundRoutes: string[];\n\t/**\n\t * If the node is unreferenced, the timestamp of when it was marked unreferenced.\n\t */\n\tunreferencedTimestampMs?: number;\n}\n\n/**\n * The garbage collection state of the reference graph. It contains a list of all the nodes in the graph and their\n * GC data.\n *\n * @deprecated Internal implementation detail and will no longer be exported in an upcoming release.\n */\nexport interface IGarbageCollectionState {\n\tgcNodes: { [id: string]: IGarbageCollectionNodeData };\n}\n\n/**\n * @deprecated - IGarbageCollectionState is written in the root of the summary now.\n * Legacy GC details from when the GC details were written at the data store's summary tree.\n */\nexport interface IGarbageCollectionSummaryDetailsLegacy {\n\t/** A list of routes to Fluid objects that are used in this node. */\n\tusedRoutes?: string[];\n\t/** The GC data of this node. */\n\tgcData?: IGarbageCollectionData;\n\t/** If this node is unreferenced, the time when it was marked as such. */\n\tunrefTimestamp?: number;\n}\n\n/**\n * The GC data that is read from a snapshot. It contains the Garbage CollectionState state and tombstone state.\n *\n * @deprecated Internal implementation detail and will no longer be exported in an upcoming release.\n */\nexport interface IGarbageCollectionSnapshotData {\n\tgcState: IGarbageCollectionState;\n\ttombstones: string[] | undefined;\n\tdeletedNodes: string[] | undefined;\n}\n\n/**\n * @experimental - Can be deleted/changed at any time\n * Contains the necessary information to allow DDSes to do incremental summaries\n */\nexport interface IExperimentalIncrementalSummaryContext {\n\t/**\n\t * The sequence number of the summary generated that will be sent to the server.\n\t */\n\tsummarySequenceNumber: number;\n\t/**\n\t * The sequence number of the most recent summary that was acknowledged by the server.\n\t */\n\tlatestSummarySequenceNumber: number;\n\t/**\n\t * The path to the runtime/datastore/dds that is used to generate summary handles\n\t * Note: Summary handles are nodes of the summary tree that point to previous parts of the last successful summary\n\t * instead of being a blob or tree node\n\t *\n\t * This path contains the id of the data store and dds which should not be leaked to layers below them. Ideally,\n\t * a layer should not know its own id. This is important for channel unification work and there has been a lot of\n\t * work to remove these kinds of leakages. Some still exist, which have to be fixed but we should not be adding\n\t * more dependencies.\n\t */\n\t// TODO: remove summaryPath\n\tsummaryPath: string;\n}\n\nexport type SummarizeInternalFn = (\n\tfullTree: boolean,\n\ttrackState: boolean,\n\ttelemetryContext?: ITelemetryContext,\n\tincrementalSummaryContext?: IExperimentalIncrementalSummaryContext,\n) => Promise<ISummarizeInternalResult>;\n\nexport interface ISummarizerNodeConfig {\n\t/**\n\t * True to reuse previous handle when unchanged since last acked summary.\n\t * Defaults to true.\n\t */\n\treadonly canReuseHandle?: boolean;\n\t/**\n\t * True to always stop execution on error during summarize, or false to\n\t * attempt creating a summary that is a pointer ot the last acked summary\n\t * plus outstanding ops in case of internal summarize failure.\n\t * Defaults to false.\n\t *\n\t * BUG BUG: Default to true while we investigate problem\n\t * with differential summaries\n\t */\n\treadonly throwOnFailure?: true;\n}\n\nexport interface ISummarizerNodeConfigWithGC extends ISummarizerNodeConfig {\n\t/**\n\t * True if GC is disabled. If so, don't track GC related state for a summary.\n\t * This is propagated to all child nodes.\n\t */\n\treadonly gcDisabled?: boolean;\n}\n\nexport enum CreateSummarizerNodeSource {\n\tFromSummary,\n\tFromAttach,\n\tLocal,\n}\nexport type CreateChildSummarizerNodeParam =\n\t| {\n\t\t\ttype: CreateSummarizerNodeSource.FromSummary;\n\t }\n\t| {\n\t\t\ttype: CreateSummarizerNodeSource.FromAttach;\n\t\t\tsequenceNumber: number;\n\t\t\tsnapshot: ITree;\n\t }\n\t| {\n\t\t\ttype: CreateSummarizerNodeSource.Local;\n\t };\n\nexport interface ISummarizerNode {\n\t/**\n\t * Latest successfully acked summary reference sequence number\n\t */\n\treadonly referenceSequenceNumber: number;\n\t/**\n\t * Marks the node as having a change with the given sequence number.\n\t * @param sequenceNumber - sequence number of change\n\t */\n\tinvalidate(sequenceNumber: number): void;\n\t/**\n\t * Calls the internal summarize function and handles internal state tracking.\n\t * If unchanged and fullTree is false, it will reuse previous summary subtree.\n\t * If an error is encountered and throwOnFailure is false, it will try to make\n\t * a summary with a pointer to the previous summary + a blob of outstanding ops.\n\t * @param fullTree - true to skip optimizations and always generate the full tree\n\t * @param trackState - indicates whether the summarizer node should track the state of the summary or not\n\t * @param telemetryContext - summary data passed through the layers for telemetry purposes\n\t */\n\tsummarize(\n\t\tfullTree: boolean,\n\t\ttrackState?: boolean,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<ISummarizeResult>;\n\t/**\n\t * Checks if there are any additional path parts for children that need to\n\t * be loaded from the base summary. Additional path parts represent parts\n\t * of the path between this SummarizerNode and any child SummarizerNodes\n\t * that it might have. For example: if datastore \"a\" contains dds \"b\", but the\n\t * path is \"/a/.channels/b\", then the additional path part is \".channels\".\n\t * @param snapshot - the base summary to parse\n\t */\n\tupdateBaseSummaryState(snapshot: ISnapshotTree): void;\n\t/**\n\t * Records an op representing a change to this node/subtree.\n\t * @param op - op of change to record\n\t */\n\trecordChange(op: ISequencedDocumentMessage): void;\n\n\tcreateChild(\n\t\t/**\n\t\t * Summarize function\n\t\t */\n\t\tsummarizeInternalFn: SummarizeInternalFn,\n\t\t/**\n\t\t * Initial id or path part of this node\n\t\t */\n\t\tid: string,\n\t\t/**\n\t\t * Information needed to create the node.\n\t\t * If it is from a base summary, it will assert that a summary has been seen.\n\t\t * Attach information if it is created from an attach op.\n\t\t * If it is local, it will throw unsupported errors on calls to summarize.\n\t\t */\n\t\tcreateParam: CreateChildSummarizerNodeParam,\n\t\t/**\n\t\t * Optional configuration affecting summarize behavior\n\t\t */\n\t\tconfig?: ISummarizerNodeConfig,\n\t): ISummarizerNode;\n\n\tgetChild(id: string): ISummarizerNode | undefined;\n\n\t/** True if a summary is currently in progress */\n\tisSummaryInProgress?(): boolean;\n}\n\n/**\n * Extends the functionality of ISummarizerNode to support garbage collection. It adds / updates the following APIs:\n *\n * `usedRoutes`: The routes in this node that are currently in use.\n *\n * `getGCData`: A new API that can be used to get the garbage collection data for this node.\n *\n * `summarize`: Added a trackState flag which indicates whether the summarizer node should track the state of the\n * summary or not.\n *\n * `createChild`: Added the following params:\n *\n * - `getGCDataFn`: This gets the GC data from the caller. This must be provided in order for getGCData to work.\n *\n * - `getInitialGCDetailsFn`: This gets the initial GC details from the caller.\n *\n * `deleteChild`: Deletes a child node.\n *\n * `isReferenced`: This tells whether this node is referenced in the document or not.\n *\n * `updateUsedRoutes`: Used to notify this node of routes that are currently in use in it.\n */\nexport interface ISummarizerNodeWithGC extends ISummarizerNode {\n\tcreateChild(\n\t\t/**\n\t\t * Summarize function\n\t\t */\n\t\tsummarizeInternalFn: SummarizeInternalFn,\n\t\t/**\n\t\t * Initial id or path part of this node\n\t\t */\n\t\tid: string,\n\t\t/**\n\t\t * Information needed to create the node.\n\t\t * If it is from a base summary, it will assert that a summary has been seen.\n\t\t * Attach information if it is created from an attach op.\n\t\t * If it is local, it will throw unsupported errors on calls to summarize.\n\t\t */\n\t\tcreateParam: CreateChildSummarizerNodeParam,\n\t\t/**\n\t\t * Optional configuration affecting summarize behavior\n\t\t */\n\t\tconfig?: ISummarizerNodeConfigWithGC,\n\t\tgetGCDataFn?: (fullGC?: boolean) => Promise<IGarbageCollectionData>,\n\t\t/**\n\t\t * @deprecated - The functionality to update child's base GC details is incorporated in the summarizer node.\n\t\t */\n\t\tgetBaseGCDetailsFn?: () => Promise<IGarbageCollectionDetailsBase>,\n\t): ISummarizerNodeWithGC;\n\n\t/**\n\t * Delete the child with the given id..\n\t */\n\tdeleteChild(id: string): void;\n\n\tgetChild(id: string): ISummarizerNodeWithGC | undefined;\n\n\t/**\n\t * Returns this node's data that is used for garbage collection. This includes a list of GC nodes that represent\n\t * this node. Each node has a set of outbound routes to other GC nodes in the document.\n\t * @param fullGC - true to bypass optimizations and force full generation of GC data.\n\t */\n\tgetGCData(fullGC?: boolean): Promise<IGarbageCollectionData>;\n\n\t/**\n\t * Tells whether this node is being referenced in this document or not. Unreferenced node will get GC'd\n\t */\n\tisReferenced(): boolean;\n\n\t/**\n\t * After GC has run, called to notify this node of routes that are used in it. These are used for the following:\n\t * 1. To identify if this node is being referenced in the document or not.\n\t * 2. To identify if this node or any of its children's used routes changed since last summary.\n\t *\n\t * @param usedRoutes - The routes that are used in this node.\n\t */\n\tupdateUsedRoutes(usedRoutes: string[]): void;\n}\n\nexport const channelsTreeName = \".channels\";\n\n/**\n * Contains telemetry data relevant to summarization workflows.\n * This object is expected to be modified directly by various summarize methods.\n */\nexport interface ITelemetryContext {\n\t/**\n\t * Sets value for telemetry data being tracked.\n\t * @param prefix - unique prefix to tag this data with (ex: \"fluid:map:\")\n\t * @param property - property name of the telemetry data being tracked (ex: \"DirectoryCount\")\n\t * @param value - value to attribute to this summary telemetry data\n\t */\n\tset(prefix: string, property: string, value: TelemetryEventPropertyType): void;\n\n\t/**\n\t * Sets multiple values for telemetry data being tracked.\n\t * @param prefix - unique prefix to tag this data with (ex: \"fluid:summarize:\")\n\t * @param property - property name of the telemetry data being tracked (ex: \"Options\")\n\t * @param values - A set of values to attribute to this summary telemetry data.\n\t */\n\tsetMultiple(\n\t\tprefix: string,\n\t\tproperty: string,\n\t\tvalues: Record<string, TelemetryEventPropertyType>,\n\t): void;\n\n\t/**\n\t * Get the telemetry data being tracked\n\t * @param prefix - unique prefix for this data (ex: \"fluid:map:\")\n\t * @param property - property name of the telemetry data being tracked (ex: \"DirectoryCount\")\n\t * @returns undefined if item not found\n\t */\n\tget(prefix: string, property: string): TelemetryEventPropertyType;\n\n\t/**\n\t * Returns a serialized version of all the telemetry data.\n\t * Should be used when logging in telemetry events.\n\t */\n\tserialize(): string;\n}\n\nexport const blobCountPropertyName = \"BlobCount\";\n\nexport const totalBlobSizePropertyName = \"TotalBlobSize\";\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/runtime-definitions",
3
- "version": "2.0.0-dev.2.3.0.115467",
3
+ "version": "2.0.0-dev.4.1.0.148229",
4
4
  "description": "Fluid Runtime definitions",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -13,6 +13,31 @@
13
13
  "sideEffects": false,
14
14
  "main": "dist/index.js",
15
15
  "types": "dist/index.d.ts",
16
+ "dependencies": {
17
+ "@fluidframework/common-definitions": "^0.20.1",
18
+ "@fluidframework/common-utils": "^1.1.1",
19
+ "@fluidframework/container-definitions": "2.0.0-dev.4.1.0.148229",
20
+ "@fluidframework/core-interfaces": "2.0.0-dev.4.1.0.148229",
21
+ "@fluidframework/driver-definitions": "2.0.0-dev.4.1.0.148229",
22
+ "@fluidframework/protocol-definitions": "^1.1.0"
23
+ },
24
+ "devDependencies": {
25
+ "@fluid-tools/build-cli": "^0.13.1",
26
+ "@fluidframework/build-common": "^1.1.0",
27
+ "@fluidframework/build-tools": "^0.13.1",
28
+ "@fluidframework/eslint-config-fluid": "^2.0.0",
29
+ "@fluidframework/runtime-definitions-previous": "npm:@fluidframework/runtime-definitions@2.0.0-internal.4.0.0",
30
+ "@microsoft/api-extractor": "^7.34.4",
31
+ "concurrently": "^7.6.0",
32
+ "copyfiles": "^2.4.1",
33
+ "eslint": "~8.6.0",
34
+ "prettier": "~2.6.2",
35
+ "rimraf": "^4.4.0",
36
+ "typescript": "~4.5.5"
37
+ },
38
+ "typeValidation": {
39
+ "broken": {}
40
+ },
16
41
  "scripts": {
17
42
  "build": "concurrently npm:build:compile npm:lint && npm run build:docs",
18
43
  "build:compile": "npm run tsc && npm run typetests:gen && npm run build:test",
@@ -25,42 +50,12 @@
25
50
  "eslint": "eslint --format stylish src",
26
51
  "eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
27
52
  "format": "npm run prettier:fix",
28
- "lint": "npm run eslint",
29
- "lint:fix": "npm run eslint:fix",
53
+ "lint": "npm run prettier && npm run eslint",
54
+ "lint:fix": "npm run prettier:fix && npm run eslint:fix",
30
55
  "prettier": "prettier --check . --ignore-path ../../../.prettierignore",
31
56
  "prettier:fix": "prettier --write . --ignore-path ../../../.prettierignore",
32
57
  "tsc": "tsc",
33
- "typetests:gen": "flub generate typetests --generate --dir .",
58
+ "typetests:gen": "fluid-type-test-generator",
34
59
  "typetests:prepare": "flub generate typetests --prepare --dir . --pin"
35
- },
36
- "dependencies": {
37
- "@fluidframework/common-definitions": "^0.20.1",
38
- "@fluidframework/common-utils": "^1.0.0",
39
- "@fluidframework/container-definitions": ">=2.0.0-dev.2.3.0.115467 <2.0.0-dev.3.0.0",
40
- "@fluidframework/core-interfaces": ">=2.0.0-dev.2.3.0.115467 <2.0.0-dev.3.0.0",
41
- "@fluidframework/driver-definitions": ">=2.0.0-dev.2.3.0.115467 <2.0.0-dev.3.0.0",
42
- "@fluidframework/protocol-definitions": "^1.1.0",
43
- "@types/node": "^14.18.0"
44
- },
45
- "devDependencies": {
46
- "@fluid-tools/build-cli": "^0.7.0",
47
- "@fluidframework/build-common": "^1.1.0",
48
- "@fluidframework/build-tools": "^0.7.0",
49
- "@fluidframework/eslint-config-fluid": "^1.2.0",
50
- "@fluidframework/runtime-definitions-previous": "npm:@fluidframework/runtime-definitions@2.0.0-internal.2.2.0",
51
- "@microsoft/api-extractor": "^7.22.2",
52
- "@rushstack/eslint-config": "^2.5.1",
53
- "concurrently": "^6.2.0",
54
- "copyfiles": "^2.4.1",
55
- "eslint": "~8.6.0",
56
- "prettier": "~2.6.2",
57
- "rimraf": "^2.6.2",
58
- "typescript": "~4.5.5"
59
- },
60
- "typeValidation": {
61
- "version": "2.0.0-internal.2.3.0",
62
- "baselineRange": ">=2.0.0-internal.2.2.0 <2.0.0-internal.2.3.0",
63
- "baselineVersion": "2.0.0-internal.2.2.0",
64
- "broken": {}
65
60
  }
66
- }
61
+ }
@@ -4,5 +4,5 @@
4
4
  */
5
5
 
6
6
  module.exports = {
7
- ...require("@fluidframework/build-common/prettier.config.cjs"),
7
+ ...require("@fluidframework/build-common/prettier.config.cjs"),
8
8
  };
@@ -0,0 +1,81 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import type { IUser } from "@fluidframework/protocol-definitions";
7
+
8
+ /**
9
+ * AttributionKey representing a reference to some op in the op stream.
10
+ * Content associated with this key aligns with content modified by that op.
11
+ *
12
+ * @alpha
13
+ */
14
+ export interface OpAttributionKey {
15
+ /**
16
+ * The type of attribution this key corresponds to.
17
+ *
18
+ * Keys currently all represent op-based attribution, so have the form `{ type: "op", key: sequenceNumber }`.
19
+ * Thus, they can be used with an `OpStreamAttributor` to recover timestamp/user information.
20
+ */
21
+ type: "op";
22
+
23
+ /**
24
+ * The sequenceNumber of the op this attribution key is for.
25
+ */
26
+ seq: number;
27
+ }
28
+
29
+ /**
30
+ * AttributionKey associated with content that was inserted while the container was in a detached state.
31
+ *
32
+ * @remarks - Retrieving an {@link AttributionInfo} from content associated with detached attribution keys
33
+ * is currently unsupported, as applications can effectively modify content anonymously while detached.
34
+ * The runtime has no mechanism for reliably obtaining the user. It would be reasonable to start supporting
35
+ * this functionality if the host provided additional context to their attributor or attach calls.
36
+ *
37
+ * @alpha
38
+ */
39
+ export interface DetachedAttributionKey {
40
+ type: "detached";
41
+
42
+ /**
43
+ * Arbitrary discriminator associated with content inserted while detached.
44
+ *
45
+ * @remarks - For now, the runtime assumes all content created while detached is associated
46
+ * with the same user/timestamp.
47
+ * We could weaken this assumption in the future with further API support and
48
+ * allow arbitrary strings or numbers as part of this key.
49
+ */
50
+ id: 0;
51
+ }
52
+
53
+ /**
54
+ * AttributionKey associated with content that has been made locally but not yet acked by the server.
55
+ *
56
+ * @alpha
57
+ */
58
+ export interface LocalAttributionKey {
59
+ type: "local";
60
+ }
61
+
62
+ /**
63
+ * Can be indexed into the ContainerRuntime in order to retrieve {@link AttributionInfo}.
64
+ * @alpha
65
+ */
66
+ export type AttributionKey = OpAttributionKey | DetachedAttributionKey | LocalAttributionKey;
67
+
68
+ /**
69
+ * Attribution information associated with a change.
70
+ * @alpha
71
+ */
72
+ export interface AttributionInfo {
73
+ /**
74
+ * The user that performed the change.
75
+ */
76
+ user: IUser;
77
+ /**
78
+ * When the change happened.
79
+ */
80
+ timestamp: number;
81
+ }