@fluidframework/runtime-definitions 2.0.0-dev-rc.1.0.0.228517 → 2.0.0-dev-rc.2.0.0.245554

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 (84) hide show
  1. package/.eslintrc.cjs +1 -1
  2. package/CHANGELOG.md +75 -0
  3. package/api-extractor-cjs.json +8 -0
  4. package/api-extractor-lint.json +1 -1
  5. package/api-extractor.json +1 -1
  6. package/api-report/runtime-definitions.api.md +103 -116
  7. package/dist/dataStoreContext.d.ts +128 -69
  8. package/dist/dataStoreContext.d.ts.map +1 -1
  9. package/dist/dataStoreContext.js +3 -0
  10. package/dist/dataStoreContext.js.map +1 -1
  11. package/dist/dataStoreFactory.d.ts +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 → garbageCollectionDefinitions.d.ts} +8 -2
  18. package/dist/garbageCollectionDefinitions.d.ts.map +1 -0
  19. package/dist/{garbageCollection.js → garbageCollectionDefinitions.js} +9 -3
  20. package/dist/garbageCollectionDefinitions.js.map +1 -0
  21. package/dist/index.d.ts +12 -52
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +20 -26
  24. package/dist/index.js.map +1 -1
  25. package/dist/package.json +3 -0
  26. package/dist/protocol.d.ts +2 -1
  27. package/dist/protocol.d.ts.map +1 -1
  28. package/dist/protocol.js.map +1 -1
  29. package/dist/runtime-definitions-alpha.d.ts +188 -165
  30. package/dist/runtime-definitions-beta.d.ts +37 -59
  31. package/dist/runtime-definitions-public.d.ts +37 -59
  32. package/dist/runtime-definitions-untrimmed.d.ts +195 -166
  33. package/dist/summary.d.ts +15 -20
  34. package/dist/summary.d.ts.map +1 -1
  35. package/dist/summary.js.map +1 -1
  36. package/dist/tsdoc-metadata.json +1 -1
  37. package/lib/attribution.d.ts +71 -0
  38. package/lib/attribution.d.ts.map +1 -0
  39. package/lib/attribution.js +6 -0
  40. package/lib/attribution.js.map +1 -0
  41. package/lib/dataStoreContext.d.ts +464 -0
  42. package/lib/dataStoreContext.d.ts.map +1 -0
  43. package/lib/dataStoreContext.js +67 -0
  44. package/lib/dataStoreContext.js.map +1 -0
  45. package/lib/dataStoreFactory.d.ts +33 -0
  46. package/lib/dataStoreFactory.d.ts.map +1 -0
  47. package/lib/dataStoreFactory.js +9 -0
  48. package/lib/dataStoreFactory.js.map +1 -0
  49. package/lib/dataStoreRegistry.d.ts +41 -0
  50. package/lib/dataStoreRegistry.d.ts.map +1 -0
  51. package/lib/dataStoreRegistry.js +9 -0
  52. package/lib/dataStoreRegistry.js.map +1 -0
  53. package/lib/garbageCollectionDefinitions.d.ts +62 -0
  54. package/lib/garbageCollectionDefinitions.d.ts.map +1 -0
  55. package/lib/garbageCollectionDefinitions.js +35 -0
  56. package/lib/garbageCollectionDefinitions.js.map +1 -0
  57. package/lib/index.d.ts +17 -0
  58. package/lib/index.d.ts.map +1 -0
  59. package/lib/index.js +10 -0
  60. package/lib/index.js.map +1 -0
  61. package/lib/protocol.d.ts +77 -0
  62. package/lib/protocol.d.ts.map +1 -0
  63. package/lib/protocol.js +6 -0
  64. package/lib/protocol.js.map +1 -0
  65. package/lib/runtime-definitions-alpha.d.ts +1019 -0
  66. package/lib/runtime-definitions-beta.d.ts +242 -0
  67. package/lib/runtime-definitions-public.d.ts +242 -0
  68. package/lib/runtime-definitions-untrimmed.d.ts +1100 -0
  69. package/lib/summary.d.ts +322 -0
  70. package/lib/summary.d.ts.map +1 -0
  71. package/lib/summary.js +26 -0
  72. package/lib/summary.js.map +1 -0
  73. package/package.json +115 -33
  74. package/src/dataStoreContext.ts +151 -85
  75. package/src/dataStoreFactory.ts +1 -1
  76. package/src/dataStoreRegistry.ts +1 -1
  77. package/src/{garbageCollection.ts → garbageCollectionDefinitions.ts} +7 -1
  78. package/src/index.ts +26 -71
  79. package/src/protocol.ts +2 -1
  80. package/src/summary.ts +18 -20
  81. package/tsconfig.cjs.json +7 -0
  82. package/tsconfig.json +2 -5
  83. package/dist/garbageCollection.d.ts.map +0 -1
  84. package/dist/garbageCollection.js.map +0 -1
package/src/summary.ts CHANGED
@@ -3,15 +3,18 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { TelemetryEventPropertyType } from "@fluidframework/core-interfaces";
7
- import {
6
+ import type { TelemetryBaseEventPropertyType } from "@fluidframework/core-interfaces";
7
+ import type {
8
8
  SummaryTree,
9
9
  ISummaryTree,
10
10
  ISequencedDocumentMessage,
11
11
  ISnapshotTree,
12
12
  ITree,
13
13
  } from "@fluidframework/protocol-definitions";
14
- import { IGarbageCollectionData, IGarbageCollectionDetailsBase } from "./garbageCollection";
14
+ import type {
15
+ IGarbageCollectionData,
16
+ IGarbageCollectionDetailsBase,
17
+ } from "./garbageCollectionDefinitions.js";
15
18
 
16
19
  /**
17
20
  * Contains the aggregation data from a Tree/Subtree.
@@ -125,16 +128,6 @@ export interface ISummarizerNodeConfig {
125
128
  * Defaults to true.
126
129
  */
127
130
  readonly canReuseHandle?: boolean;
128
- /**
129
- * True to always stop execution on error during summarize, or false to
130
- * attempt creating a summary that is a pointer ot the last acked summary
131
- * plus outstanding ops in case of internal summarize failure.
132
- * Defaults to false.
133
- *
134
- * BUG BUG: Default to true while we investigate problem
135
- * with differential summaries
136
- */
137
- readonly throwOnFailure?: true;
138
131
  }
139
132
 
140
133
  /**
@@ -187,9 +180,6 @@ export interface ISummarizerNode {
187
180
  invalidate(sequenceNumber: number): void;
188
181
  /**
189
182
  * Calls the internal summarize function and handles internal state tracking.
190
- * If unchanged and fullTree is false, it will reuse previous summary subtree.
191
- * If an error is encountered and throwOnFailure is false, it will try to make
192
- * a summary with a pointer to the previous summary + a blob of outstanding ops.
193
183
  * @param fullTree - true to skip optimizations and always generate the full tree
194
184
  * @param trackState - indicates whether the summarizer node should track the state of the summary or not
195
185
  * @param telemetryContext - summary data passed through the layers for telemetry purposes
@@ -238,7 +228,9 @@ export interface ISummarizerNode {
238
228
 
239
229
  getChild(id: string): ISummarizerNode | undefined;
240
230
 
241
- /** True if a summary is currently in progress */
231
+ /**
232
+ * True if a summary is currently in progress
233
+ */
242
234
  isSummaryInProgress?(): boolean;
243
235
  }
244
236
 
@@ -339,7 +331,7 @@ export interface ITelemetryContext {
339
331
  * @param property - property name of the telemetry data being tracked (ex: "DirectoryCount")
340
332
  * @param value - value to attribute to this summary telemetry data
341
333
  */
342
- set(prefix: string, property: string, value: TelemetryEventPropertyType): void;
334
+ set(prefix: string, property: string, value: TelemetryBaseEventPropertyType): void;
343
335
 
344
336
  /**
345
337
  * Sets multiple values for telemetry data being tracked.
@@ -350,20 +342,26 @@ export interface ITelemetryContext {
350
342
  setMultiple(
351
343
  prefix: string,
352
344
  property: string,
353
- values: Record<string, TelemetryEventPropertyType>,
345
+ values: Record<string, TelemetryBaseEventPropertyType>,
354
346
  ): void;
355
347
 
356
348
  /**
357
349
  * Get the telemetry data being tracked
350
+ *
351
+ * @deprecated This interface should only be used for instrumenting, not for attempting to read already-set telemetry data.
352
+ *
358
353
  * @param prefix - unique prefix for this data (ex: "fluid:map:")
359
354
  * @param property - property name of the telemetry data being tracked (ex: "DirectoryCount")
360
355
  * @returns undefined if item not found
361
356
  */
362
- get(prefix: string, property: string): TelemetryEventPropertyType;
357
+ get(prefix: string, property: string): TelemetryBaseEventPropertyType;
363
358
 
364
359
  /**
365
360
  * Returns a serialized version of all the telemetry data.
366
361
  * Should be used when logging in telemetry events.
362
+ *
363
+ * @deprecated This interface should only be used for instrumenting. A concrete implementation will likely have a serialize function
364
+ * but this functionality should not be used by other code being given an ITelemetryContext.
367
365
  */
368
366
  serialize(): string;
369
367
  }
@@ -0,0 +1,7 @@
1
+ {
2
+ // This config must be used in a "type": "commonjs" environment. (Use fluid-tsc commonjs.)
3
+ "extends": "./tsconfig.json",
4
+ "compilerOptions": {
5
+ "outDir": "./dist",
6
+ },
7
+ }
package/tsconfig.json CHANGED
@@ -1,12 +1,9 @@
1
1
  {
2
- "extends": [
3
- "../../../common/build/build-common/tsconfig.base.json",
4
- "../../../common/build/build-common/tsconfig.esm-only.json",
5
- ],
2
+ "extends": "../../../common/build/build-common/tsconfig.node16.json",
6
3
  "include": ["src/**/*"],
7
4
  "exclude": ["src/test/**/*"],
8
5
  "compilerOptions": {
9
6
  "rootDir": "./src",
10
- "outDir": "./dist",
7
+ "outDir": "./lib",
11
8
  },
12
9
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"garbageCollection.d.ts","sourceRoot":"","sources":["../src/garbageCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AACH,eAAO,MAAM,SAAS,OAAO,CAAC;AAC9B;;;;GAIG;AACH,eAAO,MAAM,YAAY,SAAS,CAAC;AACnC;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,iBAAiB,CAAC;AACjD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,mBAAmB,CAAC;AAEjD;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACtC;;OAEG;IACH,OAAO,EAAE;QAAE,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;KAAE,CAAC;CACpC;AAED;;;GAGG;AACH,MAAM,WAAW,6BAA6B;IAC7C;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB;;OAEG;IACH,MAAM,CAAC,EAAE,sBAAsB,CAAC;CAChC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"garbageCollection.js","sourceRoot":"","sources":["../src/garbageCollection.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;;;GAIG;AACU,QAAA,SAAS,GAAG,IAAI,CAAC;AAC9B;;;;GAIG;AACU,QAAA,YAAY,GAAG,MAAM,CAAC;AACnC;;;;GAIG;AACU,QAAA,kBAAkB,GAAG,cAAc,CAAC;AACjD;;;;GAIG;AACU,QAAA,gBAAgB,GAAG,gBAAgB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * The key for the GC tree in summary.\n *\n * @internal\n */\nexport const gcTreeKey = \"gc\";\n/**\n * They prefix for GC blobs in the GC tree in summary.\n *\n * @internal\n */\nexport const gcBlobPrefix = \"__gc\";\n/**\n * The key for tombstone blob in the GC tree in summary.\n *\n * @internal\n */\nexport const gcTombstoneBlobKey = \"__tombstones\";\n/**\n * The key for deleted nodes blob in the GC tree in summary.\n *\n * @internal\n */\nexport const gcDeletedBlobKey = \"__deletedNodes\";\n\n/**\n * Garbage collection data returned by nodes in a Container.\n * Used for running GC in the Container.\n * @public\n */\nexport interface IGarbageCollectionData {\n\t/**\n\t * The GC nodes of a Fluid object in the Container. Each node has an id and a set of routes to other GC nodes.\n\t */\n\tgcNodes: { [id: string]: string[] };\n}\n\n/**\n * GC details provided to each node during creation.\n * @alpha\n */\nexport interface IGarbageCollectionDetailsBase {\n\t/**\n\t * A list of routes to Fluid objects that are used in this node.\n\t */\n\tusedRoutes?: string[];\n\t/**\n\t * The GC data of this node.\n\t */\n\tgcData?: IGarbageCollectionData;\n}\n"]}