@fluidframework/shared-summary-block 1.4.0-121020 → 2.0.0-dev-rc.1.0.0.224419

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/.eslintrc.js +5 -7
  2. package/.mocharc.js +12 -0
  3. package/CHANGELOG.md +135 -0
  4. package/README.md +22 -1
  5. package/api-extractor-lint.json +4 -0
  6. package/api-extractor.json +2 -2
  7. package/api-report/shared-summary-block.api.md +62 -0
  8. package/dist/index.cjs +12 -0
  9. package/dist/index.cjs.map +1 -0
  10. package/dist/index.d.ts +3 -3
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/{interfaces.js → interfaces.cjs} +1 -1
  13. package/dist/interfaces.cjs.map +1 -0
  14. package/dist/interfaces.d.ts +4 -0
  15. package/dist/interfaces.d.ts.map +1 -1
  16. package/dist/{packageVersion.js → packageVersion.cjs} +2 -2
  17. package/dist/packageVersion.cjs.map +1 -0
  18. package/dist/packageVersion.d.ts +1 -1
  19. package/dist/packageVersion.d.ts.map +1 -1
  20. package/dist/shared-summary-block-alpha.d.ts +100 -0
  21. package/dist/shared-summary-block-beta.d.ts +21 -0
  22. package/dist/shared-summary-block-public.d.ts +21 -0
  23. package/dist/shared-summary-block-untrimmed.d.ts +131 -0
  24. package/dist/{sharedSummaryBlock.js → sharedSummaryBlock.cjs} +18 -17
  25. package/dist/sharedSummaryBlock.cjs.map +1 -0
  26. package/dist/sharedSummaryBlock.d.ts +1 -0
  27. package/dist/sharedSummaryBlock.d.ts.map +1 -1
  28. package/dist/{sharedSummaryBlockFactory.js → sharedSummaryBlockFactory.cjs} +5 -3
  29. package/dist/sharedSummaryBlockFactory.cjs.map +1 -0
  30. package/dist/sharedSummaryBlockFactory.d.ts +2 -0
  31. package/dist/sharedSummaryBlockFactory.d.ts.map +1 -1
  32. package/dist/tsdoc-metadata.json +11 -0
  33. package/lib/index.d.mts +8 -0
  34. package/lib/index.d.mts.map +1 -0
  35. package/lib/index.mjs +7 -0
  36. package/lib/index.mjs.map +1 -0
  37. package/lib/{interfaces.d.ts → interfaces.d.mts} +4 -0
  38. package/lib/interfaces.d.mts.map +1 -0
  39. package/lib/{interfaces.js → interfaces.mjs} +1 -1
  40. package/lib/interfaces.mjs.map +1 -0
  41. package/lib/{packageVersion.d.ts → packageVersion.d.mts} +1 -1
  42. package/lib/{packageVersion.d.ts.map → packageVersion.d.mts.map} +1 -1
  43. package/lib/{packageVersion.js → packageVersion.mjs} +2 -2
  44. package/lib/packageVersion.mjs.map +1 -0
  45. package/lib/shared-summary-block-alpha.d.mts +100 -0
  46. package/lib/shared-summary-block-beta.d.mts +21 -0
  47. package/lib/shared-summary-block-public.d.mts +21 -0
  48. package/lib/shared-summary-block-untrimmed.d.mts +131 -0
  49. package/lib/{sharedSummaryBlock.d.ts → sharedSummaryBlock.d.mts} +2 -1
  50. package/lib/sharedSummaryBlock.d.mts.map +1 -0
  51. package/lib/{sharedSummaryBlock.js → sharedSummaryBlock.mjs} +18 -17
  52. package/lib/sharedSummaryBlock.mjs.map +1 -0
  53. package/lib/{sharedSummaryBlockFactory.d.ts → sharedSummaryBlockFactory.d.mts} +2 -0
  54. package/lib/sharedSummaryBlockFactory.d.mts.map +1 -0
  55. package/lib/{sharedSummaryBlockFactory.js → sharedSummaryBlockFactory.mjs} +5 -3
  56. package/lib/sharedSummaryBlockFactory.mjs.map +1 -0
  57. package/package.json +95 -62
  58. package/prettier.config.cjs +8 -0
  59. package/src/index.ts +3 -3
  60. package/src/interfaces.ts +16 -12
  61. package/src/packageVersion.ts +1 -1
  62. package/src/sharedSummaryBlock.ts +92 -88
  63. package/src/sharedSummaryBlockFactory.ts +56 -51
  64. package/tsc-multi.test.json +4 -0
  65. package/tsconfig.json +11 -13
  66. package/dist/index.js +0 -20
  67. package/dist/index.js.map +0 -1
  68. package/dist/interfaces.js.map +0 -1
  69. package/dist/packageVersion.js.map +0 -1
  70. package/dist/sharedSummaryBlock.js.map +0 -1
  71. package/dist/sharedSummaryBlockFactory.js.map +0 -1
  72. package/lib/index.d.ts +0 -8
  73. package/lib/index.d.ts.map +0 -1
  74. package/lib/index.js +0 -8
  75. package/lib/index.js.map +0 -1
  76. package/lib/interfaces.d.ts.map +0 -1
  77. package/lib/interfaces.js.map +0 -1
  78. package/lib/packageVersion.js.map +0 -1
  79. package/lib/sharedSummaryBlock.d.ts.map +0 -1
  80. package/lib/sharedSummaryBlock.js.map +0 -1
  81. package/lib/sharedSummaryBlockFactory.d.ts.map +0 -1
  82. package/lib/sharedSummaryBlockFactory.js.map +0 -1
  83. package/tsconfig.esnext.json +0 -7
package/tsconfig.json CHANGED
@@ -1,14 +1,12 @@
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": [
3
+ "../../../common/build/build-common/tsconfig.base.json",
4
+ "../../../common/build/build-common/tsconfig.cjs.json",
5
+ ],
6
+ "include": ["src/**/*"],
7
+ "exclude": ["src/test/**/*"],
8
+ "compilerOptions": {
9
+ "rootDir": "./src",
10
+ "outDir": "./dist",
11
+ },
12
+ }
package/dist/index.js DELETED
@@ -1,20 +0,0 @@
1
- "use strict";
2
- /*!
3
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
- * Licensed under the MIT License.
5
- */
6
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
- if (k2 === undefined) k2 = k;
8
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./interfaces"), exports);
18
- __exportStar(require("./sharedSummaryBlock"), exports);
19
- __exportStar(require("./sharedSummaryBlockFactory"), exports);
20
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;AAEH,+CAA6B;AAC7B,uDAAqC;AACrC,8DAA4C","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport * from \"./interfaces\";\nexport * from \"./sharedSummaryBlock\";\nexport * from \"./sharedSummaryBlockFactory\";\n"]}
@@ -1 +0,0 @@
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 +0,0 @@
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,cAAc,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 = \"1.4.0-121020\";\n"]}
@@ -1 +0,0 @@
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;IA0BhD;;;;;;;OAOG;IACH,YAAY,EAAU,EAAE,OAA+B,EAAE,UAA8B;QACnF,KAAK,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,2BAA2B,CAAC,CAAC;QAdhE;;WAEG;QACc,SAAI,GAAG,IAAI,GAAG,EAAoB,CAAC;IAYpD,CAAC;IAnCD;;;;;;OAMG;IACI,MAAM,CAAC,MAAM,CAAC,OAA+B,EAAE,EAAW;QAC7D,OAAO,OAAO,CAAC,aAAa,CAAC,EAAE,EAAE,qDAAyB,CAAC,IAAI,CAAuB,CAAC;IAC3F,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,UAAU;QACpB,OAAO,IAAI,qDAAyB,EAAE,CAAC;IAC3C,CAAC;IAmBD;;OAEG;IACI,GAAG,CAAI,GAAW;QACrB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAgB,CAAC;IAC7C,CAAC;IAED;;OAEG;IACI,GAAG,CAAI,GAAW,EAAE,KAAkB;QACzC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC1B,mEAAmE;QACnE,IAAI,CAAC,KAAK,EAAE,CAAC;IACjB,CAAC;IAED;;OAEG;IACO,aAAa,CAAC,UAA4B;QAChD,MAAM,YAAY,GAAwC,EAAE,CAAC;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,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 +0,0 @@
1
- {"version":3,"file":"sharedSummaryBlockFactory.js","sourceRoot":"","sources":["../src/sharedSummaryBlockFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAWH,qDAA8C;AAC9C,6DAA0D;AAE1D;;;GAGG;AACH,MAAa,yBAAyB;IAelC;;OAEG;IACH,IAAW,IAAI;QACX,OAAO,yBAAyB,CAAC,IAAI,CAAC;IAC1C,CAAC;IAED;;OAEG;IACH,IAAW,UAAU;QACjB,OAAO,yBAAyB,CAAC,UAAU,CAAC;IAChD,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,IAAI,CACb,OAA+B,EAC/B,EAAU,EACV,QAA0B,EAC1B,UAA8B;QAC9B,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;IAC9B,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,OAA+B,EAAE,EAAU;QACrD,MAAM,kBAAkB,GAAG,IAAI,uCAAkB,CAAC,EAAE,EAAE,OAAO,EAAE,yBAAyB,CAAC,UAAU,CAAC,CAAC;QACrG,kBAAkB,CAAC,eAAe,EAAE,CAAC;QAErC,OAAO,kBAAkB,CAAC;IAC9B,CAAC;;AAnDL,8DAoDC;AAnDG;;GAEG;AACoB,8BAAI,GAAG,wDAAwD,CAAC;AAEvF;;GAEG;AACoB,oCAAU,GAAuB;IACpD,IAAI,EAAE,yBAAyB,CAAC,IAAI;IACpC,qBAAqB,EAAE,KAAK;IAC5B,cAAc,EAAE,2BAAU;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"]}
package/lib/index.d.ts DELETED
@@ -1,8 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- export * from "./interfaces";
6
- export * from "./sharedSummaryBlock";
7
- export * from "./sharedSummaryBlockFactory";
8
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC"}
package/lib/index.js DELETED
@@ -1,8 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- export * from "./interfaces";
6
- export * from "./sharedSummaryBlock";
7
- export * from "./sharedSummaryBlockFactory";
8
- //# sourceMappingURL=index.js.map
package/lib/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport * from \"./interfaces\";\nexport * from \"./sharedSummaryBlock\";\nexport * from \"./sharedSummaryBlockFactory\";\n"]}
@@ -1 +0,0 @@
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 +0,0 @@
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 +0,0 @@
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,cAAc,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 = \"1.4.0-121020\";\n"]}
@@ -1 +0,0 @@
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,EACH,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,QAAQ,EACR,eAAe,EAClB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAE5E,OAAO,EAEH,gBAAgB,EAChB,YAAY,EACf,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAYnD;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,YAAa,YAAW,mBAAmB;IAC/E;;;;;;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,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,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 +0,0 @@
1
- {"version":3,"file":"sharedSummaryBlockFactory.d.ts","sourceRoot":"","sources":["../src/sharedSummaryBlockFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;A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BAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAExC,OAAO,kBAAkB,CAAC;IAC9B,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,OAA+B,EAAE,EAAU;QACrD,MAAM,kBAAkB,GAAG,IAAI,kBAAkB,CAAC,EAAE,EAAE,OAAO,EAAE,yBAAyB,CAAC,UAAU,CAAC,CAAC;QACrG,kBAAkB,CAAC,eAAe,EAAE,CAAC;QAErC,OAAO,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,7 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "outDir": "./lib",
5
- "module": "esnext"
6
- },
7
- }