@fluidframework/shared-summary-block 2.0.0-internal.3.0.2 → 2.0.0-internal.3.2.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/.eslintrc.js CHANGED
@@ -4,11 +4,8 @@
4
4
  */
5
5
 
6
6
  module.exports = {
7
- "extends": [
8
- require.resolve("@fluidframework/eslint-config-fluid/minimal"),
9
- "prettier"
10
- ],
11
- "parserOptions": {
12
- "project": ["./tsconfig.json", "./src/test/tsconfig.json"]
13
- },
14
- }
7
+ extends: [require.resolve("@fluidframework/eslint-config-fluid/minimal"), "prettier"],
8
+ parserOptions: {
9
+ project: ["./tsconfig.json", "./src/test/tsconfig.json"],
10
+ },
11
+ };
package/.mocharc.js CHANGED
@@ -3,9 +3,9 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- 'use strict';
6
+ "use strict";
7
7
 
8
- const getFluidTestMochaConfig = require('@fluidframework/mocha-test-setup/mocharc-common');
8
+ const getFluidTestMochaConfig = require("@fluidframework/mocha-test-setup/mocharc-common");
9
9
 
10
10
  const packageDir = __dirname;
11
11
  const config = getFluidTestMochaConfig(packageDir);
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
1
  # @fluidframework/shared-summary-block
2
2
 
3
3
  SharedSummaryBlock is a DDS that does not generate ops but is part of the summary. The name block comes from the fact that the data in this object is shared across clients only via summary blocks.
4
- The data on this object must only be set in response to a remote op. Basically, if we replay same ops, the set of calls on this object to set data should be the same. This is critical because it does not generate ops of its own, but relies on the above principle to maintain eventual consistency and to summarize.
4
+ The data on this object must only be set in response to a remote op. Basically, if we replay same ops, the set of calls on this object to set data should be the same. This is critical because it does not generate ops of its own, but relies on the above principle to maintain eventual consistency and to summarize.
@@ -1,4 +1,4 @@
1
1
  {
2
- "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
- "extends": "@fluidframework/build-common/api-extractor-common-report.json"
2
+ "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
+ "extends": "@fluidframework/build-common/api-extractor-common-report.json"
4
4
  }
@@ -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;;;;;GAKG;AACH,MAAM,WAAW,mBAAoB,SAAQ,aAAa;IACtD;;;;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;CACjD"}
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;;;;;GAKG;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 +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 */\nexport interface ISharedSummaryBlock extends ISharedObject {\n /**\n * Retrieves the given key from the map.\n * @param key - Key to retrieve from.\n * @returns The stored value, or undefined if the key is not set.\n */\n get<T>(key: string): Jsonable<T>;\n\n /**\n * Sets the value stored at key to the provided value.\n * @param key - Key to set at.\n * @param value - Jsonable type value to set.\n */\n set<T>(key: string, value: Jsonable<T>): void;\n}\n"]}
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 */\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"]}
@@ -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.3.0.2";
8
+ export declare const pkgVersion = "2.0.0-internal.3.2.0";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -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.3.0.2";
11
+ exports.pkgVersion = "2.0.0-internal.3.2.0";
12
12
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +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,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.3.0.2\";\n"]}
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,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.3.2.0\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"sharedSummaryBlock.d.ts","sourceRoot":"","sources":["../src/sharedSummaryBlock.ts"],"names":[],"mappings":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7B,YAAY,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QAC9B,CAAC,CAAC,CAAC;QACH,OAAO,IAAA,4CAAuB,EAAC,gBAAgB,EAAE,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC;IACnF,CAAC;IAED;;OAEG;IACO,KAAK,CAAC,QAAQ,CAAC,OAA+B;QACpD,MAAM,QAAQ,GAAG,MAAM,IAAA,2BAAY,EAAsC,OAAO,EAAE,gBAAgB,CAAC,CAAC;QACpG,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YACjD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;SAC7B;IACL,CAAC;IAED;;OAEG;IACO,YAAY,KAAK,CAAC;IAE5B;;OAEG;IACO,WAAW,CAAC,OAAkC,EAAE,KAAc;QACpE,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACzE,CAAC;IAES,cAAc;QACpB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACvC,CAAC;CACJ;AA1FD,gDA0FC","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 IChannelAttributes,\n IFluidDataStoreRuntime,\n IChannelStorageService,\n Jsonable,\n IChannelFactory,\n} from \"@fluidframework/datastore-definitions\";\nimport { ISummaryTreeWithStats } from \"@fluidframework/runtime-definitions\";\nimport { readAndParse } from \"@fluidframework/driver-utils\";\nimport {\n createSingleBlobSummary,\n IFluidSerializer,\n SharedObject,\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 [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 */\nexport class SharedSummaryBlock extends SharedObject implements ISharedSummaryBlock {\n /**\n * Create a new shared summary block\n *\n * @param runtime - data store runtime the new shared summary block belongs to.\n * @param id - optional name of the shared summary block.\n * @returns newly created shared summary block (but not attached yet).\n */\n public static create(runtime: IFluidDataStoreRuntime, id?: string) {\n return runtime.createChannel(id, SharedSummaryBlockFactory.Type) as SharedSummaryBlock;\n }\n\n /**\n * Get a factory for SharedSummaryBlock to register with the data store.\n *\n * @returns a factory that creates and loads SharedSummaryBlock.\n */\n public static getFactory(): IChannelFactory {\n return new SharedSummaryBlockFactory();\n }\n\n /**\n * The data held by this object.\n */\n private readonly data = new Map<string, Jsonable>();\n\n /**\n * Constructs a new SharedSummaryBlock. If the object is non-local, an id and service interfaces will\n * be provided.\n *\n * @param id - optional name of the shared summary block.\n * @param runtime - data store runtime thee object belongs to.\n * @param attributes - The attributes for the object.\n */\n constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes) {\n super(id, runtime, attributes, \"fluid_sharedSummaryBlock_\");\n }\n\n /**\n * {@inheritDoc ISharedSummaryBlock.get}\n */\n public get<T>(key: string): Jsonable<T> {\n return this.data.get(key) as Jsonable<T>;\n }\n\n /**\n * {@inheritDoc ISharedSummaryBlock.set}\n */\n public set<T>(key: string, value: Jsonable<T>): void {\n this.data.set(key, value);\n // Set this object as dirty so that it is part of the next summary.\n this.dirty();\n }\n\n /**\n * {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}\n */\n protected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats {\n const contentsBlob: ISharedSummaryBlockDataSerializable = {};\n this.data.forEach((value, key) => {\n contentsBlob[key] = value;\n });\n return createSingleBlobSummary(snapshotFileName, JSON.stringify(contentsBlob));\n }\n\n /**\n * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}\n */\n protected async loadCore(storage: IChannelStorageService): Promise<void> {\n const contents = await readAndParse<ISharedSummaryBlockDataSerializable>(storage, snapshotFileName);\n for (const [key, value] of Object.entries(contents)) {\n this.data.set(key, value);\n }\n }\n\n /**\n * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}\n */\n protected onDisconnect() { }\n\n /**\n * {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}\n */\n protected processCore(message: ISequencedDocumentMessage, local: boolean) {\n throw new Error(\"shared summary block should not generate any ops.\");\n }\n\n protected applyStashedOp() {\n throw new Error(\"not implemented\");\n }\n}\n"]}
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;;;GAGG;AACH,MAAa,kBAAmB,SAAQ,iCAAY;IA0BnD;;;;;;;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;IAnCD;;;;;;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;IAmBD;;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 */\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 +1 @@
1
- {"version":3,"file":"sharedSummaryBlockFactory.d.ts","sourceRoot":"","sources":["../src/sharedSummaryBlockFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACH,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EAClB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACH,aAAa,EAChB,MAAM,oCAAoC,CAAC;AAI5C;;;GAGG;AACH,qBAAa,yBAA0B,YAAW,eAAe;IAC7D;;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,CACb,OAAO,EAAE,sBAAsB,EAC/B,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,gBAAgB,EAC1B,UAAU,EAAE,kBAAkB,GAAG,OAAO,CAAC,aAAa,CAAC;IAO3D;;OAEG;IACI,MAAM,CAAC,OAAO,EAAE,sBAAsB,EAAE,EAAE,EAAE,MAAM,GAAG,aAAa;CAM5E"}
1
+ {"version":3,"file":"sharedSummaryBlockFactory.d.ts","sourceRoot":"","sources":["../src/sharedSummaryBlockFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EACf,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAInE;;;GAGG;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,QA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ourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n IChannelAttributes,\n IFluidDataStoreRuntime,\n IChannelServices,\n IChannelFactory,\n} from \"@fluidframework/datastore-definitions\";\nimport {\n ISharedObject,\n} 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 * @sealed\n */\nexport class SharedSummaryBlockFactory implements IChannelFactory {\n /**\n * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.\"type\"}\n */\n public static readonly Type = \"https://graph.microsoft.com/types/shared-summary-block\";\n\n /**\n * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}\n */\n public static readonly Attributes: IChannelAttributes = {\n type: SharedSummaryBlockFactory.Type,\n snapshotFormatVersion: \"0.1\",\n packageVersion: pkgVersion,\n };\n\n /**\n * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.\"type\"}\n */\n public get type() {\n return SharedSummaryBlockFactory.Type;\n }\n\n /**\n * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}\n */\n public get attributes() {\n return SharedSummaryBlockFactory.Attributes;\n }\n\n /**\n * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}\n */\n public async load(\n runtime: IFluidDataStoreRuntime,\n id: string,\n services: IChannelServices,\n attributes: IChannelAttributes): Promise<ISharedObject> {\n const sharedSummaryBlock = new SharedSummaryBlock(id, runtime, attributes);\n await sharedSummaryBlock.load(services);\n\n return sharedSummaryBlock;\n }\n\n /**\n * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.create}\n */\n public create(runtime: IFluidDataStoreRuntime, id: string): ISharedObject {\n const sharedSummaryBlock = new SharedSummaryBlock(id, runtime, SharedSummaryBlockFactory.Attributes);\n sharedSummaryBlock.initializeLocal();\n\n return sharedSummaryBlock;\n }\n}\n"]}
1
+ {"version":3,"file":"sharedSummaryBlockFactory.js","sourceRoot":"","sources":["../src/sharedSummaryBlockFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AASH,qDAA8C;AAC9C,6DAA0D;AAE1D;;;GAGG;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 * @sealed\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 +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;;;;;GAKG;AACH,MAAM,WAAW,mBAAoB,SAAQ,aAAa;IACtD;;;;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;CACjD"}
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;;;;;GAKG;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 +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 */\nexport interface ISharedSummaryBlock extends ISharedObject {\n /**\n * Retrieves the given key from the map.\n * @param key - Key to retrieve from.\n * @returns The stored value, or undefined if the key is not set.\n */\n get<T>(key: string): Jsonable<T>;\n\n /**\n * Sets the value stored at key to the provided value.\n * @param key - Key to set at.\n * @param value - Jsonable type value to set.\n */\n set<T>(key: string, value: Jsonable<T>): void;\n}\n"]}
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 */\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"]}
@@ -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.3.0.2";
8
+ export declare const pkgVersion = "2.0.0-internal.3.2.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.3.0.2";
8
+ export const pkgVersion = "2.0.0-internal.3.2.0";
9
9
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","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.3.0.2\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","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.3.2.0\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"sharedSummaryBlock.d.ts","sourceRoot":"","sources":["../src/sharedSummaryBlock.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,yBAAy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AC;QAC7D,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;YAC7B,YAAY,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QAC9B,CAAC,CAAC,CAAC;QACH,OAAO,uBAAuB,CAAC,gBAAgB,EAAE,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC;IACnF,CAAC;IAED;;OAEG;IACO,KAAK,CAAC,QAAQ,CAAC,OAA+B;QACpD,MAAM,QAAQ,GAAG,MAAM,YAAY,CAAsC,OAAO,EAAE,gBAAgB,CAAC,CAAC;QACpG,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YACjD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;SAC7B;IACL,CAAC;IAED;;OAEG;IACO,YAAY,KAAK,CAAC;IAE5B;;OAEG;IACO,WAAW,CAAC,OAAkC,EAAE,KAAc;QACpE,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACzE,CAAC;IAES,cAAc;QACpB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACvC,CAAC;CACJ","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 IChannelAttributes,\n IFluidDataStoreRuntime,\n IChannelStorageService,\n Jsonable,\n IChannelFactory,\n} from \"@fluidframework/datastore-definitions\";\nimport { ISummaryTreeWithStats } from \"@fluidframework/runtime-definitions\";\nimport { readAndParse } from \"@fluidframework/driver-utils\";\nimport {\n createSingleBlobSummary,\n IFluidSerializer,\n SharedObject,\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 [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 */\nexport class SharedSummaryBlock extends SharedObject implements ISharedSummaryBlock {\n /**\n * Create a new shared summary block\n *\n * @param runtime - data store runtime the new shared summary block belongs to.\n * @param id - optional name of the shared summary block.\n * @returns newly created shared summary block (but not attached yet).\n */\n public static create(runtime: IFluidDataStoreRuntime, id?: string) {\n return runtime.createChannel(id, SharedSummaryBlockFactory.Type) as SharedSummaryBlock;\n }\n\n /**\n * Get a factory for SharedSummaryBlock to register with the data store.\n *\n * @returns a factory that creates and loads SharedSummaryBlock.\n */\n public static getFactory(): IChannelFactory {\n return new SharedSummaryBlockFactory();\n }\n\n /**\n * The data held by this object.\n */\n private readonly data = new Map<string, Jsonable>();\n\n /**\n * Constructs a new SharedSummaryBlock. If the object is non-local, an id and service interfaces will\n * be provided.\n *\n * @param id - optional name of the shared summary block.\n * @param runtime - data store runtime thee object belongs to.\n * @param attributes - The attributes for the object.\n */\n constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes) {\n super(id, runtime, attributes, \"fluid_sharedSummaryBlock_\");\n }\n\n /**\n * {@inheritDoc ISharedSummaryBlock.get}\n */\n public get<T>(key: string): Jsonable<T> {\n return this.data.get(key) as Jsonable<T>;\n }\n\n /**\n * {@inheritDoc ISharedSummaryBlock.set}\n */\n public set<T>(key: string, value: Jsonable<T>): void {\n this.data.set(key, value);\n // Set this object as dirty so that it is part of the next summary.\n this.dirty();\n }\n\n /**\n * {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}\n */\n protected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats {\n const contentsBlob: ISharedSummaryBlockDataSerializable = {};\n this.data.forEach((value, key) => {\n contentsBlob[key] = value;\n });\n return createSingleBlobSummary(snapshotFileName, JSON.stringify(contentsBlob));\n }\n\n /**\n * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}\n */\n protected async loadCore(storage: IChannelStorageService): Promise<void> {\n const contents = await readAndParse<ISharedSummaryBlockDataSerializable>(storage, snapshotFileName);\n for (const [key, value] of Object.entries(contents)) {\n this.data.set(key, value);\n }\n }\n\n /**\n * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}\n */\n protected onDisconnect() { }\n\n /**\n * {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}\n */\n protected processCore(message: ISequencedDocumentMessage, local: boolean) {\n throw new Error(\"shared summary block should not generate any ops.\");\n }\n\n protected applyStashedOp() {\n throw new Error(\"not implemented\");\n }\n}\n"]}
1
+ {"version":3,"file":"sharedSummaryBlock.js","sourceRoot":"","sources":["../src/sharedSummaryBlock.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EACN,uBAAuB,EAEvB,YAAY,GACZ,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAGxE,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AAUlC;;;GAGG;AACH,MAAM,OAAO,kBAAmB,SAAQ,YAAY;IA0BnD;;;;;;;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;IAnCD;;;;;;OAMG;IACI,MAAM,CAAC,MAAM,CAAC,OAA+B,EAAE,EAAW;QAChE,OAAO,OAAO,CAAC,aAAa,CAAC,EAAE,EAAE,yBAAyB,CAAC,IAAI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AK,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 */\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 +1 @@
1
- {"version":3,"file":"sharedSummaryBlockFactory.d.ts","sourceRoot":"","sources":["../src/sharedSummaryBlockFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACH,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EAClB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACH,aAAa,EAChB,MAAM,oCAAoC,CAAC;AAI5C;;;GAGG;AACH,qBAAa,yBAA0B,YAAW,eAAe;IAC7D;;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,CACb,OAAO,EAAE,sBAAsB,EAC/B,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,gBAAgB,EAC1B,UAAU,EAAE,kBAAkB,GAAG,OAAO,CAAC,aAAa,CAAC;IAO3D;;OAEG;IACI,MAAM,CAAC,OAAO,EAAE,sBAAsB,EAAE,EAAE,EAAE,MAAM,GAAG,aAAa;CAM5E"}
1
+ {"version":3,"file":"sharedSummaryBlockFactory.d.ts","sourceRoot":"","sources":["../src/sharedSummaryBlockFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EACf,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAInE;;;GAGG;AACH,qBAAa,yBAA0B,YAAW,eAAe;IAChE;;OAEG;IACH,gBAAuB,IAAI,4DAA4D;IAEvF;;OAEG;IACH,gBAAuB,UAAU,EAAE,kBAAkB,CAInD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,kBAAkB,CAAC;IAC9B,CAAC;;AAlDD;;GAEG;AACoB,8BAAI,GAAG,wDAAwD,CAAC;AAEvF;;GAEG;AACoB,oCAAU,GAAuB;IACpD,IAAI,EAAE,yBAAyB,CAAC,IAAI;IACpC,qBAAqB,EAAE,KAAK;IAC5B,cAAc,EAAE,UAAU;CAC7B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n IChannelAttributes,\n IFluidDataStoreRuntime,\n IChannelServices,\n IChannelFactory,\n} from \"@fluidframework/datastore-definitions\";\nimport {\n ISharedObject,\n} 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 * @sealed\n */\nexport class SharedSummaryBlockFactory implements IChannelFactory {\n /**\n * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.\"type\"}\n */\n public static readonly Type = \"https://graph.microsoft.com/types/shared-summary-block\";\n\n /**\n * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}\n */\n public static readonly Attributes: IChannelAttributes = {\n type: SharedSummaryBlockFactory.Type,\n snapshotFormatVersion: \"0.1\",\n packageVersion: pkgVersion,\n };\n\n /**\n * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.\"type\"}\n */\n public get type() {\n return SharedSummaryBlockFactory.Type;\n }\n\n /**\n * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}\n */\n public get attributes() {\n return SharedSummaryBlockFactory.Attributes;\n }\n\n /**\n * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}\n */\n public async load(\n runtime: IFluidDataStoreRuntime,\n id: string,\n services: IChannelServices,\n attributes: IChannelAttributes): Promise<ISharedObject> {\n const sharedSummaryBlock = new SharedSummaryBlock(id, runtime, attributes);\n await sharedSummaryBlock.load(services);\n\n return sharedSummaryBlock;\n }\n\n /**\n * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.create}\n */\n public create(runtime: IFluidDataStoreRuntime, id: string): ISharedObject {\n const sharedSummaryBlock = new SharedSummaryBlock(id, runtime, SharedSummaryBlockFactory.Attributes);\n sharedSummaryBlock.initializeLocal();\n\n return sharedSummaryBlock;\n }\n}\n"]}
1
+ {"version":3,"file":"sharedSummaryBlockFactory.js","sourceRoot":"","sources":["../src/sharedSummaryBlockFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;;GAGG;AACH,MAAM,OAAO,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,kBAAkB,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,kBAAkB,CAChD,EAAE,EACF,OAAO,EACP,yBAAyB,CAAC,UAAU,CACpC,CAAC;QACF,kBAAkB,CAAC,eAAe,EAAE,CAAC;QAErC,OAAO,kBAAkB,CAAC;IAC3B,CAAC;;AAvDD;;GAEG;AACoB,8BAAI,GAAG,wDAAwD,CAAC;AAEvF;;GAEG;AACoB,oCAAU,GAAuB;IACvD,IAAI,EAAE,yBAAyB,CAAC,IAAI;IACpC,qBAAqB,EAAE,KAAK;IAC5B,cAAc,EAAE,UAAU;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 * @sealed\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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/shared-summary-block",
3
- "version": "2.0.0-internal.3.0.2",
3
+ "version": "2.0.0-internal.3.2.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": {
@@ -14,34 +14,6 @@
14
14
  "main": "dist/index.js",
15
15
  "module": "lib/index.js",
16
16
  "types": "dist/index.d.ts",
17
- "scripts": {
18
- "build": "npm run build:genver && concurrently npm:build:compile npm:lint && npm run build:docs",
19
- "build:commonjs": "npm run tsc && npm run typetests:gen && npm run build:test",
20
- "build:compile": "concurrently npm:build:commonjs npm:build:esnext",
21
- "build:compile:min": "npm run build:compile",
22
- "build:docs": "api-extractor run --local --typescript-compiler-folder ../../../node_modules/typescript && copyfiles -u 1 ./_api-extractor-temp/doc-models/* ../../../_api-extractor-temp/",
23
- "build:esnext": "tsc --project ./tsconfig.esnext.json",
24
- "build:full": "npm run build",
25
- "build:full:compile": "npm run build:compile",
26
- "build:genver": "gen-version",
27
- "build:test": "tsc --project ./src/test/tsconfig.json",
28
- "ci:build:docs": "api-extractor run --typescript-compiler-folder ../../../node_modules/typescript && copyfiles -u 1 ./_api-extractor-temp/* ../../../_api-extractor-temp/",
29
- "clean": "rimraf dist lib *.tsbuildinfo *.build.log",
30
- "eslint": "eslint --format stylish src",
31
- "eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
32
- "format": "npm run prettier:fix",
33
- "lint": "npm run eslint",
34
- "lint:fix": "npm run eslint:fix",
35
- "prettier": "prettier --check . --ignore-path ../../../.prettierignore",
36
- "prettier:fix": "prettier --write . --ignore-path ../../../.prettierignore",
37
- "test": "npm run test:mocha",
38
- "test:coverage": "nyc npm test -- --reporter xunit --reporter-option output=nyc/junit-report.xml",
39
- "test:mocha": "mocha --ignore 'dist/test/types/*' --recursive dist/test -r node_modules/@fluidframework/mocha-test-setup --unhandled-rejections=strict",
40
- "test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha",
41
- "tsc": "tsc",
42
- "typetests:gen": "flub generate typetests --generate --dir .",
43
- "typetests:prepare": "flub generate typetests --prepare --dir . --pin"
44
- },
45
17
  "nyc": {
46
18
  "all": true,
47
19
  "cache-dir": "nyc/.cache",
@@ -63,22 +35,22 @@
63
35
  "temp-directory": "nyc/.nyc_output"
64
36
  },
65
37
  "dependencies": {
66
- "@fluidframework/common-utils": "^1.0.0",
67
- "@fluidframework/core-interfaces": ">=2.0.0-internal.3.0.2 <2.0.0-internal.4.0.0",
68
- "@fluidframework/datastore-definitions": ">=2.0.0-internal.3.0.2 <2.0.0-internal.4.0.0",
69
- "@fluidframework/driver-utils": ">=2.0.0-internal.3.0.2 <2.0.0-internal.4.0.0",
38
+ "@fluidframework/common-utils": "^1.1.1",
39
+ "@fluidframework/core-interfaces": ">=2.0.0-internal.3.2.0 <2.0.0-internal.4.0.0",
40
+ "@fluidframework/datastore-definitions": ">=2.0.0-internal.3.2.0 <2.0.0-internal.4.0.0",
41
+ "@fluidframework/driver-utils": ">=2.0.0-internal.3.2.0 <2.0.0-internal.4.0.0",
70
42
  "@fluidframework/protocol-definitions": "^1.1.0",
71
- "@fluidframework/runtime-definitions": ">=2.0.0-internal.3.0.2 <2.0.0-internal.4.0.0",
72
- "@fluidframework/shared-object-base": ">=2.0.0-internal.3.0.2 <2.0.0-internal.4.0.0"
43
+ "@fluidframework/runtime-definitions": ">=2.0.0-internal.3.2.0 <2.0.0-internal.4.0.0",
44
+ "@fluidframework/shared-object-base": ">=2.0.0-internal.3.2.0 <2.0.0-internal.4.0.0"
73
45
  },
74
46
  "devDependencies": {
75
- "@fluid-tools/build-cli": "^0.8.0",
47
+ "@fluid-tools/build-cli": "^0.10.0",
76
48
  "@fluidframework/build-common": "^1.1.0",
77
- "@fluidframework/build-tools": "^0.8.0",
49
+ "@fluidframework/build-tools": "^0.10.0",
78
50
  "@fluidframework/eslint-config-fluid": "^2.0.0",
79
- "@fluidframework/mocha-test-setup": ">=2.0.0-internal.3.0.2 <2.0.0-internal.4.0.0",
80
- "@fluidframework/shared-summary-block-previous": "npm:@fluidframework/shared-summary-block@2.0.0-internal.3.0.0",
81
- "@fluidframework/test-runtime-utils": ">=2.0.0-internal.3.0.2 <2.0.0-internal.4.0.0",
51
+ "@fluidframework/mocha-test-setup": ">=2.0.0-internal.3.2.0 <2.0.0-internal.4.0.0",
52
+ "@fluidframework/shared-summary-block-previous": "npm:@fluidframework/shared-summary-block@2.0.0-internal.3.1.0",
53
+ "@fluidframework/test-runtime-utils": ">=2.0.0-internal.3.2.0 <2.0.0-internal.4.0.0",
82
54
  "@microsoft/api-extractor": "^7.22.2",
83
55
  "@rushstack/eslint-config": "^2.5.1",
84
56
  "@types/benchmark": "^2.1.0",
@@ -96,9 +68,38 @@
96
68
  "typescript": "~4.5.5"
97
69
  },
98
70
  "typeValidation": {
99
- "version": "2.0.0-internal.3.0.1",
100
- "previousVersionStyle": "previousPatch",
101
- "baselineRange": "2.0.0-internal.3.0.0",
71
+ "version": "2.0.0-internal.3.2.0",
72
+ "previousVersionStyle": "~previousMinor",
73
+ "baselineRange": ">=2.0.0-internal.3.1.0 <2.0.0-internal.3.2.0",
74
+ "baselineVersion": "2.0.0-internal.3.1.0",
102
75
  "broken": {}
76
+ },
77
+ "scripts": {
78
+ "build": "npm run build:genver && concurrently npm:build:compile npm:lint && npm run build:docs",
79
+ "build:commonjs": "npm run tsc && npm run typetests:gen && npm run build:test",
80
+ "build:compile": "concurrently npm:build:commonjs npm:build:esnext",
81
+ "build:compile:min": "npm run build:compile",
82
+ "build:docs": "api-extractor run --local --typescript-compiler-folder ../../../node_modules/typescript && copyfiles -u 1 ./_api-extractor-temp/doc-models/* ../../../_api-extractor-temp/",
83
+ "build:esnext": "tsc --project ./tsconfig.esnext.json",
84
+ "build:full": "npm run build",
85
+ "build:full:compile": "npm run build:compile",
86
+ "build:genver": "gen-version",
87
+ "build:test": "tsc --project ./src/test/tsconfig.json",
88
+ "ci:build:docs": "api-extractor run --typescript-compiler-folder ../../../node_modules/typescript && copyfiles -u 1 ./_api-extractor-temp/* ../../../_api-extractor-temp/",
89
+ "clean": "rimraf dist lib *.tsbuildinfo *.build.log",
90
+ "eslint": "eslint --format stylish src",
91
+ "eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
92
+ "format": "npm run prettier:fix",
93
+ "lint": "npm run prettier && npm run eslint",
94
+ "lint:fix": "npm run prettier:fix && npm run eslint:fix",
95
+ "prettier": "prettier --check . --ignore-path ../../../.prettierignore",
96
+ "prettier:fix": "prettier --write . --ignore-path ../../../.prettierignore",
97
+ "test": "npm run test:mocha",
98
+ "test:coverage": "nyc npm test -- --reporter xunit --reporter-option output=nyc/junit-report.xml",
99
+ "test:mocha": "mocha --ignore 'dist/test/types/*' --recursive dist/test -r node_modules/@fluidframework/mocha-test-setup --unhandled-rejections=strict",
100
+ "test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha",
101
+ "tsc": "tsc",
102
+ "typetests:gen": "flub generate typetests --generate --dir .",
103
+ "typetests:prepare": "flub generate typetests --prepare --dir . --pin"
103
104
  }
104
- }
105
+ }
@@ -4,5 +4,5 @@
4
4
  */
5
5
 
6
6
  module.exports = {
7
- ...require("@fluidframework/build-common/prettier.config.cjs"),
7
+ ...require("@fluidframework/build-common/prettier.config.cjs"),
8
8
  };
package/src/interfaces.ts CHANGED
@@ -13,17 +13,17 @@ import { ISharedObject } from "@fluidframework/shared-object-base";
13
13
  * generate ops of its own, but relies on the above principle to maintain eventual consistency and to summarize.
14
14
  */
15
15
  export interface ISharedSummaryBlock extends ISharedObject {
16
- /**
17
- * Retrieves the given key from the map.
18
- * @param key - Key to retrieve from.
19
- * @returns The stored value, or undefined if the key is not set.
20
- */
21
- get<T>(key: string): Jsonable<T>;
16
+ /**
17
+ * Retrieves the given key from the map.
18
+ * @param key - Key to retrieve from.
19
+ * @returns The stored value, or undefined if the key is not set.
20
+ */
21
+ get<T>(key: string): Jsonable<T>;
22
22
 
23
- /**
24
- * Sets the value stored at key to the provided value.
25
- * @param key - Key to set at.
26
- * @param value - Jsonable type value to set.
27
- */
28
- set<T>(key: string, value: Jsonable<T>): void;
23
+ /**
24
+ * Sets the value stored at key to the provided value.
25
+ * @param key - Key to set at.
26
+ * @param value - Jsonable type value to set.
27
+ */
28
+ set<T>(key: string, value: Jsonable<T>): void;
29
29
  }
@@ -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.3.0.2";
9
+ export const pkgVersion = "2.0.0-internal.3.2.0";
@@ -5,18 +5,18 @@
5
5
 
6
6
  import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
7
7
  import {
8
- IChannelAttributes,
9
- IFluidDataStoreRuntime,
10
- IChannelStorageService,
11
- Jsonable,
12
- IChannelFactory,
8
+ IChannelAttributes,
9
+ IFluidDataStoreRuntime,
10
+ IChannelStorageService,
11
+ Jsonable,
12
+ IChannelFactory,
13
13
  } from "@fluidframework/datastore-definitions";
14
14
  import { ISummaryTreeWithStats } from "@fluidframework/runtime-definitions";
15
15
  import { readAndParse } from "@fluidframework/driver-utils";
16
16
  import {
17
- createSingleBlobSummary,
18
- IFluidSerializer,
19
- SharedObject,
17
+ createSingleBlobSummary,
18
+ IFluidSerializer,
19
+ SharedObject,
20
20
  } from "@fluidframework/shared-object-base";
21
21
  import { SharedSummaryBlockFactory } from "./sharedSummaryBlockFactory";
22
22
  import { ISharedSummaryBlock } from "./interfaces";
@@ -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;
32
32
  }
33
33
 
34
34
  /**
@@ -36,93 +36,96 @@ interface ISharedSummaryBlockDataSerializable {
36
36
  * Data should be set in this object in response to a remote op.
37
37
  */
38
38
  export class SharedSummaryBlock extends SharedObject implements ISharedSummaryBlock {
39
- /**
40
- * Create a new shared summary block
41
- *
42
- * @param runtime - data store runtime the new shared summary block belongs to.
43
- * @param id - optional name of the shared summary block.
44
- * @returns newly created shared summary block (but not attached yet).
45
- */
46
- public static create(runtime: IFluidDataStoreRuntime, id?: string) {
47
- return runtime.createChannel(id, SharedSummaryBlockFactory.Type) as SharedSummaryBlock;
48
- }
39
+ /**
40
+ * Create a new shared summary block
41
+ *
42
+ * @param runtime - data store runtime the new shared summary block belongs to.
43
+ * @param id - optional name of the shared summary block.
44
+ * @returns newly created shared summary block (but not attached yet).
45
+ */
46
+ public static create(runtime: IFluidDataStoreRuntime, id?: string) {
47
+ return runtime.createChannel(id, SharedSummaryBlockFactory.Type) as SharedSummaryBlock;
48
+ }
49
49
 
50
- /**
51
- * Get a factory for SharedSummaryBlock to register with the data store.
52
- *
53
- * @returns a factory that creates and loads SharedSummaryBlock.
54
- */
55
- public static getFactory(): IChannelFactory {
56
- return new SharedSummaryBlockFactory();
57
- }
50
+ /**
51
+ * Get a factory for SharedSummaryBlock to register with the data store.
52
+ *
53
+ * @returns a factory that creates and loads SharedSummaryBlock.
54
+ */
55
+ public static getFactory(): IChannelFactory {
56
+ return new SharedSummaryBlockFactory();
57
+ }
58
58
 
59
- /**
60
- * The data held by this object.
61
- */
62
- private readonly data = new Map<string, Jsonable>();
59
+ /**
60
+ * The data held by this object.
61
+ */
62
+ private readonly data = new Map<string, Jsonable>();
63
63
 
64
- /**
65
- * Constructs a new SharedSummaryBlock. If the object is non-local, an id and service interfaces will
66
- * be provided.
67
- *
68
- * @param id - optional name of the shared summary block.
69
- * @param runtime - data store runtime thee object belongs to.
70
- * @param attributes - The attributes for the object.
71
- */
72
- constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes) {
73
- super(id, runtime, attributes, "fluid_sharedSummaryBlock_");
74
- }
64
+ /**
65
+ * Constructs a new SharedSummaryBlock. If the object is non-local, an id and service interfaces will
66
+ * be provided.
67
+ *
68
+ * @param id - optional name of the shared summary block.
69
+ * @param runtime - data store runtime thee object belongs to.
70
+ * @param attributes - The attributes for the object.
71
+ */
72
+ constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes) {
73
+ super(id, runtime, attributes, "fluid_sharedSummaryBlock_");
74
+ }
75
75
 
76
- /**
77
- * {@inheritDoc ISharedSummaryBlock.get}
78
- */
79
- public get<T>(key: string): Jsonable<T> {
80
- return this.data.get(key) as Jsonable<T>;
81
- }
76
+ /**
77
+ * {@inheritDoc ISharedSummaryBlock.get}
78
+ */
79
+ public get<T>(key: string): Jsonable<T> {
80
+ return this.data.get(key) as Jsonable<T>;
81
+ }
82
82
 
83
- /**
84
- * {@inheritDoc ISharedSummaryBlock.set}
85
- */
86
- public set<T>(key: string, value: Jsonable<T>): void {
87
- this.data.set(key, value);
88
- // Set this object as dirty so that it is part of the next summary.
89
- this.dirty();
90
- }
83
+ /**
84
+ * {@inheritDoc ISharedSummaryBlock.set}
85
+ */
86
+ public set<T>(key: string, value: Jsonable<T>): void {
87
+ this.data.set(key, value);
88
+ // Set this object as dirty so that it is part of the next summary.
89
+ this.dirty();
90
+ }
91
91
 
92
- /**
93
- * {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}
94
- */
95
- protected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats {
96
- const contentsBlob: ISharedSummaryBlockDataSerializable = {};
97
- this.data.forEach((value, key) => {
98
- contentsBlob[key] = value;
99
- });
100
- return createSingleBlobSummary(snapshotFileName, JSON.stringify(contentsBlob));
101
- }
92
+ /**
93
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}
94
+ */
95
+ protected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats {
96
+ const contentsBlob: ISharedSummaryBlockDataSerializable = {};
97
+ this.data.forEach((value, key) => {
98
+ contentsBlob[key] = value;
99
+ });
100
+ return createSingleBlobSummary(snapshotFileName, JSON.stringify(contentsBlob));
101
+ }
102
102
 
103
- /**
104
- * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}
105
- */
106
- protected async loadCore(storage: IChannelStorageService): Promise<void> {
107
- const contents = await readAndParse<ISharedSummaryBlockDataSerializable>(storage, snapshotFileName);
108
- for (const [key, value] of Object.entries(contents)) {
109
- this.data.set(key, value);
110
- }
111
- }
103
+ /**
104
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}
105
+ */
106
+ protected async loadCore(storage: IChannelStorageService): Promise<void> {
107
+ const contents = await readAndParse<ISharedSummaryBlockDataSerializable>(
108
+ storage,
109
+ snapshotFileName,
110
+ );
111
+ for (const [key, value] of Object.entries(contents)) {
112
+ this.data.set(key, value);
113
+ }
114
+ }
112
115
 
113
- /**
114
- * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}
115
- */
116
- protected onDisconnect() { }
116
+ /**
117
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}
118
+ */
119
+ protected onDisconnect() {}
117
120
 
118
- /**
119
- * {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}
120
- */
121
- protected processCore(message: ISequencedDocumentMessage, local: boolean) {
122
- throw new Error("shared summary block should not generate any ops.");
123
- }
121
+ /**
122
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}
123
+ */
124
+ protected processCore(message: ISequencedDocumentMessage, local: boolean) {
125
+ throw new Error("shared summary block should not generate any ops.");
126
+ }
124
127
 
125
- protected applyStashedOp() {
126
- throw new Error("not implemented");
127
- }
128
+ protected applyStashedOp() {
129
+ throw new Error("not implemented");
130
+ }
128
131
  }
@@ -4,14 +4,12 @@
4
4
  */
5
5
 
6
6
  import {
7
- IChannelAttributes,
8
- IFluidDataStoreRuntime,
9
- IChannelServices,
10
- IChannelFactory,
7
+ IChannelAttributes,
8
+ IFluidDataStoreRuntime,
9
+ IChannelServices,
10
+ IChannelFactory,
11
11
  } from "@fluidframework/datastore-definitions";
12
- import {
13
- ISharedObject,
14
- } from "@fluidframework/shared-object-base";
12
+ import { ISharedObject } from "@fluidframework/shared-object-base";
15
13
  import { pkgVersion } from "./packageVersion";
16
14
  import { SharedSummaryBlock } from "./sharedSummaryBlock";
17
15
 
@@ -20,55 +18,60 @@ import { SharedSummaryBlock } from "./sharedSummaryBlock";
20
18
  * @sealed
21
19
  */
22
20
  export class SharedSummaryBlockFactory implements IChannelFactory {
23
- /**
24
- * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory."type"}
25
- */
26
- public static readonly Type = "https://graph.microsoft.com/types/shared-summary-block";
21
+ /**
22
+ * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory."type"}
23
+ */
24
+ public static readonly Type = "https://graph.microsoft.com/types/shared-summary-block";
27
25
 
28
- /**
29
- * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}
30
- */
31
- public static readonly Attributes: IChannelAttributes = {
32
- type: SharedSummaryBlockFactory.Type,
33
- snapshotFormatVersion: "0.1",
34
- packageVersion: pkgVersion,
35
- };
26
+ /**
27
+ * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}
28
+ */
29
+ public static readonly Attributes: IChannelAttributes = {
30
+ type: SharedSummaryBlockFactory.Type,
31
+ snapshotFormatVersion: "0.1",
32
+ packageVersion: pkgVersion,
33
+ };
36
34
 
37
- /**
38
- * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory."type"}
39
- */
40
- public get type() {
41
- return SharedSummaryBlockFactory.Type;
42
- }
35
+ /**
36
+ * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory."type"}
37
+ */
38
+ public get type() {
39
+ return SharedSummaryBlockFactory.Type;
40
+ }
43
41
 
44
- /**
45
- * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}
46
- */
47
- public get attributes() {
48
- return SharedSummaryBlockFactory.Attributes;
49
- }
42
+ /**
43
+ * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}
44
+ */
45
+ public get attributes() {
46
+ return SharedSummaryBlockFactory.Attributes;
47
+ }
50
48
 
51
- /**
52
- * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}
53
- */
54
- public async load(
55
- runtime: IFluidDataStoreRuntime,
56
- id: string,
57
- services: IChannelServices,
58
- attributes: IChannelAttributes): Promise<ISharedObject> {
59
- const sharedSummaryBlock = new SharedSummaryBlock(id, runtime, attributes);
60
- await sharedSummaryBlock.load(services);
49
+ /**
50
+ * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}
51
+ */
52
+ public async load(
53
+ runtime: IFluidDataStoreRuntime,
54
+ id: string,
55
+ services: IChannelServices,
56
+ attributes: IChannelAttributes,
57
+ ): Promise<ISharedObject> {
58
+ const sharedSummaryBlock = new SharedSummaryBlock(id, runtime, attributes);
59
+ await sharedSummaryBlock.load(services);
61
60
 
62
- return sharedSummaryBlock;
63
- }
61
+ return sharedSummaryBlock;
62
+ }
64
63
 
65
- /**
66
- * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.create}
67
- */
68
- public create(runtime: IFluidDataStoreRuntime, id: string): ISharedObject {
69
- const sharedSummaryBlock = new SharedSummaryBlock(id, runtime, SharedSummaryBlockFactory.Attributes);
70
- sharedSummaryBlock.initializeLocal();
64
+ /**
65
+ * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.create}
66
+ */
67
+ public create(runtime: IFluidDataStoreRuntime, id: string): ISharedObject {
68
+ const sharedSummaryBlock = new SharedSummaryBlock(
69
+ id,
70
+ runtime,
71
+ SharedSummaryBlockFactory.Attributes,
72
+ );
73
+ sharedSummaryBlock.initializeLocal();
71
74
 
72
- return sharedSummaryBlock;
73
- }
75
+ return sharedSummaryBlock;
76
+ }
74
77
  }
@@ -1,7 +1,7 @@
1
1
  {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "outDir": "./lib",
5
- "module": "esnext"
6
- },
7
- }
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "outDir": "./lib",
5
+ "module": "esnext",
6
+ },
7
+ }
package/tsconfig.json CHANGED
@@ -1,14 +1,10 @@
1
1
  {
2
- "extends": "@fluidframework/build-common/ts-common-config.json",
3
- "exclude": [
4
- "src/test/**/*"
5
- ],
6
- "compilerOptions": {
7
- "rootDir": "./src",
8
- "outDir": "./dist",
9
- "composite": true
10
- },
11
- "include": [
12
- "src/**/*"
13
- ]
14
- }
2
+ "extends": "@fluidframework/build-common/ts-common-config.json",
3
+ "exclude": ["src/test/**/*"],
4
+ "compilerOptions": {
5
+ "rootDir": "./src",
6
+ "outDir": "./dist",
7
+ "composite": true,
8
+ },
9
+ "include": ["src/**/*"],
10
+ }