@fluidframework/shared-summary-block 2.0.0-internal.7.4.0 → 2.0.0-internal.8.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # @fluidframework/shared-summary-block
2
2
 
3
+ ## 2.0.0-internal.8.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - datastore-definitions: Jsonable and Serializable now require a generic parameter [9a451d4946](https://github.com/microsoft/FluidFramework/commits/9a451d4946b5c51a52e4d1ab5bf51e7b285b0d74)
8
+
9
+ The `Jsonable` and `Serializable` types from @fluidframework/datastore-definitions now require a generic parameter and
10
+ if that type is `any` or `unknown`will return a new result `JsonableTypeWith<>` that more accurately represents the
11
+ limitation of serialization.
12
+
13
+ Additional modifications:
14
+
15
+ - `Jsonable`'s `TReplacement` parameter default has also been changed from `void` to `never`, which now disallows
16
+ `void`.
17
+ - Unrecognized primitive types like `symbol` are now filtered to `never` instead of `{}`.
18
+ - Recursive types with arrays (`[]`) are now supported.
19
+
20
+ `Serializable` is commonly used for DDS values and now requires more precision when using them. For example SharedMatrix
21
+ (unqualified) has an `any` default that meant values were `Serializable<any>` (i.e. `any`), but now `Serializable<any>`
22
+ is `JsonableTypeWith<IFluidHandle>` which may be problematic for reading or writing. Preferred correction is to specify
23
+ the value type but casting through `any` may provide a quick fix.
24
+
3
25
  ## 2.0.0-internal.7.4.0
4
26
 
5
27
  Dependency updates only.
@@ -1 +1 @@
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\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.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"]}
@@ -16,6 +16,9 @@ export interface ISharedSummaryBlock extends ISharedObject {
16
16
  * Retrieves the given key from the map.
17
17
  * @param key - Key to retrieve from.
18
18
  * @returns The stored value, or undefined if the key is not set.
19
+ *
20
+ * @privateRemarks
21
+ * The return type is underspecified to allow for the possibility of objects with function or undefined values.
19
22
  */
20
23
  get<T>(key: string): Jsonable<T>;
21
24
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAEnE;;;;;;GAMG;AACH,MAAM,WAAW,mBAAoB,SAAQ,aAAa;IACzD;;;;OAIG;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
+ {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAEnE;;;;;;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"}
@@ -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.7.4.0";
11
+ exports.pkgVersion = "2.0.0-internal.8.0.0";
12
12
  //# sourceMappingURL=packageVersion.cjs.map
@@ -1 +1 @@
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.7.4.0\";\n"]}
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.0\";\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.7.4.0";
8
+ export declare const pkgVersion = "2.0.0-internal.8.0.0";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -22,6 +22,9 @@ export declare interface ISharedSummaryBlock extends ISharedObject {
22
22
  * Retrieves the given key from the map.
23
23
  * @param key - Key to retrieve from.
24
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.
25
28
  */
26
29
  get<T>(key: string): Jsonable<T>;
27
30
  /**
@@ -1 +1 @@
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,EAAoB,CAAC;IAYpD,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;\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>();\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.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;I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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 +1 @@
1
- {"version":3,"file":"sharedSummaryBlock.d.ts","sourceRoot":"","sources":["../src/sharedSummaryBlock.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EACN,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,QAAQ,EACR,eAAe,EACf,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAE5E,OAAO,EAEN,gBAAgB,EAChB,YAAY,EACZ,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAYnD;;;;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,CAA+B;IAEpD;;;;;;;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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,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"}
@@ -16,6 +16,9 @@ export interface ISharedSummaryBlock extends ISharedObject {
16
16
  * Retrieves the given key from the map.
17
17
  * @param key - Key to retrieve from.
18
18
  * @returns The stored value, or undefined if the key is not set.
19
+ *
20
+ * @privateRemarks
21
+ * The return type is underspecified to allow for the possibility of objects with function or undefined values.
19
22
  */
20
23
  get<T>(key: string): Jsonable<T>;
21
24
  /**
@@ -1 +1 @@
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;;;;OAIG;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
+ {"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 +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\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 * @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"]}
@@ -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.7.4.0";
8
+ export declare const pkgVersion = "2.0.0-internal.8.0.0";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -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.7.4.0";
8
+ export const pkgVersion = "2.0.0-internal.8.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.7.4.0\";\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,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.0\";\n"]}
@@ -22,6 +22,9 @@ export declare interface ISharedSummaryBlock extends ISharedObject {
22
22
  * Retrieves the given key from the map.
23
23
  * @param key - Key to retrieve from.
24
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.
25
28
  */
26
29
  get<T>(key: string): Jsonable<T>;
27
30
  /**
@@ -1 +1 @@
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;OAE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AAE,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;\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>();\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 * @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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/shared-summary-block",
3
- "version": "2.0.0-internal.7.4.0",
3
+ "version": "2.0.0-internal.8.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": {
@@ -35,12 +35,12 @@
35
35
  "temp-directory": "nyc/.nyc_output"
36
36
  },
37
37
  "dependencies": {
38
- "@fluidframework/core-interfaces": ">=2.0.0-internal.7.4.0 <2.0.0-internal.7.5.0",
39
- "@fluidframework/datastore-definitions": ">=2.0.0-internal.7.4.0 <2.0.0-internal.7.5.0",
40
- "@fluidframework/driver-utils": ">=2.0.0-internal.7.4.0 <2.0.0-internal.7.5.0",
38
+ "@fluidframework/core-interfaces": ">=2.0.0-internal.8.0.0 <2.0.0-internal.8.1.0",
39
+ "@fluidframework/datastore-definitions": ">=2.0.0-internal.8.0.0 <2.0.0-internal.8.1.0",
40
+ "@fluidframework/driver-utils": ">=2.0.0-internal.8.0.0 <2.0.0-internal.8.1.0",
41
41
  "@fluidframework/protocol-definitions": "^3.0.0",
42
- "@fluidframework/runtime-definitions": ">=2.0.0-internal.7.4.0 <2.0.0-internal.7.5.0",
43
- "@fluidframework/shared-object-base": ">=2.0.0-internal.7.4.0 <2.0.0-internal.7.5.0"
42
+ "@fluidframework/runtime-definitions": ">=2.0.0-internal.8.0.0 <2.0.0-internal.8.1.0",
43
+ "@fluidframework/shared-object-base": ">=2.0.0-internal.8.0.0 <2.0.0-internal.8.1.0"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@arethetypeswrong/cli": "^0.13.3",
@@ -48,9 +48,9 @@
48
48
  "@fluidframework/build-common": "^2.0.3",
49
49
  "@fluidframework/build-tools": "^0.28.0",
50
50
  "@fluidframework/eslint-config-fluid": "^3.1.0",
51
- "@fluidframework/mocha-test-setup": ">=2.0.0-internal.7.4.0 <2.0.0-internal.7.5.0",
51
+ "@fluidframework/mocha-test-setup": ">=2.0.0-internal.8.0.0 <2.0.0-internal.8.1.0",
52
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.7.4.0 <2.0.0-internal.7.5.0",
53
+ "@fluidframework/test-runtime-utils": ">=2.0.0-internal.8.0.0 <2.0.0-internal.8.1.0",
54
54
  "@microsoft/api-extractor": "^7.38.3",
55
55
  "@types/benchmark": "^2.1.0",
56
56
  "@types/mocha": "^9.1.1",
package/src/interfaces.ts CHANGED
@@ -18,6 +18,9 @@ export interface ISharedSummaryBlock extends ISharedObject {
18
18
  * Retrieves the given key from the map.
19
19
  * @param key - Key to retrieve from.
20
20
  * @returns The stored value, or undefined if the key is not set.
21
+ *
22
+ * @privateRemarks
23
+ * The return type is underspecified to allow for the possibility of objects with function or undefined values.
21
24
  */
22
25
  get<T>(key: string): Jsonable<T>;
23
26
 
@@ -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.7.4.0";
9
+ export const pkgVersion = "2.0.0-internal.8.0.0";
@@ -28,7 +28,7 @@ const snapshotFileName = "header";
28
28
  * Directly used in JSON.stringify, direct result from JSON.parse.
29
29
  */
30
30
  interface ISharedSummaryBlockDataSerializable {
31
- [key: string]: Jsonable;
31
+ [key: string]: Jsonable<unknown>;
32
32
  }
33
33
 
34
34
  /**
@@ -60,7 +60,7 @@ export class SharedSummaryBlock extends SharedObject implements ISharedSummaryBl
60
60
  /**
61
61
  * The data held by this object.
62
62
  */
63
- private readonly data = new Map<string, Jsonable>();
63
+ private readonly data = new Map<string, Jsonable<unknown>>();
64
64
 
65
65
  /**
66
66
  * Constructs a new SharedSummaryBlock. If the object is non-local, an id and service interfaces will