@fluidframework/shared-summary-block 2.0.0-internal.8.0.1 → 2.0.0-rc.1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/README.md +0 -6
  3. package/api-extractor-esm.json +4 -0
  4. package/api-extractor-lint.json +1 -10
  5. package/api-extractor.json +1 -9
  6. package/api-report/shared-summary-block.api.md +2 -2
  7. package/dist/{index.cjs → index.js} +3 -3
  8. package/dist/index.js.map +1 -0
  9. package/dist/interfaces.d.ts +1 -1
  10. package/dist/{interfaces.cjs → interfaces.js} +1 -1
  11. package/dist/interfaces.js.map +1 -0
  12. package/dist/packageVersion.d.ts +1 -1
  13. package/dist/packageVersion.d.ts.map +1 -1
  14. package/dist/{packageVersion.cjs → packageVersion.js} +2 -2
  15. package/dist/packageVersion.js.map +1 -0
  16. package/dist/shared-summary-block-alpha.d.ts +83 -2
  17. package/dist/shared-summary-block-beta.d.ts +0 -18
  18. package/dist/shared-summary-block-public.d.ts +0 -18
  19. package/dist/shared-summary-block-untrimmed.d.ts +2 -2
  20. package/dist/sharedSummaryBlock.d.ts +1 -1
  21. package/dist/{sharedSummaryBlock.cjs → sharedSummaryBlock.js} +3 -3
  22. package/dist/sharedSummaryBlock.js.map +1 -0
  23. package/dist/{sharedSummaryBlockFactory.cjs → sharedSummaryBlockFactory.js} +3 -3
  24. package/dist/sharedSummaryBlockFactory.js.map +1 -0
  25. package/lib/{index.d.ts → index.d.mts} +1 -1
  26. package/lib/index.d.mts.map +1 -0
  27. package/lib/{interfaces.d.ts → interfaces.d.mts} +2 -2
  28. package/lib/interfaces.d.mts.map +1 -0
  29. package/lib/interfaces.mjs.map +1 -1
  30. package/lib/{packageVersion.d.ts → packageVersion.d.mts} +2 -2
  31. package/lib/packageVersion.d.mts.map +1 -0
  32. package/lib/packageVersion.mjs +1 -1
  33. package/lib/packageVersion.mjs.map +1 -1
  34. package/lib/shared-summary-block-alpha.d.mts +100 -0
  35. package/lib/{shared-summary-block-alpha.d.ts → shared-summary-block-beta.d.mts} +2 -0
  36. package/lib/{shared-summary-block-public.d.ts → shared-summary-block-public.d.mts} +0 -18
  37. package/lib/{shared-summary-block-untrimmed.d.ts → shared-summary-block-untrimmed.d.mts} +2 -2
  38. package/lib/{sharedSummaryBlock.d.ts → sharedSummaryBlock.d.mts} +2 -2
  39. package/lib/sharedSummaryBlock.d.mts.map +1 -0
  40. package/lib/sharedSummaryBlock.mjs +1 -1
  41. package/lib/sharedSummaryBlock.mjs.map +1 -1
  42. package/lib/{sharedSummaryBlockFactory.d.ts → sharedSummaryBlockFactory.d.mts} +1 -1
  43. package/lib/sharedSummaryBlockFactory.d.mts.map +1 -0
  44. package/package.json +76 -23
  45. package/src/interfaces.ts +1 -1
  46. package/src/packageVersion.ts +1 -1
  47. package/src/sharedSummaryBlock.ts +1 -1
  48. package/dist/index.cjs.map +0 -1
  49. package/dist/interfaces.cjs.map +0 -1
  50. package/dist/packageVersion.cjs.map +0 -1
  51. package/dist/sharedSummaryBlock.cjs.map +0 -1
  52. package/dist/sharedSummaryBlockFactory.cjs.map +0 -1
  53. package/lib/index.d.ts.map +0 -1
  54. package/lib/interfaces.d.ts.map +0 -1
  55. package/lib/packageVersion.d.ts.map +0 -1
  56. package/lib/shared-summary-block-beta.d.ts +0 -39
  57. package/lib/sharedSummaryBlock.d.ts.map +0 -1
  58. package/lib/sharedSummaryBlockFactory.d.ts.map +0 -1
  59. package/tsc-multi.test.json +0 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,39 @@
1
1
  # @fluidframework/shared-summary-block
2
2
 
3
+ ## 2.0.0-rc.1.0.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Updated server dependencies ([#19122](https://github.com/microsoft/FluidFramework/issues/19122)) [25366b4229](https://github.com/microsoft/FluidFramework/commits/25366b422918cb43685c5f328b50450749592902)
8
+
9
+ The following Fluid server dependencies have been updated to the latest version, 3.0.0. [See the full changelog.](https://github.com/microsoft/FluidFramework/releases/tag/server_v3.0.0)
10
+
11
+ - @fluidframework/gitresources
12
+ - @fluidframework/server-kafka-orderer
13
+ - @fluidframework/server-lambdas
14
+ - @fluidframework/server-lambdas-driver
15
+ - @fluidframework/server-local-server
16
+ - @fluidframework/server-memory-orderer
17
+ - @fluidframework/protocol-base
18
+ - @fluidframework/server-routerlicious
19
+ - @fluidframework/server-routerlicious-base
20
+ - @fluidframework/server-services
21
+ - @fluidframework/server-services-client
22
+ - @fluidframework/server-services-core
23
+ - @fluidframework/server-services-ordering-kafkanode
24
+ - @fluidframework/server-services-ordering-rdkafka
25
+ - @fluidframework/server-services-ordering-zookeeper
26
+ - @fluidframework/server-services-shared
27
+ - @fluidframework/server-services-telemetry
28
+ - @fluidframework/server-services-utils
29
+ - @fluidframework/server-test-utils
30
+ - tinylicious
31
+
32
+ - Updated @fluidframework/protocol-definitions ([#19122](https://github.com/microsoft/FluidFramework/issues/19122)) [25366b4229](https://github.com/microsoft/FluidFramework/commits/25366b422918cb43685c5f328b50450749592902)
33
+
34
+ The @fluidframework/protocol-definitions dependency has been upgraded to v3.1.0. [See the full
35
+ changelog.](https://github.com/microsoft/FluidFramework/blob/main/common/lib/protocol-definitions/CHANGELOG.md#310)
36
+
3
37
  ## 2.0.0-internal.8.0.0
4
38
 
5
39
  ### Major Changes
package/README.md CHANGED
@@ -14,12 +14,6 @@ When taking a dependency on a Fluid Framework library, we recommend using a `^`
14
14
  While Fluid Framework libraries may use different ranges with interdependencies between other Fluid Framework libraries,
15
15
  library consumers should always prefer `^`.
16
16
 
17
- Note that when depending on a library version of the form `2.0.0-internal.x.y.z`, called the Fluid internal version scheme,
18
- you must use a `>= <` dependency range (such as `>=2.0.0-internal.x.y.z <2.0.0-internal.w.0.0` where `w` is `x+1`).
19
- Standard `^` and `~` ranges will not work as expected.
20
- See the [@fluid-tools/version-tools](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/version-tools/README.md)
21
- package for more information including tools to convert between version schemes.
22
-
23
17
  <!-- prettier-ignore-end -->
24
18
 
25
19
  <!-- AUTO-GENERATED-CONTENT:END -->
@@ -0,0 +1,4 @@
1
+ {
2
+ "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
+ "extends": "../../../common/build/build-common/api-extractor-base-esm.json"
4
+ }
@@ -1,13 +1,4 @@
1
1
  {
2
2
  "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
- "extends": "../../../common/build/build-common/api-extractor-lint.json",
4
- "messages": {
5
- "extractorMessageReporting": {
6
- // TODO: remove once base config has this enabled as an error
7
- "ae-incompatible-release-tags": {
8
- "logLevel": "error",
9
- "addToApiReportFile": false
10
- }
11
- }
12
- }
3
+ "extends": "../../../common/build/build-common/api-extractor-lint.json"
13
4
  }
@@ -1,12 +1,4 @@
1
1
  {
2
2
  "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
- "extends": "../../../common/build/build-common/api-extractor-base.json",
4
- "messages": {
5
- "extractorMessageReporting": {
6
- // TODO: Add missing documentation and remove this rule override
7
- "ae-undocumented": {
8
- "logLevel": "none"
9
- }
10
- }
11
- }
3
+ "extends": "../../../common/build/build-common/api-extractor-base.json"
12
4
  }
@@ -16,13 +16,13 @@ import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
16
16
  import { Jsonable } from '@fluidframework/datastore-definitions';
17
17
  import { SharedObject } from '@fluidframework/shared-object-base';
18
18
 
19
- // @internal
19
+ // @alpha
20
20
  export interface ISharedSummaryBlock extends ISharedObject {
21
21
  get<T>(key: string): Jsonable<T>;
22
22
  set<T>(key: string, value: Jsonable<T>): void;
23
23
  }
24
24
 
25
- // @internal
25
+ // @alpha
26
26
  export class SharedSummaryBlock extends SharedObject implements ISharedSummaryBlock {
27
27
  constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes);
28
28
  // (undocumented)
@@ -5,8 +5,8 @@
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.SharedSummaryBlockFactory = exports.SharedSummaryBlock = void 0;
8
- var sharedSummaryBlock_1 = require("./sharedSummaryBlock.cjs");
8
+ var sharedSummaryBlock_1 = require("./sharedSummaryBlock");
9
9
  Object.defineProperty(exports, "SharedSummaryBlock", { enumerable: true, get: function () { return sharedSummaryBlock_1.SharedSummaryBlock; } });
10
- var sharedSummaryBlockFactory_1 = require("./sharedSummaryBlockFactory.cjs");
10
+ var sharedSummaryBlockFactory_1 = require("./sharedSummaryBlockFactory");
11
11
  Object.defineProperty(exports, "SharedSummaryBlockFactory", { enumerable: true, get: function () { return sharedSummaryBlockFactory_1.SharedSummaryBlockFactory; } });
12
- //# sourceMappingURL=index.cjs.map
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,2DAA0D;AAAjD,wHAAA,kBAAkB,OAAA;AAC3B,yEAAwE;AAA/D,sIAAA,yBAAyB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { ISharedSummaryBlock } from \"./interfaces\";\nexport { SharedSummaryBlock } from \"./sharedSummaryBlock\";\nexport { SharedSummaryBlockFactory } from \"./sharedSummaryBlockFactory\";\n"]}
@@ -9,7 +9,7 @@ import { ISharedObject } from "@fluidframework/shared-object-base";
9
9
  * The set on this interface must only be called in response to a remote op. Basically, if we replay same ops,
10
10
  * the set of calls on this interface to set data should be the same. This is critical because the object does not
11
11
  * generate ops of its own, but relies on the above principle to maintain eventual consistency and to summarize.
12
- * @internal
12
+ * @alpha
13
13
  */
14
14
  export interface ISharedSummaryBlock extends ISharedObject {
15
15
  /**
@@ -4,4 +4,4 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- //# sourceMappingURL=interfaces.cjs.map
7
+ //# sourceMappingURL=interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.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 { Jsonable } from \"@fluidframework/datastore-definitions\";\nimport { ISharedObject } from \"@fluidframework/shared-object-base\";\n\n/**\n * Shared summary block interface. A shared summary block is part of the summary but it does not generate any ops.\n * The set on this interface must only be called in response to a remote op. Basically, if we replay same ops,\n * the set of calls on this interface to set data should be the same. This is critical because the object does not\n * generate ops of its own, but relies on the above principle to maintain eventual consistency and to summarize.\n * @alpha\n */\nexport interface ISharedSummaryBlock extends ISharedObject {\n\t/**\n\t * Retrieves the given key from the map.\n\t * @param key - Key to retrieve from.\n\t * @returns The stored value, or undefined if the key is not set.\n\t *\n\t * @privateRemarks\n\t * The return type is underspecified to allow for the possibility of objects with function or undefined values.\n\t */\n\tget<T>(key: string): Jsonable<T>;\n\n\t/**\n\t * Sets the value stored at key to the provided value.\n\t * @param key - Key to set at.\n\t * @param value - Jsonable type value to set.\n\t */\n\tset<T>(key: string, value: Jsonable<T>): void;\n}\n"]}
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export declare const pkgName = "@fluidframework/shared-summary-block";
8
- export declare const pkgVersion = "2.0.0-internal.8.0.1";
8
+ export declare const pkgVersion = "2.0.0-rc.1.0.0";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,yCAAyC,CAAC;AAC9D,eAAO,MAAM,UAAU,yBAAyB,CAAC"}
1
+ {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,yCAAyC,CAAC;AAC9D,eAAO,MAAM,UAAU,mBAAmB,CAAC"}
@@ -8,5 +8,5 @@
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.pkgVersion = exports.pkgName = void 0;
10
10
  exports.pkgName = "@fluidframework/shared-summary-block";
11
- exports.pkgVersion = "2.0.0-internal.8.0.1";
12
- //# sourceMappingURL=packageVersion.cjs.map
11
+ exports.pkgVersion = "2.0.0-rc.1.0.0";
12
+ //# sourceMappingURL=packageVersion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,sCAAsC,CAAC;AACjD,QAAA,UAAU,GAAG,gBAAgB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/shared-summary-block\";\nexport const pkgVersion = \"2.0.0-rc.1.0.0\";\n"]}
@@ -10,9 +10,90 @@ import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
10
10
  import { Jsonable } from '@fluidframework/datastore-definitions';
11
11
  import { SharedObject } from '@fluidframework/shared-object-base';
12
12
 
13
- /* Excluded from this release type: ISharedSummaryBlock */
13
+ /**
14
+ * Shared summary block interface. A shared summary block is part of the summary but it does not generate any ops.
15
+ * The set on this interface must only be called in response to a remote op. Basically, if we replay same ops,
16
+ * the set of calls on this interface to set data should be the same. This is critical because the object does not
17
+ * generate ops of its own, but relies on the above principle to maintain eventual consistency and to summarize.
18
+ * @alpha
19
+ */
20
+ export declare interface ISharedSummaryBlock extends ISharedObject {
21
+ /**
22
+ * Retrieves the given key from the map.
23
+ * @param key - Key to retrieve from.
24
+ * @returns The stored value, or undefined if the key is not set.
25
+ *
26
+ * @privateRemarks
27
+ * The return type is underspecified to allow for the possibility of objects with function or undefined values.
28
+ */
29
+ get<T>(key: string): Jsonable<T>;
30
+ /**
31
+ * Sets the value stored at key to the provided value.
32
+ * @param key - Key to set at.
33
+ * @param value - Jsonable type value to set.
34
+ */
35
+ set<T>(key: string, value: Jsonable<T>): void;
36
+ }
14
37
 
15
- /* Excluded from this release type: SharedSummaryBlock */
38
+ /**
39
+ * Implementation of a shared summary block. It does not generate any ops. It is only part of the summary.
40
+ * Data should be set in this object in response to a remote op.
41
+ * @alpha
42
+ */
43
+ export declare class SharedSummaryBlock extends SharedObject implements ISharedSummaryBlock {
44
+ /**
45
+ * Create a new shared summary block
46
+ *
47
+ * @param runtime - data store runtime the new shared summary block belongs to.
48
+ * @param id - optional name of the shared summary block.
49
+ * @returns newly created shared summary block (but not attached yet).
50
+ */
51
+ static create(runtime: IFluidDataStoreRuntime, id?: string): SharedSummaryBlock;
52
+ /**
53
+ * Get a factory for SharedSummaryBlock to register with the data store.
54
+ *
55
+ * @returns a factory that creates and loads SharedSummaryBlock.
56
+ */
57
+ static getFactory(): IChannelFactory;
58
+ /**
59
+ * The data held by this object.
60
+ */
61
+ private readonly data;
62
+ /**
63
+ * Constructs a new SharedSummaryBlock. If the object is non-local, an id and service interfaces will
64
+ * be provided.
65
+ *
66
+ * @param id - optional name of the shared summary block.
67
+ * @param runtime - data store runtime thee object belongs to.
68
+ * @param attributes - The attributes for the object.
69
+ */
70
+ constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes);
71
+ /**
72
+ * {@inheritDoc ISharedSummaryBlock.get}
73
+ */
74
+ get<T>(key: string): Jsonable<T>;
75
+ /**
76
+ * {@inheritDoc ISharedSummaryBlock.set}
77
+ */
78
+ set<T>(key: string, value: Jsonable<T>): void;
79
+ /**
80
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}
81
+ */
82
+ protected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats;
83
+ /**
84
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}
85
+ */
86
+ protected loadCore(storage: IChannelStorageService): Promise<void>;
87
+ /**
88
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}
89
+ */
90
+ protected onDisconnect(): void;
91
+ /**
92
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}
93
+ */
94
+ protected processCore(message: ISequencedDocumentMessage, local: boolean): void;
95
+ protected applyStashedOp(): void;
96
+ }
16
97
 
17
98
  /* Excluded from this release type: SharedSummaryBlockFactory */
18
99
 
@@ -10,28 +10,10 @@ import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
10
10
  import { Jsonable } from '@fluidframework/datastore-definitions';
11
11
  import { SharedObject } from '@fluidframework/shared-object-base';
12
12
 
13
- /* Excluded from this release type: IChannelAttributes */
14
-
15
- /* Excluded from this release type: IChannelFactory */
16
-
17
- /* Excluded from this release type: IChannelServices */
18
-
19
- /* Excluded from this release type: IChannelStorageService */
20
-
21
- /* Excluded from this release type: IFluidDataStoreRuntime */
22
-
23
- /* Excluded from this release type: IFluidSerializer */
24
-
25
- /* Excluded from this release type: ISharedObject */
26
-
27
13
  /* Excluded from this release type: ISharedSummaryBlock */
28
14
 
29
- /* Excluded from this release type: ISummaryTreeWithStats */
30
-
31
15
  /* Excluded from this release type: Jsonable */
32
16
 
33
- /* Excluded from this release type: SharedObject */
34
-
35
17
  /* Excluded from this release type: SharedSummaryBlock */
36
18
 
37
19
  /* Excluded from this release type: SharedSummaryBlockFactory */
@@ -10,28 +10,10 @@ import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
10
10
  import { Jsonable } from '@fluidframework/datastore-definitions';
11
11
  import { SharedObject } from '@fluidframework/shared-object-base';
12
12
 
13
- /* Excluded from this release type: IChannelAttributes */
14
-
15
- /* Excluded from this release type: IChannelFactory */
16
-
17
- /* Excluded from this release type: IChannelServices */
18
-
19
- /* Excluded from this release type: IChannelStorageService */
20
-
21
- /* Excluded from this release type: IFluidDataStoreRuntime */
22
-
23
- /* Excluded from this release type: IFluidSerializer */
24
-
25
- /* Excluded from this release type: ISharedObject */
26
-
27
13
  /* Excluded from this release type: ISharedSummaryBlock */
28
14
 
29
- /* Excluded from this release type: ISummaryTreeWithStats */
30
-
31
15
  /* Excluded from this release type: Jsonable */
32
16
 
33
- /* Excluded from this release type: SharedObject */
34
-
35
17
  /* Excluded from this release type: SharedSummaryBlock */
36
18
 
37
19
  /* Excluded from this release type: SharedSummaryBlockFactory */
@@ -15,7 +15,7 @@ import { SharedObject } from '@fluidframework/shared-object-base';
15
15
  * The set on this interface must only be called in response to a remote op. Basically, if we replay same ops,
16
16
  * the set of calls on this interface to set data should be the same. This is critical because the object does not
17
17
  * generate ops of its own, but relies on the above principle to maintain eventual consistency and to summarize.
18
- * @internal
18
+ * @alpha
19
19
  */
20
20
  export declare interface ISharedSummaryBlock extends ISharedObject {
21
21
  /**
@@ -38,7 +38,7 @@ export declare interface ISharedSummaryBlock extends ISharedObject {
38
38
  /**
39
39
  * Implementation of a shared summary block. It does not generate any ops. It is only part of the summary.
40
40
  * Data should be set in this object in response to a remote op.
41
- * @internal
41
+ * @alpha
42
42
  */
43
43
  export declare class SharedSummaryBlock extends SharedObject implements ISharedSummaryBlock {
44
44
  /**
@@ -10,7 +10,7 @@ import { ISharedSummaryBlock } from "./interfaces";
10
10
  /**
11
11
  * Implementation of a shared summary block. It does not generate any ops. It is only part of the summary.
12
12
  * Data should be set in this object in response to a remote op.
13
- * @internal
13
+ * @alpha
14
14
  */
15
15
  export declare class SharedSummaryBlock extends SharedObject implements ISharedSummaryBlock {
16
16
  /**
@@ -7,12 +7,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.SharedSummaryBlock = void 0;
8
8
  const driver_utils_1 = require("@fluidframework/driver-utils");
9
9
  const shared_object_base_1 = require("@fluidframework/shared-object-base");
10
- const sharedSummaryBlockFactory_1 = require("./sharedSummaryBlockFactory.cjs");
10
+ const sharedSummaryBlockFactory_1 = require("./sharedSummaryBlockFactory");
11
11
  const snapshotFileName = "header";
12
12
  /**
13
13
  * Implementation of a shared summary block. It does not generate any ops. It is only part of the summary.
14
14
  * Data should be set in this object in response to a remote op.
15
- * @internal
15
+ * @alpha
16
16
  */
17
17
  class SharedSummaryBlock extends shared_object_base_1.SharedObject {
18
18
  /**
@@ -96,4 +96,4 @@ class SharedSummaryBlock extends shared_object_base_1.SharedObject {
96
96
  }
97
97
  }
98
98
  exports.SharedSummaryBlock = SharedSummaryBlock;
99
- //# sourceMappingURL=sharedSummaryBlock.cjs.map
99
+ //# sourceMappingURL=sharedSummaryBlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sharedSummaryBlock.js","sourceRoot":"","sources":["../src/sharedSummaryBlock.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAWH,+DAA4D;AAC5D,2EAI4C;AAC5C,2EAAwE;AAGxE,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AAUlC;;;;GAIG;AACH,MAAa,kBAAmB,SAAQ,iCAAY;IACnD;;;;;;OAMG;IACI,MAAM,CAAC,MAAM,CAAC,OAA+B,EAAE,EAAW;QAChE,OAAO,OAAO,CAAC,aAAa,CAAC,EAAE,EAAE,qDAAyB,CAAC,IAAI,CAAuB,CAAC;IACxF,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,UAAU;QACvB,OAAO,IAAI,qDAAyB,EAAE,CAAC;IACxC,CAAC;IAOD;;;;;;;OAOG;IACH,YAAY,EAAU,EAAE,OAA+B,EAAE,UAA8B;QACtF,KAAK,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,2BAA2B,CAAC,CAAC;QAd7D;;WAEG;QACc,SAAI,GAAG,IAAI,GAAG,EAA6B,CAAC;IAY7D,CAAC;IAED;;OAEG;IACI,GAAG,CAAI,GAAW;QACxB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAgB,CAAC;IAC1C,CAAC;IAED;;OAEG;IACI,GAAG,CAAI,GAAW,EAAE,KAAkB;QAC5C,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC1B,mEAAmE;QACnE,IAAI,CAAC,KAAK,EAAE,CAAC;IACd,CAAC;IAED;;OAEG;IACO,aAAa,CAAC,UAA4B;QACnD,MAAM,YAAY,GAAwC,EAAE,CAAC;QAC7D,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;YAChC,YAAY,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QAC3B,CAAC,CAAC,CAAC;QACH,OAAO,IAAA,4CAAuB,EAAC,gBAAgB,EAAE,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC;IAChF,CAAC;IAED;;OAEG;IACO,KAAK,CAAC,QAAQ,CAAC,OAA+B;QACvD,MAAM,QAAQ,GAAG,MAAM,IAAA,2BAAY,EAClC,OAAO,EACP,gBAAgB,CAChB,CAAC;QACF,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YACpD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;SAC1B;IACF,CAAC;IAED;;OAEG;IACO,YAAY,KAAI,CAAC;IAE3B;;OAEG;IACO,WAAW,CAAC,OAAkC,EAAE,KAAc;QACvE,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACtE,CAAC;IAES,cAAc;QACvB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACpC,CAAC;CACD;AA7FD,gDA6FC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ISequencedDocumentMessage } from \"@fluidframework/protocol-definitions\";\nimport {\n\tIChannelAttributes,\n\tIFluidDataStoreRuntime,\n\tIChannelStorageService,\n\tJsonable,\n\tIChannelFactory,\n} from \"@fluidframework/datastore-definitions\";\nimport { ISummaryTreeWithStats } from \"@fluidframework/runtime-definitions\";\nimport { readAndParse } from \"@fluidframework/driver-utils\";\nimport {\n\tcreateSingleBlobSummary,\n\tIFluidSerializer,\n\tSharedObject,\n} from \"@fluidframework/shared-object-base\";\nimport { SharedSummaryBlockFactory } from \"./sharedSummaryBlockFactory\";\nimport { ISharedSummaryBlock } from \"./interfaces\";\n\nconst snapshotFileName = \"header\";\n\n/**\n * Defines the in-memory object structure to be used for the conversion to/from serialized.\n * Directly used in JSON.stringify, direct result from JSON.parse.\n */\ninterface ISharedSummaryBlockDataSerializable {\n\t[key: string]: Jsonable<unknown>;\n}\n\n/**\n * Implementation of a shared summary block. It does not generate any ops. It is only part of the summary.\n * Data should be set in this object in response to a remote op.\n * @alpha\n */\nexport class SharedSummaryBlock extends SharedObject implements ISharedSummaryBlock {\n\t/**\n\t * Create a new shared summary block\n\t *\n\t * @param runtime - data store runtime the new shared summary block belongs to.\n\t * @param id - optional name of the shared summary block.\n\t * @returns newly created shared summary block (but not attached yet).\n\t */\n\tpublic static create(runtime: IFluidDataStoreRuntime, id?: string) {\n\t\treturn runtime.createChannel(id, SharedSummaryBlockFactory.Type) as SharedSummaryBlock;\n\t}\n\n\t/**\n\t * Get a factory for SharedSummaryBlock to register with the data store.\n\t *\n\t * @returns a factory that creates and loads SharedSummaryBlock.\n\t */\n\tpublic static getFactory(): IChannelFactory {\n\t\treturn new SharedSummaryBlockFactory();\n\t}\n\n\t/**\n\t * The data held by this object.\n\t */\n\tprivate readonly data = new Map<string, Jsonable<unknown>>();\n\n\t/**\n\t * Constructs a new SharedSummaryBlock. If the object is non-local, an id and service interfaces will\n\t * be provided.\n\t *\n\t * @param id - optional name of the shared summary block.\n\t * @param runtime - data store runtime thee object belongs to.\n\t * @param attributes - The attributes for the object.\n\t */\n\tconstructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes) {\n\t\tsuper(id, runtime, attributes, \"fluid_sharedSummaryBlock_\");\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedSummaryBlock.get}\n\t */\n\tpublic get<T>(key: string): Jsonable<T> {\n\t\treturn this.data.get(key) as Jsonable<T>;\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedSummaryBlock.set}\n\t */\n\tpublic set<T>(key: string, value: Jsonable<T>): void {\n\t\tthis.data.set(key, value);\n\t\t// Set this object as dirty so that it is part of the next summary.\n\t\tthis.dirty();\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}\n\t */\n\tprotected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats {\n\t\tconst contentsBlob: ISharedSummaryBlockDataSerializable = {};\n\t\tthis.data.forEach((value, key) => {\n\t\t\tcontentsBlob[key] = value;\n\t\t});\n\t\treturn createSingleBlobSummary(snapshotFileName, JSON.stringify(contentsBlob));\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}\n\t */\n\tprotected async loadCore(storage: IChannelStorageService): Promise<void> {\n\t\tconst contents = await readAndParse<ISharedSummaryBlockDataSerializable>(\n\t\t\tstorage,\n\t\t\tsnapshotFileName,\n\t\t);\n\t\tfor (const [key, value] of Object.entries(contents)) {\n\t\t\tthis.data.set(key, value);\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}\n\t */\n\tprotected onDisconnect() {}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}\n\t */\n\tprotected processCore(message: ISequencedDocumentMessage, local: boolean) {\n\t\tthrow new Error(\"shared summary block should not generate any ops.\");\n\t}\n\n\tprotected applyStashedOp() {\n\t\tthrow new Error(\"not implemented\");\n\t}\n}\n"]}
@@ -5,8 +5,8 @@
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.SharedSummaryBlockFactory = void 0;
8
- const packageVersion_1 = require("./packageVersion.cjs");
9
- const sharedSummaryBlock_1 = require("./sharedSummaryBlock.cjs");
8
+ const packageVersion_1 = require("./packageVersion");
9
+ const sharedSummaryBlock_1 = require("./sharedSummaryBlock");
10
10
  /**
11
11
  * The factory that defines the shared summary block.
12
12
  *
@@ -56,4 +56,4 @@ SharedSummaryBlockFactory.Attributes = {
56
56
  snapshotFormatVersion: "0.1",
57
57
  packageVersion: packageVersion_1.pkgVersion,
58
58
  };
59
- //# sourceMappingURL=sharedSummaryBlockFactory.cjs.map
59
+ //# sourceMappingURL=sharedSummaryBlockFactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sharedSummaryBlockFactory.js","sourceRoot":"","sources":["../src/sharedSummaryBlockFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AASH,qDAA8C;AAC9C,6DAA0D;AAE1D;;;;;GAKG;AACH,MAAa,yBAAyB;IAerC;;OAEG;IACH,IAAW,IAAI;QACd,OAAO,yBAAyB,CAAC,IAAI,CAAC;IACvC,CAAC;IAED;;OAEG;IACH,IAAW,UAAU;QACpB,OAAO,yBAAyB,CAAC,UAAU,CAAC;IAC7C,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,IAAI,CAChB,OAA+B,EAC/B,EAAU,EACV,QAA0B,EAC1B,UAA8B;QAE9B,MAAM,kBAAkB,GAAG,IAAI,uCAAkB,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QAC3E,MAAM,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAExC,OAAO,kBAAkB,CAAC;IAC3B,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,OAA+B,EAAE,EAAU;QACxD,MAAM,kBAAkB,GAAG,IAAI,uCAAkB,CAChD,EAAE,EACF,OAAO,EACP,yBAAyB,CAAC,UAAU,CACpC,CAAC;QACF,kBAAkB,CAAC,eAAe,EAAE,CAAC;QAErC,OAAO,kBAAkB,CAAC;IAC3B,CAAC;;AAxDF,8DAyDC;AAxDA;;GAEG;AACoB,8BAAI,GAAG,wDAAwD,CAAC;AAEvF;;GAEG;AACoB,oCAAU,GAAuB;IACvD,IAAI,EAAE,yBAAyB,CAAC,IAAI;IACpC,qBAAqB,EAAE,KAAK;IAC5B,cAAc,EAAE,2BAAU;CAC1B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIChannelAttributes,\n\tIFluidDataStoreRuntime,\n\tIChannelServices,\n\tIChannelFactory,\n} from \"@fluidframework/datastore-definitions\";\nimport { ISharedObject } from \"@fluidframework/shared-object-base\";\nimport { pkgVersion } from \"./packageVersion\";\nimport { SharedSummaryBlock } from \"./sharedSummaryBlock\";\n\n/**\n * The factory that defines the shared summary block.\n *\n * @sealed\n * @internal\n */\nexport class SharedSummaryBlockFactory implements IChannelFactory {\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.\"type\"}\n\t */\n\tpublic static readonly Type = \"https://graph.microsoft.com/types/shared-summary-block\";\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}\n\t */\n\tpublic static readonly Attributes: IChannelAttributes = {\n\t\ttype: SharedSummaryBlockFactory.Type,\n\t\tsnapshotFormatVersion: \"0.1\",\n\t\tpackageVersion: pkgVersion,\n\t};\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.\"type\"}\n\t */\n\tpublic get type() {\n\t\treturn SharedSummaryBlockFactory.Type;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}\n\t */\n\tpublic get attributes() {\n\t\treturn SharedSummaryBlockFactory.Attributes;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}\n\t */\n\tpublic async load(\n\t\truntime: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\tservices: IChannelServices,\n\t\tattributes: IChannelAttributes,\n\t): Promise<ISharedObject> {\n\t\tconst sharedSummaryBlock = new SharedSummaryBlock(id, runtime, attributes);\n\t\tawait sharedSummaryBlock.load(services);\n\n\t\treturn sharedSummaryBlock;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.create}\n\t */\n\tpublic create(runtime: IFluidDataStoreRuntime, id: string): ISharedObject {\n\t\tconst sharedSummaryBlock = new SharedSummaryBlock(\n\t\t\tid,\n\t\t\truntime,\n\t\t\tSharedSummaryBlockFactory.Attributes,\n\t\t);\n\t\tsharedSummaryBlock.initializeLocal();\n\n\t\treturn sharedSummaryBlock;\n\t}\n}\n"]}
@@ -5,4 +5,4 @@
5
5
  export { ISharedSummaryBlock } from "./interfaces.mjs";
6
6
  export { SharedSummaryBlock } from "./sharedSummaryBlock.mjs";
7
7
  export { SharedSummaryBlockFactory } from "./sharedSummaryBlockFactory.mjs";
8
- //# sourceMappingURL=index.d.ts.map
8
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,mBAAmB,EAAE;OACvB,EAAE,kBAAkB,EAAE;OACtB,EAAE,yBAAyB,EAAE"}
@@ -9,7 +9,7 @@ import { ISharedObject } from "@fluidframework/shared-object-base";
9
9
  * The set on this interface must only be called in response to a remote op. Basically, if we replay same ops,
10
10
  * the set of calls on this interface to set data should be the same. This is critical because the object does not
11
11
  * generate ops of its own, but relies on the above principle to maintain eventual consistency and to summarize.
12
- * @internal
12
+ * @alpha
13
13
  */
14
14
  export interface ISharedSummaryBlock extends ISharedObject {
15
15
  /**
@@ -28,4 +28,4 @@ export interface ISharedSummaryBlock extends ISharedObject {
28
28
  */
29
29
  set<T>(key: string, value: Jsonable<T>): void;
30
30
  }
31
- //# sourceMappingURL=interfaces.d.ts.map
31
+ //# sourceMappingURL=interfaces.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.d.mts","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,QAAQ,EAAE,MAAM,uCAAuC;OACzD,EAAE,aAAa,EAAE,MAAM,oCAAoC;AAElE;;;;;;GAMG;AACH,MAAM,WAAW,mBAAoB,SAAQ,aAAa;IACzD;;;;;;;OAOG;IACH,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAEjC;;;;OAIG;IACH,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;CAC9C"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.mjs","sourceRoot":"","sources":["../src/interfaces.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 { Jsonable } from \"@fluidframework/datastore-definitions\";\nimport { ISharedObject } from \"@fluidframework/shared-object-base\";\n\n/**\n * Shared summary block interface. A shared summary block is part of the summary but it does not generate any ops.\n * The set on this interface must only be called in response to a remote op. Basically, if we replay same ops,\n * the set of calls on this interface to set data should be the same. This is critical because the object does not\n * generate ops of its own, but relies on the above principle to maintain eventual consistency and to summarize.\n * @internal\n */\nexport interface ISharedSummaryBlock extends ISharedObject {\n\t/**\n\t * Retrieves the given key from the map.\n\t * @param key - Key to retrieve from.\n\t * @returns The stored value, or undefined if the key is not set.\n\t *\n\t * @privateRemarks\n\t * The return type is underspecified to allow for the possibility of objects with function or undefined values.\n\t */\n\tget<T>(key: string): Jsonable<T>;\n\n\t/**\n\t * Sets the value stored at key to the provided value.\n\t * @param key - Key to set at.\n\t * @param value - Jsonable type value to set.\n\t */\n\tset<T>(key: string, value: Jsonable<T>): void;\n}\n"]}
1
+ {"version":3,"file":"interfaces.mjs","sourceRoot":"","sources":["../src/interfaces.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 { Jsonable } from \"@fluidframework/datastore-definitions\";\nimport { ISharedObject } from \"@fluidframework/shared-object-base\";\n\n/**\n * Shared summary block interface. A shared summary block is part of the summary but it does not generate any ops.\n * The set on this interface must only be called in response to a remote op. Basically, if we replay same ops,\n * the set of calls on this interface to set data should be the same. This is critical because the object does not\n * generate ops of its own, but relies on the above principle to maintain eventual consistency and to summarize.\n * @alpha\n */\nexport interface ISharedSummaryBlock extends ISharedObject {\n\t/**\n\t * Retrieves the given key from the map.\n\t * @param key - Key to retrieve from.\n\t * @returns The stored value, or undefined if the key is not set.\n\t *\n\t * @privateRemarks\n\t * The return type is underspecified to allow for the possibility of objects with function or undefined values.\n\t */\n\tget<T>(key: string): Jsonable<T>;\n\n\t/**\n\t * Sets the value stored at key to the provided value.\n\t * @param key - Key to set at.\n\t * @param value - Jsonable type value to set.\n\t */\n\tset<T>(key: string, value: Jsonable<T>): void;\n}\n"]}
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export declare const pkgName = "@fluidframework/shared-summary-block";
8
- export declare const pkgVersion = "2.0.0-internal.8.0.1";
9
- //# sourceMappingURL=packageVersion.d.ts.map
8
+ export declare const pkgVersion = "2.0.0-rc.1.0.0";
9
+ //# sourceMappingURL=packageVersion.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"packageVersion.d.mts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,yCAAyC,CAAC;AAC9D,eAAO,MAAM,UAAU,mBAAmB,CAAC"}
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export const pkgName = "@fluidframework/shared-summary-block";
8
- export const pkgVersion = "2.0.0-internal.8.0.1";
8
+ export const pkgVersion = "2.0.0-rc.1.0.0";
9
9
  //# sourceMappingURL=packageVersion.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.mjs","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,sCAAsC,CAAC;AAC9D,MAAM,CAAC,MAAM,UAAU,GAAG,sBAAsB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/shared-summary-block\";\nexport const pkgVersion = \"2.0.0-internal.8.0.1\";\n"]}
1
+ {"version":3,"file":"packageVersion.mjs","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,sCAAsC,CAAC;AAC9D,MAAM,CAAC,MAAM,UAAU,GAAG,gBAAgB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/shared-summary-block\";\nexport const pkgVersion = \"2.0.0-rc.1.0.0\";\n"]}
@@ -0,0 +1,100 @@
1
+ import { IChannelAttributes } from '@fluidframework/datastore-definitions';
2
+ import { IChannelFactory } from '@fluidframework/datastore-definitions';
3
+ import { IChannelServices } from '@fluidframework/datastore-definitions';
4
+ import { IChannelStorageService } from '@fluidframework/datastore-definitions';
5
+ import { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions';
6
+ import { IFluidSerializer } from '@fluidframework/shared-object-base';
7
+ import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
8
+ import { ISharedObject } from '@fluidframework/shared-object-base';
9
+ import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
10
+ import { Jsonable } from '@fluidframework/datastore-definitions';
11
+ import { SharedObject } from '@fluidframework/shared-object-base';
12
+
13
+ /**
14
+ * Shared summary block interface. A shared summary block is part of the summary but it does not generate any ops.
15
+ * The set on this interface must only be called in response to a remote op. Basically, if we replay same ops,
16
+ * the set of calls on this interface to set data should be the same. This is critical because the object does not
17
+ * generate ops of its own, but relies on the above principle to maintain eventual consistency and to summarize.
18
+ * @alpha
19
+ */
20
+ export declare interface ISharedSummaryBlock extends ISharedObject {
21
+ /**
22
+ * Retrieves the given key from the map.
23
+ * @param key - Key to retrieve from.
24
+ * @returns The stored value, or undefined if the key is not set.
25
+ *
26
+ * @privateRemarks
27
+ * The return type is underspecified to allow for the possibility of objects with function or undefined values.
28
+ */
29
+ get<T>(key: string): Jsonable<T>;
30
+ /**
31
+ * Sets the value stored at key to the provided value.
32
+ * @param key - Key to set at.
33
+ * @param value - Jsonable type value to set.
34
+ */
35
+ set<T>(key: string, value: Jsonable<T>): void;
36
+ }
37
+
38
+ /**
39
+ * Implementation of a shared summary block. It does not generate any ops. It is only part of the summary.
40
+ * Data should be set in this object in response to a remote op.
41
+ * @alpha
42
+ */
43
+ export declare class SharedSummaryBlock extends SharedObject implements ISharedSummaryBlock {
44
+ /**
45
+ * Create a new shared summary block
46
+ *
47
+ * @param runtime - data store runtime the new shared summary block belongs to.
48
+ * @param id - optional name of the shared summary block.
49
+ * @returns newly created shared summary block (but not attached yet).
50
+ */
51
+ static create(runtime: IFluidDataStoreRuntime, id?: string): SharedSummaryBlock;
52
+ /**
53
+ * Get a factory for SharedSummaryBlock to register with the data store.
54
+ *
55
+ * @returns a factory that creates and loads SharedSummaryBlock.
56
+ */
57
+ static getFactory(): IChannelFactory;
58
+ /**
59
+ * The data held by this object.
60
+ */
61
+ private readonly data;
62
+ /**
63
+ * Constructs a new SharedSummaryBlock. If the object is non-local, an id and service interfaces will
64
+ * be provided.
65
+ *
66
+ * @param id - optional name of the shared summary block.
67
+ * @param runtime - data store runtime thee object belongs to.
68
+ * @param attributes - The attributes for the object.
69
+ */
70
+ constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes);
71
+ /**
72
+ * {@inheritDoc ISharedSummaryBlock.get}
73
+ */
74
+ get<T>(key: string): Jsonable<T>;
75
+ /**
76
+ * {@inheritDoc ISharedSummaryBlock.set}
77
+ */
78
+ set<T>(key: string, value: Jsonable<T>): void;
79
+ /**
80
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}
81
+ */
82
+ protected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats;
83
+ /**
84
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}
85
+ */
86
+ protected loadCore(storage: IChannelStorageService): Promise<void>;
87
+ /**
88
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}
89
+ */
90
+ protected onDisconnect(): void;
91
+ /**
92
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}
93
+ */
94
+ protected processCore(message: ISequencedDocumentMessage, local: boolean): void;
95
+ protected applyStashedOp(): void;
96
+ }
97
+
98
+ /* Excluded from this release type: SharedSummaryBlockFactory */
99
+
100
+ export { }
@@ -12,6 +12,8 @@ import { SharedObject } from '@fluidframework/shared-object-base';
12
12
 
13
13
  /* Excluded from this release type: ISharedSummaryBlock */
14
14
 
15
+ /* Excluded from this release type: Jsonable */
16
+
15
17
  /* Excluded from this release type: SharedSummaryBlock */
16
18
 
17
19
  /* Excluded from this release type: SharedSummaryBlockFactory */
@@ -10,28 +10,10 @@ import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
10
10
  import { Jsonable } from '@fluidframework/datastore-definitions';
11
11
  import { SharedObject } from '@fluidframework/shared-object-base';
12
12
 
13
- /* Excluded from this release type: IChannelAttributes */
14
-
15
- /* Excluded from this release type: IChannelFactory */
16
-
17
- /* Excluded from this release type: IChannelServices */
18
-
19
- /* Excluded from this release type: IChannelStorageService */
20
-
21
- /* Excluded from this release type: IFluidDataStoreRuntime */
22
-
23
- /* Excluded from this release type: IFluidSerializer */
24
-
25
- /* Excluded from this release type: ISharedObject */
26
-
27
13
  /* Excluded from this release type: ISharedSummaryBlock */
28
14
 
29
- /* Excluded from this release type: ISummaryTreeWithStats */
30
-
31
15
  /* Excluded from this release type: Jsonable */
32
16
 
33
- /* Excluded from this release type: SharedObject */
34
-
35
17
  /* Excluded from this release type: SharedSummaryBlock */
36
18
 
37
19
  /* Excluded from this release type: SharedSummaryBlockFactory */
@@ -15,7 +15,7 @@ import { SharedObject } from '@fluidframework/shared-object-base';
15
15
  * The set on this interface must only be called in response to a remote op. Basically, if we replay same ops,
16
16
  * the set of calls on this interface to set data should be the same. This is critical because the object does not
17
17
  * generate ops of its own, but relies on the above principle to maintain eventual consistency and to summarize.
18
- * @internal
18
+ * @alpha
19
19
  */
20
20
  export declare interface ISharedSummaryBlock extends ISharedObject {
21
21
  /**
@@ -38,7 +38,7 @@ export declare interface ISharedSummaryBlock extends ISharedObject {
38
38
  /**
39
39
  * Implementation of a shared summary block. It does not generate any ops. It is only part of the summary.
40
40
  * Data should be set in this object in response to a remote op.
41
- * @internal
41
+ * @alpha
42
42
  */
43
43
  export declare class SharedSummaryBlock extends SharedObject implements ISharedSummaryBlock {
44
44
  /**
@@ -10,7 +10,7 @@ import { ISharedSummaryBlock } from "./interfaces.mjs";
10
10
  /**
11
11
  * Implementation of a shared summary block. It does not generate any ops. It is only part of the summary.
12
12
  * Data should be set in this object in response to a remote op.
13
- * @internal
13
+ * @alpha
14
14
  */
15
15
  export declare class SharedSummaryBlock extends SharedObject implements ISharedSummaryBlock {
16
16
  /**
@@ -66,4 +66,4 @@ export declare class SharedSummaryBlock extends SharedObject implements ISharedS
66
66
  protected processCore(message: ISequencedDocumentMessage, local: boolean): void;
67
67
  protected applyStashedOp(): void;
68
68
  }
69
- //# sourceMappingURL=sharedSummaryBlock.d.ts.map
69
+ //# sourceMappingURL=sharedSummaryBlock.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sharedSummaryBlock.d.mts","sourceRoot":"","sources":["../src/sharedSummaryBlock.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,yBAAyB,EAAE,MAAM,sCAAsC;OACzE,EACN,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,QAAQ,EACR,eAAe,EACf,MAAM,uCAAuC;OACvC,EAAE,qBAAqB,EAAE,MAAM,qCAAqC;OAEpE,EAEN,gBAAgB,EAChB,YAAY,EACZ,MAAM,oCAAoC;OAEpC,EAAE,mBAAmB,EAAE;AAY9B;;;;GAIG;AACH,qBAAa,kBAAmB,SAAQ,YAAa,YAAW,mBAAmB;IAClF;;;;;;OAMG;WACW,MAAM,CAAC,OAAO,EAAE,sBAAsB,EAAE,EAAE,CAAC,EAAE,MAAM;IAIjE;;;;OAIG;WACW,UAAU,IAAI,eAAe;IAI3C;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAwC;IAE7D;;;;;;;OAOG;gBACS,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,sBAAsB,EAAE,UAAU,EAAE,kBAAkB;IAIvF;;OAEG;IACI,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC;IAIvC;;OAEG;IACI,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI;IAMpD;;OAEG;IACH,SAAS,CAAC,aAAa,CAAC,UAAU,EAAE,gBAAgB,GAAG,qBAAqB;IAQ5E;;OAEG;cACa,QAAQ,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;IAUxE;;OAEG;IACH,SAAS,CAAC,YAAY;IAEtB;;OAEG;IACH,SAAS,CAAC,WAAW,CAAC,OAAO,EAAE,yBAAyB,EAAE,KAAK,EAAE,OAAO;IAIxE,SAAS,CAAC,cAAc;CAGxB"}
@@ -9,7 +9,7 @@ const snapshotFileName = "header";
9
9
  /**
10
10
  * Implementation of a shared summary block. It does not generate any ops. It is only part of the summary.
11
11
  * Data should be set in this object in response to a remote op.
12
- * @internal
12
+ * @alpha
13
13
  */
14
14
  export class SharedSummaryBlock extends SharedObject {
15
15
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"sharedSummaryBlock.mjs","sourceRoot":"","sources":["../src/sharedSummaryBlock.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAWI,EAAE,YAAY,EAAE,MAAM,8BAA8B;OACpD,EACN,uBAAuB,EAEvB,YAAY,GACZ,MAAM,oCAAoC;OACpC,EAAE,yBAAyB,EAAE;AAGpC,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AAUlC;;;;GAIG;AACH,MAAM,OAAO,kBAAmB,SAAQ,YAAY;IACnD;;;;;;OAMG;IACI,MAAM,CAAC,MAAM,CAAC,OAA+B,EAAE,EAAW;QAChE,OAAO,OAAO,CAAC,aAAa,CAAC,EAAE,EAAE,yBAAyB,CAAC,IAAI,CAAuB,CAAC;IACxF,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,UAAU;QACvB,OAAO,IAAI,yBAAyB,EAAE,CAAC;IACxC,CAAC;IAOD;;;;;;;OAOG;IACH,YAAY,EAAU,EAAE,OAA+B,EAAE,UAA8B;QACtF,KAAK,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,2BAA2B,CAAC,CAAC;QAd7D;;WAEG;QACc,SAAI,GAAG,IAAI,GAAG,EAA6B,CAAC;IAY7D,CAAC;IAED;;OAEG;IACI,GAAG,CAAI,GAAW;QACxB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAgB,CAAC;IAC1C,CAAC;IAED;;OAEG;IACI,GAAG,CAAI,GAAW,EAAE,KAAkB;QAC5C,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC1B,mEAAmE;QACnE,IAAI,CAAC,KAAK,EAAE,CAAC;IACd,CAAC;IAED;;OAEG;IACO,aAAa,CAAC,UAA4B;QACnD,MAAM,YAAY,GAAwC,EAAE,CAAC;QAC7D,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;YAChC,YAAY,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QAC3B,CAAC,CAAC,CAAC;QACH,OAAO,uBAAuB,CAAC,gBAAgB,EAAE,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC;IAChF,CAAC;IAED;;OAEG;IACO,KAAK,CAAC,QAAQ,CAAC,OAA+B;QACvD,MAAM,QAAQ,GAAG,MAAM,YAAY,CAClC,OAAO,EACP,gBAAgB,CAChB,CAAC;QACF,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YACpD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;SAC1B;IACF,CAAC;IAED;;OAEG;IACO,YAAY,KAAI,CAAC;IAE3B;;OAEG;IACO,WAAW,CAAC,OAAkC,EAAE,KAAc;QACvE,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACtE,CAAC;IAES,cAAc;QACvB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACpC,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ISequencedDocumentMessage } from \"@fluidframework/protocol-definitions\";\nimport {\n\tIChannelAttributes,\n\tIFluidDataStoreRuntime,\n\tIChannelStorageService,\n\tJsonable,\n\tIChannelFactory,\n} from \"@fluidframework/datastore-definitions\";\nimport { ISummaryTreeWithStats } from \"@fluidframework/runtime-definitions\";\nimport { readAndParse } from \"@fluidframework/driver-utils\";\nimport {\n\tcreateSingleBlobSummary,\n\tIFluidSerializer,\n\tSharedObject,\n} from \"@fluidframework/shared-object-base\";\nimport { SharedSummaryBlockFactory } from \"./sharedSummaryBlockFactory\";\nimport { ISharedSummaryBlock } from \"./interfaces\";\n\nconst snapshotFileName = \"header\";\n\n/**\n * Defines the in-memory object structure to be used for the conversion to/from serialized.\n * Directly used in JSON.stringify, direct result from JSON.parse.\n */\ninterface ISharedSummaryBlockDataSerializable {\n\t[key: string]: Jsonable<unknown>;\n}\n\n/**\n * Implementation of a shared summary block. It does not generate any ops. It is only part of the summary.\n * Data should be set in this object in response to a remote op.\n * @internal\n */\nexport class SharedSummaryBlock extends SharedObject implements ISharedSummaryBlock {\n\t/**\n\t * Create a new shared summary block\n\t *\n\t * @param runtime - data store runtime the new shared summary block belongs to.\n\t * @param id - optional name of the shared summary block.\n\t * @returns newly created shared summary block (but not attached yet).\n\t */\n\tpublic static create(runtime: IFluidDataStoreRuntime, id?: string) {\n\t\treturn runtime.createChannel(id, SharedSummaryBlockFactory.Type) as SharedSummaryBlock;\n\t}\n\n\t/**\n\t * Get a factory for SharedSummaryBlock to register with the data store.\n\t *\n\t * @returns a factory that creates and loads SharedSummaryBlock.\n\t */\n\tpublic static getFactory(): IChannelFactory {\n\t\treturn new SharedSummaryBlockFactory();\n\t}\n\n\t/**\n\t * The data held by this object.\n\t */\n\tprivate readonly data = new Map<string, Jsonable<unknown>>();\n\n\t/**\n\t * Constructs a new SharedSummaryBlock. If the object is non-local, an id and service interfaces will\n\t * be provided.\n\t *\n\t * @param id - optional name of the shared summary block.\n\t * @param runtime - data store runtime thee object belongs to.\n\t * @param attributes - The attributes for the object.\n\t */\n\tconstructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes) {\n\t\tsuper(id, runtime, attributes, \"fluid_sharedSummaryBlock_\");\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedSummaryBlock.get}\n\t */\n\tpublic get<T>(key: string): Jsonable<T> {\n\t\treturn this.data.get(key) as Jsonable<T>;\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedSummaryBlock.set}\n\t */\n\tpublic set<T>(key: string, value: Jsonable<T>): void {\n\t\tthis.data.set(key, value);\n\t\t// Set this object as dirty so that it is part of the next summary.\n\t\tthis.dirty();\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}\n\t */\n\tprotected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats {\n\t\tconst contentsBlob: ISharedSummaryBlockDataSerializable = {};\n\t\tthis.data.forEach((value, key) => {\n\t\t\tcontentsBlob[key] = value;\n\t\t});\n\t\treturn createSingleBlobSummary(snapshotFileName, JSON.stringify(contentsBlob));\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}\n\t */\n\tprotected async loadCore(storage: IChannelStorageService): Promise<void> {\n\t\tconst contents = await readAndParse<ISharedSummaryBlockDataSerializable>(\n\t\t\tstorage,\n\t\t\tsnapshotFileName,\n\t\t);\n\t\tfor (const [key, value] of Object.entries(contents)) {\n\t\t\tthis.data.set(key, value);\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}\n\t */\n\tprotected onDisconnect() {}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}\n\t */\n\tprotected processCore(message: ISequencedDocumentMessage, local: boolean) {\n\t\tthrow new Error(\"shared summary block should not generate any ops.\");\n\t}\n\n\tprotected applyStashedOp() {\n\t\tthrow new Error(\"not implemented\");\n\t}\n}\n"]}
1
+ {"version":3,"file":"sharedSummaryBlock.mjs","sourceRoot":"","sources":["../src/sharedSummaryBlock.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAWI,EAAE,YAAY,EAAE,MAAM,8BAA8B;OACpD,EACN,uBAAuB,EAEvB,YAAY,GACZ,MAAM,oCAAoC;OACpC,EAAE,yBAAyB,EAAE;AAGpC,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AAUlC;;;;GAIG;AACH,MAAM,OAAO,kBAAmB,SAAQ,YAAY;IACnD;;;;;;OAMG;IACI,MAAM,CAAC,MAAM,CAAC,OAA+B,EAAE,EAAW;QAChE,OAAO,OAAO,CAAC,aAAa,CAAC,EAAE,EAAE,yBAAyB,CAAC,IAAI,CAAuB,CAAC;IACxF,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,UAAU;QACvB,OAAO,IAAI,yBAAyB,EAAE,CAAC;IACxC,CAAC;IAOD;;;;;;;OAOG;IACH,YAAY,EAAU,EAAE,OAA+B,EAAE,UAA8B;QACtF,KAAK,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,2BAA2B,CAAC,CAAC;QAd7D;;WAEG;QACc,SAAI,GAAG,IAAI,GAAG,EAA6B,CAAC;IAY7D,CAAC;IAED;;OAEG;IACI,GAAG,CAAI,GAAW;QACxB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAgB,CAAC;IAC1C,CAAC;IAED;;OAEG;IACI,GAAG,CAAI,GAAW,EAAE,KAAkB;QAC5C,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC1B,mEAAmE;QACnE,IAAI,CAAC,KAAK,EAAE,CAAC;IACd,CAAC;IAED;;OAEG;IACO,aAAa,CAAC,UAA4B;QACnD,MAAM,YAAY,GAAwC,EAAE,CAAC;QAC7D,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;YAChC,YAAY,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QAC3B,CAAC,CAAC,CAAC;QACH,OAAO,uBAAuB,CAAC,gBAAgB,EAAE,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC;IAChF,CAAC;IAED;;OAEG;IACO,KAAK,CAAC,QAAQ,CAAC,OAA+B;QACvD,MAAM,QAAQ,GAAG,MAAM,YAAY,CAClC,OAAO,EACP,gBAAgB,CAChB,CAAC;QACF,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YACpD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;SAC1B;IACF,CAAC;IAED;;OAEG;IACO,YAAY,KAAI,CAAC;IAE3B;;OAEG;IACO,WAAW,CAAC,OAAkC,EAAE,KAAc;QACvE,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACtE,CAAC;IAES,cAAc;QACvB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACpC,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ISequencedDocumentMessage } from \"@fluidframework/protocol-definitions\";\nimport {\n\tIChannelAttributes,\n\tIFluidDataStoreRuntime,\n\tIChannelStorageService,\n\tJsonable,\n\tIChannelFactory,\n} from \"@fluidframework/datastore-definitions\";\nimport { ISummaryTreeWithStats } from \"@fluidframework/runtime-definitions\";\nimport { readAndParse } from \"@fluidframework/driver-utils\";\nimport {\n\tcreateSingleBlobSummary,\n\tIFluidSerializer,\n\tSharedObject,\n} from \"@fluidframework/shared-object-base\";\nimport { SharedSummaryBlockFactory } from \"./sharedSummaryBlockFactory\";\nimport { ISharedSummaryBlock } from \"./interfaces\";\n\nconst snapshotFileName = \"header\";\n\n/**\n * Defines the in-memory object structure to be used for the conversion to/from serialized.\n * Directly used in JSON.stringify, direct result from JSON.parse.\n */\ninterface ISharedSummaryBlockDataSerializable {\n\t[key: string]: Jsonable<unknown>;\n}\n\n/**\n * Implementation of a shared summary block. It does not generate any ops. It is only part of the summary.\n * Data should be set in this object in response to a remote op.\n * @alpha\n */\nexport class SharedSummaryBlock extends SharedObject implements ISharedSummaryBlock {\n\t/**\n\t * Create a new shared summary block\n\t *\n\t * @param runtime - data store runtime the new shared summary block belongs to.\n\t * @param id - optional name of the shared summary block.\n\t * @returns newly created shared summary block (but not attached yet).\n\t */\n\tpublic static create(runtime: IFluidDataStoreRuntime, id?: string) {\n\t\treturn runtime.createChannel(id, SharedSummaryBlockFactory.Type) as SharedSummaryBlock;\n\t}\n\n\t/**\n\t * Get a factory for SharedSummaryBlock to register with the data store.\n\t *\n\t * @returns a factory that creates and loads SharedSummaryBlock.\n\t */\n\tpublic static getFactory(): IChannelFactory {\n\t\treturn new SharedSummaryBlockFactory();\n\t}\n\n\t/**\n\t * The data held by this object.\n\t */\n\tprivate readonly data = new Map<string, Jsonable<unknown>>();\n\n\t/**\n\t * Constructs a new SharedSummaryBlock. If the object is non-local, an id and service interfaces will\n\t * be provided.\n\t *\n\t * @param id - optional name of the shared summary block.\n\t * @param runtime - data store runtime thee object belongs to.\n\t * @param attributes - The attributes for the object.\n\t */\n\tconstructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes) {\n\t\tsuper(id, runtime, attributes, \"fluid_sharedSummaryBlock_\");\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedSummaryBlock.get}\n\t */\n\tpublic get<T>(key: string): Jsonable<T> {\n\t\treturn this.data.get(key) as Jsonable<T>;\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedSummaryBlock.set}\n\t */\n\tpublic set<T>(key: string, value: Jsonable<T>): void {\n\t\tthis.data.set(key, value);\n\t\t// Set this object as dirty so that it is part of the next summary.\n\t\tthis.dirty();\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}\n\t */\n\tprotected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats {\n\t\tconst contentsBlob: ISharedSummaryBlockDataSerializable = {};\n\t\tthis.data.forEach((value, key) => {\n\t\t\tcontentsBlob[key] = value;\n\t\t});\n\t\treturn createSingleBlobSummary(snapshotFileName, JSON.stringify(contentsBlob));\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}\n\t */\n\tprotected async loadCore(storage: IChannelStorageService): Promise<void> {\n\t\tconst contents = await readAndParse<ISharedSummaryBlockDataSerializable>(\n\t\t\tstorage,\n\t\t\tsnapshotFileName,\n\t\t);\n\t\tfor (const [key, value] of Object.entries(contents)) {\n\t\t\tthis.data.set(key, value);\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}\n\t */\n\tprotected onDisconnect() {}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}\n\t */\n\tprotected processCore(message: ISequencedDocumentMessage, local: boolean) {\n\t\tthrow new Error(\"shared summary block should not generate any ops.\");\n\t}\n\n\tprotected applyStashedOp() {\n\t\tthrow new Error(\"not implemented\");\n\t}\n}\n"]}
@@ -36,4 +36,4 @@ export declare class SharedSummaryBlockFactory implements IChannelFactory {
36
36
  */
37
37
  create(runtime: IFluidDataStoreRuntime, id: string): ISharedObject;
38
38
  }
39
- //# sourceMappingURL=sharedSummaryBlockFactory.d.ts.map
39
+ //# sourceMappingURL=sharedSummaryBlockFactory.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sharedSummaryBlockFactory.d.mts","sourceRoot":"","sources":["../src/sharedSummaryBlockFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EACN,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EACf,MAAM,uCAAuC;OACvC,EAAE,aAAa,EAAE,MAAM,oCAAoC;AAIlE;;;;;GAKG;AACH,qBAAa,yBAA0B,YAAW,eAAe;IAChE;;OAEG;IACH,gBAAuB,IAAI,4DAA4D;IAEvF;;OAEG;IACH,gBAAuB,UAAU,EAAE,kBAAkB,CAInD;IAEF;;OAEG;IACH,IAAW,IAAI,WAEd;IAED;;OAEG;IACH,IAAW,UAAU,uBAEpB;IAED;;OAEG;IACU,IAAI,CAChB,OAAO,EAAE,sBAAsB,EAC/B,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,gBAAgB,EAC1B,UAAU,EAAE,kBAAkB,GAC5B,OAAO,CAAC,aAAa,CAAC;IAOzB;;OAEG;IACI,MAAM,CAAC,OAAO,EAAE,sBAAsB,EAAE,EAAE,EAAE,MAAM,GAAG,aAAa;CAUzE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/shared-summary-block",
3
- "version": "2.0.0-internal.8.0.1",
3
+ "version": "2.0.0-rc.1.0.0",
4
4
  "description": "A DDS that does not generate ops but is part of summary",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -11,20 +11,72 @@
11
11
  "license": "MIT",
12
12
  "author": "Microsoft and contributors",
13
13
  "sideEffects": false,
14
- "main": "dist/index.cjs",
14
+ "exports": {
15
+ ".": {
16
+ "import": {
17
+ "types": "./lib/index.d.mts",
18
+ "default": "./lib/index.mjs"
19
+ },
20
+ "require": {
21
+ "types": "./dist/index.d.ts",
22
+ "default": "./dist/index.js"
23
+ }
24
+ },
25
+ "./alpha": {
26
+ "import": {
27
+ "types": "./lib/shared-summary-block-alpha.d.mts",
28
+ "default": "./lib/index.mjs"
29
+ },
30
+ "require": {
31
+ "types": "./dist/shared-summary-block-alpha.d.ts",
32
+ "default": "./dist/index.js"
33
+ }
34
+ },
35
+ "./beta": {
36
+ "import": {
37
+ "types": "./lib/shared-summary-block-beta.d.mts",
38
+ "default": "./lib/index.mjs"
39
+ },
40
+ "require": {
41
+ "types": "./dist/shared-summary-block-beta.d.ts",
42
+ "default": "./dist/index.js"
43
+ }
44
+ },
45
+ "./internal": {
46
+ "import": {
47
+ "types": "./lib/index.d.mts",
48
+ "default": "./lib/index.mjs"
49
+ },
50
+ "require": {
51
+ "types": "./dist/index.d.ts",
52
+ "default": "./dist/index.js"
53
+ }
54
+ },
55
+ "./public": {
56
+ "import": {
57
+ "types": "./lib/shared-summary-block-public.d.mts",
58
+ "default": "./lib/index.mjs"
59
+ },
60
+ "require": {
61
+ "types": "./dist/shared-summary-block-public.d.ts",
62
+ "default": "./dist/index.js"
63
+ }
64
+ }
65
+ },
66
+ "main": "dist/index.js",
15
67
  "module": "lib/index.mjs",
16
68
  "types": "dist/index.d.ts",
17
69
  "c8": {
18
70
  "all": true,
19
71
  "cache-dir": "nyc/.cache",
20
72
  "exclude": [
21
- "src/test/**/*.ts",
22
- "dist/test/**/*.js"
73
+ "src/test/**/*.*ts",
74
+ "dist/test/**/*.*js"
23
75
  ],
24
76
  "exclude-after-remap": false,
25
77
  "include": [
26
- "src/**/*.ts",
27
- "dist/**/*.js"
78
+ "src/**/*.*ts",
79
+ "dist/**/*.*js"
28
80
  ],
29
81
  "report-dir": "nyc/report",
30
82
  "reporter": [
@@ -35,28 +87,28 @@
35
87
  "temp-directory": "nyc/.nyc_output"
36
88
  },
37
89
  "dependencies": {
38
- "@fluidframework/core-interfaces": ">=2.0.0-internal.8.0.1 <2.0.0-internal.8.1.0",
39
- "@fluidframework/datastore-definitions": ">=2.0.0-internal.8.0.1 <2.0.0-internal.8.1.0",
40
- "@fluidframework/driver-utils": ">=2.0.0-internal.8.0.1 <2.0.0-internal.8.1.0",
41
- "@fluidframework/protocol-definitions": "^3.0.0",
42
- "@fluidframework/runtime-definitions": ">=2.0.0-internal.8.0.1 <2.0.0-internal.8.1.0",
43
- "@fluidframework/shared-object-base": ">=2.0.0-internal.8.0.1 <2.0.0-internal.8.1.0"
90
+ "@fluidframework/core-interfaces": ">=2.0.0-rc.1.0.0 <2.0.0-rc.1.1.0",
91
+ "@fluidframework/datastore-definitions": ">=2.0.0-rc.1.0.0 <2.0.0-rc.1.1.0",
92
+ "@fluidframework/driver-utils": ">=2.0.0-rc.1.0.0 <2.0.0-rc.1.1.0",
93
+ "@fluidframework/protocol-definitions": "^3.1.0",
94
+ "@fluidframework/runtime-definitions": ">=2.0.0-rc.1.0.0 <2.0.0-rc.1.1.0",
95
+ "@fluidframework/shared-object-base": ">=2.0.0-rc.1.0.0 <2.0.0-rc.1.1.0"
44
96
  },
45
97
  "devDependencies": {
46
98
  "@arethetypeswrong/cli": "^0.13.3",
47
- "@fluid-tools/build-cli": "^0.28.0",
99
+ "@fluid-tools/build-cli": "^0.29.0",
48
100
  "@fluidframework/build-common": "^2.0.3",
49
- "@fluidframework/build-tools": "^0.28.0",
50
- "@fluidframework/eslint-config-fluid": "^3.1.0",
51
- "@fluidframework/mocha-test-setup": ">=2.0.0-internal.8.0.1 <2.0.0-internal.8.1.0",
52
- "@fluidframework/shared-summary-block-previous": "npm:@fluidframework/shared-summary-block@2.0.0-internal.7.2.0",
53
- "@fluidframework/test-runtime-utils": ">=2.0.0-internal.8.0.1 <2.0.0-internal.8.1.0",
101
+ "@fluidframework/build-tools": "^0.29.0",
102
+ "@fluidframework/eslint-config-fluid": "^3.2.0",
103
+ "@fluidframework/mocha-test-setup": ">=2.0.0-rc.1.0.0 <2.0.0-rc.1.1.0",
104
+ "@fluidframework/shared-summary-block-previous": "npm:@fluidframework/shared-summary-block@2.0.0-internal.8.0.0",
105
+ "@fluidframework/test-runtime-utils": ">=2.0.0-rc.1.0.0 <2.0.0-rc.1.1.0",
54
106
  "@microsoft/api-extractor": "^7.38.3",
55
107
  "@types/benchmark": "^2.1.0",
56
108
  "@types/mocha": "^9.1.1",
57
109
  "@types/node": "^18.19.0",
58
110
  "benchmark": "^2.1.4",
59
- "c8": "^7.7.1",
111
+ "c8": "^8.0.1",
60
112
  "copyfiles": "^2.4.1",
61
113
  "cross-env": "^7.0.3",
62
114
  "eslint": "~8.50.0",
@@ -65,6 +117,7 @@
65
117
  "mocha-multi-reporters": "^1.5.1",
66
118
  "moment": "^2.21.0",
67
119
  "prettier": "~3.0.3",
120
+ "replace-in-file": "^6.3.5",
68
121
  "rimraf": "^4.4.0",
69
122
  "tsc-multi": "^1.1.0",
70
123
  "typescript": "~5.1.6"
@@ -87,7 +140,7 @@
87
140
  "scripts": {
88
141
  "api": "fluid-build . --task api",
89
142
  "api-extractor:commonjs": "api-extractor run --local",
90
- "api-extractor:esnext": "copyfiles -u 1 \"dist/**/*-@(alpha|beta|public|untrimmed).d.ts\" lib",
143
+ "api-extractor:esnext": "api-extractor run --config ./api-extractor-esm.json",
91
144
  "build": "fluid-build . --task build",
92
145
  "build:commonjs": "fluid-build . --task commonjs",
93
146
  "build:compile": "fluid-build . --task compile",
@@ -95,8 +148,8 @@
95
148
  "build:docs": "fluid-build . --task api",
96
149
  "build:esnext": "tsc-multi --config ../../../common/build/build-common/tsc-multi.esm.json",
97
150
  "build:genver": "gen-version",
98
- "build:test": "tsc-multi --config ./tsc-multi.test.json",
99
- "check:are-the-types-wrong": "attw --pack",
151
+ "build:test": "tsc --project ./src/test/tsconfig.json",
152
+ "check:are-the-types-wrong": "attw --pack . --entrypoints .",
100
153
  "check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
101
154
  "ci:build:docs": "api-extractor run",
102
155
  "clean": "rimraf --glob dist lib \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc",
@@ -111,7 +164,7 @@
111
164
  "test:coverage": "c8 npm test",
112
165
  "test:mocha": "mocha --ignore \"dist/test/types/*\" --recursive dist/test -r node_modules/@fluidframework/mocha-test-setup",
113
166
  "test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha",
114
- "tsc": "tsc-multi --config ../../../common/build/build-common/tsc-multi.cjs.json",
167
+ "tsc": "tsc",
115
168
  "typetests:gen": "fluid-type-test-generator",
116
169
  "typetests:prepare": "flub typetests --dir . --reset --previous --normalize"
117
170
  }
package/src/interfaces.ts CHANGED
@@ -11,7 +11,7 @@ import { ISharedObject } from "@fluidframework/shared-object-base";
11
11
  * The set on this interface must only be called in response to a remote op. Basically, if we replay same ops,
12
12
  * the set of calls on this interface to set data should be the same. This is critical because the object does not
13
13
  * generate ops of its own, but relies on the above principle to maintain eventual consistency and to summarize.
14
- * @internal
14
+ * @alpha
15
15
  */
16
16
  export interface ISharedSummaryBlock extends ISharedObject {
17
17
  /**
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/shared-summary-block";
9
- export const pkgVersion = "2.0.0-internal.8.0.1";
9
+ export const pkgVersion = "2.0.0-rc.1.0.0";
@@ -34,7 +34,7 @@ interface ISharedSummaryBlockDataSerializable {
34
34
  /**
35
35
  * Implementation of a shared summary block. It does not generate any ops. It is only part of the summary.
36
36
  * Data should be set in this object in response to a remote op.
37
- * @internal
37
+ * @alpha
38
38
  */
39
39
  export class SharedSummaryBlock extends SharedObject implements ISharedSummaryBlock {
40
40
  /**
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,+DAA0D;AAAjD,wHAAA,kBAAkB,OAAA;AAC3B,6EAAwE;AAA/D,sIAAA,yBAAyB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { ISharedSummaryBlock } from \"./interfaces\";\nexport { SharedSummaryBlock } from \"./sharedSummaryBlock\";\nexport { SharedSummaryBlockFactory } from \"./sharedSummaryBlockFactory\";\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"interfaces.cjs","sourceRoot":"","sources":["../src/interfaces.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 { Jsonable } from \"@fluidframework/datastore-definitions\";\nimport { ISharedObject } from \"@fluidframework/shared-object-base\";\n\n/**\n * Shared summary block interface. A shared summary block is part of the summary but it does not generate any ops.\n * The set on this interface must only be called in response to a remote op. Basically, if we replay same ops,\n * the set of calls on this interface to set data should be the same. This is critical because the object does not\n * generate ops of its own, but relies on the above principle to maintain eventual consistency and to summarize.\n * @internal\n */\nexport interface ISharedSummaryBlock extends ISharedObject {\n\t/**\n\t * Retrieves the given key from the map.\n\t * @param key - Key to retrieve from.\n\t * @returns The stored value, or undefined if the key is not set.\n\t *\n\t * @privateRemarks\n\t * The return type is underspecified to allow for the possibility of objects with function or undefined values.\n\t */\n\tget<T>(key: string): Jsonable<T>;\n\n\t/**\n\t * Sets the value stored at key to the provided value.\n\t * @param key - Key to set at.\n\t * @param value - Jsonable type value to set.\n\t */\n\tset<T>(key: string, value: Jsonable<T>): void;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"packageVersion.cjs","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,sCAAsC,CAAC;AACjD,QAAA,UAAU,GAAG,sBAAsB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/shared-summary-block\";\nexport const pkgVersion = \"2.0.0-internal.8.0.1\";\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"sharedSummaryBlock.cjs","sourceRoot":"","sources":["../src/sharedSummaryBlock.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAWH,+DAA4D;AAC5D,2EAI4C;AAC5C,+EAAwE;AAGxE,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AAUlC;;;;GAIG;AACH,MAAa,kBAAmB,SAAQ,iCAAY;IACnD;;;;;;OAMG;IACI,MAAM,CAAC,MAAM,CAAC,OAA+B,EAAE,EAAW;QAChE,OAAO,OAAO,CAAC,aAAa,CAAC,EAAE,EAAE,qDAAyB,CAAC,IAAI,CAAuB,CAAC;IACxF,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,UAAU;QACvB,OAAO,IAAI,qDAAyB,EAAE,CAAC;IACxC,CAAC;IAOD;;;;;;;OAOG;IACH,YAAY,EAAU,EAAE,OAA+B,EAAE,UAA8B;QACtF,KAAK,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,2BAA2B,CAAC,CAAC;QAd7D;;WAEG;QACc,SAAI,GAAG,IAAI,GAAG,EAA6B,CAAC;IAY7D,CAAC;IAED;;OAEG;IACI,GAAG,CAAI,GAAW;QACxB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAgB,CAAC;IAC1C,CAAC;IAED;;OAEG;IACI,GAAG,CAAI,GAAW,EAAE,KAAkB;QAC5C,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC1B,mEAAmE;QACnE,IAAI,CAAC,KAAK,EAAE,CAAC;IACd,CAAC;IAED;;OAEG;IACO,aAAa,CAAC,UAA4B;QACnD,MAAM,YAAY,GAAwC,EAAE,CAAC;QAC7D,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;YAChC,YAAY,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QAC3B,CAAC,CAAC,CAAC;QACH,OAAO,IAAA,4CAAuB,EAAC,gBAAgB,EAAE,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC;IAChF,CAAC;IAED;;OAEG;IACO,KAAK,CAAC,QAAQ,CAAC,OAA+B;QACvD,MAAM,QAAQ,GAAG,MAAM,IAAA,2BAAY,EAClC,OAAO,EACP,gBAAgB,CAChB,CAAC;QACF,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YACpD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;SAC1B;IACF,CAAC;IAED;;OAEG;IACO,YAAY,KAAI,CAAC;IAE3B;;OAEG;IACO,WAAW,CAAC,OAAkC,EAAE,KAAc;QACvE,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACtE,CAAC;IAES,cAAc;QACvB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACpC,CAAC;CACD;AA7FD,gDA6FC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ISequencedDocumentMessage } from \"@fluidframework/protocol-definitions\";\nimport {\n\tIChannelAttributes,\n\tIFluidDataStoreRuntime,\n\tIChannelStorageService,\n\tJsonable,\n\tIChannelFactory,\n} from \"@fluidframework/datastore-definitions\";\nimport { ISummaryTreeWithStats } from \"@fluidframework/runtime-definitions\";\nimport { readAndParse } from \"@fluidframework/driver-utils\";\nimport {\n\tcreateSingleBlobSummary,\n\tIFluidSerializer,\n\tSharedObject,\n} from \"@fluidframework/shared-object-base\";\nimport { SharedSummaryBlockFactory } from \"./sharedSummaryBlockFactory\";\nimport { ISharedSummaryBlock } from \"./interfaces\";\n\nconst snapshotFileName = \"header\";\n\n/**\n * Defines the in-memory object structure to be used for the conversion to/from serialized.\n * Directly used in JSON.stringify, direct result from JSON.parse.\n */\ninterface ISharedSummaryBlockDataSerializable {\n\t[key: string]: Jsonable<unknown>;\n}\n\n/**\n * Implementation of a shared summary block. It does not generate any ops. It is only part of the summary.\n * Data should be set in this object in response to a remote op.\n * @internal\n */\nexport class SharedSummaryBlock extends SharedObject implements ISharedSummaryBlock {\n\t/**\n\t * Create a new shared summary block\n\t *\n\t * @param runtime - data store runtime the new shared summary block belongs to.\n\t * @param id - optional name of the shared summary block.\n\t * @returns newly created shared summary block (but not attached yet).\n\t */\n\tpublic static create(runtime: IFluidDataStoreRuntime, id?: string) {\n\t\treturn runtime.createChannel(id, SharedSummaryBlockFactory.Type) as SharedSummaryBlock;\n\t}\n\n\t/**\n\t * Get a factory for SharedSummaryBlock to register with the data store.\n\t *\n\t * @returns a factory that creates and loads SharedSummaryBlock.\n\t */\n\tpublic static getFactory(): IChannelFactory {\n\t\treturn new SharedSummaryBlockFactory();\n\t}\n\n\t/**\n\t * The data held by this object.\n\t */\n\tprivate readonly data = new Map<string, Jsonable<unknown>>();\n\n\t/**\n\t * Constructs a new SharedSummaryBlock. If the object is non-local, an id and service interfaces will\n\t * be provided.\n\t *\n\t * @param id - optional name of the shared summary block.\n\t * @param runtime - data store runtime thee object belongs to.\n\t * @param attributes - The attributes for the object.\n\t */\n\tconstructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes) {\n\t\tsuper(id, runtime, attributes, \"fluid_sharedSummaryBlock_\");\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedSummaryBlock.get}\n\t */\n\tpublic get<T>(key: string): Jsonable<T> {\n\t\treturn this.data.get(key) as Jsonable<T>;\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedSummaryBlock.set}\n\t */\n\tpublic set<T>(key: string, value: Jsonable<T>): void {\n\t\tthis.data.set(key, value);\n\t\t// Set this object as dirty so that it is part of the next summary.\n\t\tthis.dirty();\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}\n\t */\n\tprotected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats {\n\t\tconst contentsBlob: ISharedSummaryBlockDataSerializable = {};\n\t\tthis.data.forEach((value, key) => {\n\t\t\tcontentsBlob[key] = value;\n\t\t});\n\t\treturn createSingleBlobSummary(snapshotFileName, JSON.stringify(contentsBlob));\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}\n\t */\n\tprotected async loadCore(storage: IChannelStorageService): Promise<void> {\n\t\tconst contents = await readAndParse<ISharedSummaryBlockDataSerializable>(\n\t\t\tstorage,\n\t\t\tsnapshotFileName,\n\t\t);\n\t\tfor (const [key, value] of Object.entries(contents)) {\n\t\t\tthis.data.set(key, value);\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}\n\t */\n\tprotected onDisconnect() {}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}\n\t */\n\tprotected processCore(message: ISequencedDocumentMessage, local: boolean) {\n\t\tthrow new Error(\"shared summary block should not generate any ops.\");\n\t}\n\n\tprotected applyStashedOp() {\n\t\tthrow new Error(\"not implemented\");\n\t}\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"sharedSummaryBlockFactory.cjs","sourceRoot":"","sources":["../src/sharedSummaryBlockFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AASH,yDAA8C;AAC9C,iEAA0D;AAE1D;;;;;GAKG;AACH,MAAa,yBAAyB;IAerC;;OAEG;IACH,IAAW,IAAI;QACd,OAAO,yBAAyB,CAAC,IAAI,CAAC;IACvC,CAAC;IAED;;OAEG;IACH,IAAW,UAAU;QACpB,OAAO,yBAAyB,CAAC,UAAU,CAAC;IAC7C,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,IAAI,CAChB,OAA+B,EAC/B,EAAU,EACV,QAA0B,EAC1B,UAA8B;QAE9B,MAAM,kBAAkB,GAAG,IAAI,uCAAkB,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QAC3E,MAAM,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAExC,OAAO,kBAAkB,CAAC;IAC3B,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,OAA+B,EAAE,EAAU;QACxD,MAAM,kBAAkB,GAAG,IAAI,uCAAkB,CAChD,EAAE,EACF,OAAO,EACP,yBAAyB,CAAC,UAAU,CACpC,CAAC;QACF,kBAAkB,CAAC,eAAe,EAAE,CAAC;QAErC,OAAO,kBAAkB,CAAC;IAC3B,CAAC;;AAxDF,8DAyDC;AAxDA;;GAEG;AACoB,8BAAI,GAAG,wDAAwD,CAAC;AAEvF;;GAEG;AACoB,oCAAU,GAAuB;IACvD,IAAI,EAAE,yBAAyB,CAAC,IAAI;IACpC,qBAAqB,EAAE,KAAK;IAC5B,cAAc,EAAE,2BAAU;CAC1B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIChannelAttributes,\n\tIFluidDataStoreRuntime,\n\tIChannelServices,\n\tIChannelFactory,\n} from \"@fluidframework/datastore-definitions\";\nimport { ISharedObject } from \"@fluidframework/shared-object-base\";\nimport { pkgVersion } from \"./packageVersion\";\nimport { SharedSummaryBlock } from \"./sharedSummaryBlock\";\n\n/**\n * The factory that defines the shared summary block.\n *\n * @sealed\n * @internal\n */\nexport class SharedSummaryBlockFactory implements IChannelFactory {\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.\"type\"}\n\t */\n\tpublic static readonly Type = \"https://graph.microsoft.com/types/shared-summary-block\";\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}\n\t */\n\tpublic static readonly Attributes: IChannelAttributes = {\n\t\ttype: SharedSummaryBlockFactory.Type,\n\t\tsnapshotFormatVersion: \"0.1\",\n\t\tpackageVersion: pkgVersion,\n\t};\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.\"type\"}\n\t */\n\tpublic get type() {\n\t\treturn SharedSummaryBlockFactory.Type;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}\n\t */\n\tpublic get attributes() {\n\t\treturn SharedSummaryBlockFactory.Attributes;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}\n\t */\n\tpublic async load(\n\t\truntime: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\tservices: IChannelServices,\n\t\tattributes: IChannelAttributes,\n\t): Promise<ISharedObject> {\n\t\tconst sharedSummaryBlock = new SharedSummaryBlock(id, runtime, attributes);\n\t\tawait sharedSummaryBlock.load(services);\n\n\t\treturn sharedSummaryBlock;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.create}\n\t */\n\tpublic create(runtime: IFluidDataStoreRuntime, id: string): ISharedObject {\n\t\tconst sharedSummaryBlock = new SharedSummaryBlock(\n\t\t\tid,\n\t\t\truntime,\n\t\t\tSharedSummaryBlockFactory.Attributes,\n\t\t);\n\t\tsharedSummaryBlock.initializeLocal();\n\n\t\treturn sharedSummaryBlock;\n\t}\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,mBAAmB,EAAE;OACvB,EAAE,kBAAkB,EAAE;OACtB,EAAE,yBAAyB,EAAE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,QAAQ,EAAE,MAAM,uCAAuC;OACzD,EAAE,aAAa,EAAE,MAAM,oCAAoC;AAElE;;;;;;GAMG;AACH,MAAM,WAAW,mBAAoB,SAAQ,aAAa;IACzD;;;;;;;OAOG;IACH,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAEjC;;;;OAIG;IACH,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;CAC9C"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,yCAAyC,CAAC;AAC9D,eAAO,MAAM,UAAU,yBAAyB,CAAC"}
@@ -1,39 +0,0 @@
1
- import { IChannelAttributes } from '@fluidframework/datastore-definitions';
2
- import { IChannelFactory } from '@fluidframework/datastore-definitions';
3
- import { IChannelServices } from '@fluidframework/datastore-definitions';
4
- import { IChannelStorageService } from '@fluidframework/datastore-definitions';
5
- import { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions';
6
- import { IFluidSerializer } from '@fluidframework/shared-object-base';
7
- import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
8
- import { ISharedObject } from '@fluidframework/shared-object-base';
9
- import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
10
- import { Jsonable } from '@fluidframework/datastore-definitions';
11
- import { SharedObject } from '@fluidframework/shared-object-base';
12
-
13
- /* Excluded from this release type: IChannelAttributes */
14
-
15
- /* Excluded from this release type: IChannelFactory */
16
-
17
- /* Excluded from this release type: IChannelServices */
18
-
19
- /* Excluded from this release type: IChannelStorageService */
20
-
21
- /* Excluded from this release type: IFluidDataStoreRuntime */
22
-
23
- /* Excluded from this release type: IFluidSerializer */
24
-
25
- /* Excluded from this release type: ISharedObject */
26
-
27
- /* Excluded from this release type: ISharedSummaryBlock */
28
-
29
- /* Excluded from this release type: ISummaryTreeWithStats */
30
-
31
- /* Excluded from this release type: Jsonable */
32
-
33
- /* Excluded from this release type: SharedObject */
34
-
35
- /* Excluded from this release type: SharedSummaryBlock */
36
-
37
- /* Excluded from this release type: SharedSummaryBlockFactory */
38
-
39
- export { }
@@ -1 +0,0 @@
1
- {"version":3,"file":"sharedSummaryBlock.d.ts","sourceRoot":"","sources":["../src/sharedSummaryBlock.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,yBAAyB,EAAE,MAAM,sCAAsC;OACzE,EACN,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,QAAQ,EACR,eAAe,EACf,MAAM,uCAAuC;OACvC,EAAE,qBAAqB,EAAE,MAAM,qCAAqC;OAEpE,EAEN,gBAAgB,EAChB,YAAY,EACZ,MAAM,oCAAoC;OAEpC,EAAE,mBAAmB,EAAE;AAY9B;;;;GAIG;AACH,qBAAa,kBAAmB,SAAQ,YAAa,YAAW,mBAAmB;IAClF;;;;;;OAMG;WACW,MAAM,CAAC,OAAO,EAAE,sBAAsB,EAAE,EAAE,CAAC,EAAE,MAAM;IAIjE;;;;OAIG;WACW,UAAU,IAAI,eAAe;IAI3C;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAwC;IAE7D;;;;;;;OAOG;gBACS,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,sBAAsB,EAAE,UAAU,EAAE,kBAAkB;IAIvF;;OAEG;IACI,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC;IAIvC;;OAEG;IACI,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI;IAMpD;;OAEG;IACH,SAAS,CAAC,aAAa,CAAC,UAAU,EAAE,gBAAgB,GAAG,qBAAqB;IAQ5E;;OAEG;cACa,QAAQ,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;IAUxE;;OAEG;IACH,SAAS,CAAC,YAAY;IAEtB;;OAEG;IACH,SAAS,CAAC,WAAW,CAAC,OAAO,EAAE,yBAAyB,EAAE,KAAK,EAAE,OAAO;IAIxE,SAAS,CAAC,cAAc;CAGxB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"sharedSummaryBlockFactory.d.ts","sourceRoot":"","sources":["../src/sharedSummaryBlockFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EACN,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EACf,MAAM,uCAAuC;OACvC,EAAE,aAAa,EAAE,MAAM,oCAAoC;AAIlE;;;;;GAKG;AACH,qBAAa,yBAA0B,YAAW,eAAe;IAChE;;OAEG;IACH,gBAAuB,IAAI,4DAA4D;IAEvF;;OAEG;IACH,gBAAuB,UAAU,EAAE,kBAAkB,CAInD;IAEF;;OAEG;IACH,IAAW,IAAI,WAEd;IAED;;OAEG;IACH,IAAW,UAAU,uBAEpB;IAED;;OAEG;IACU,IAAI,CAChB,OAAO,EAAE,sBAAsB,EAC/B,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,gBAAgB,EAC1B,UAAU,EAAE,kBAAkB,GAC5B,OAAO,CAAC,aAAa,CAAC;IAOzB;;OAEG;IACI,MAAM,CAAC,OAAO,EAAE,sBAAsB,EAAE,EAAE,EAAE,MAAM,GAAG,aAAa;CAUzE"}
@@ -1,4 +0,0 @@
1
- {
2
- "targets": [{ "extname": ".cjs", "module": "CommonJS", "moduleResolution": "Node10" }],
3
- "projects": ["./tsconfig.json", "./src/test/tsconfig.json"]
4
- }