@fluidframework/shared-summary-block 2.0.0-dev-rc.5.0.0.271045 → 2.0.0-dev-rc.5.0.0.271717
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/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/sharedSummaryBlock.js +4 -4
- package/dist/sharedSummaryBlock.js.map +1 -1
- package/dist/sharedSummaryBlockFactory.js +12 -12
- package/dist/sharedSummaryBlockFactory.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/sharedSummaryBlock.js +4 -4
- package/lib/sharedSummaryBlock.js.map +1 -1
- package/lib/sharedSummaryBlockFactory.js +12 -12
- package/lib/sharedSummaryBlockFactory.js.map +1 -1
- package/package.json +10 -10
- package/src/packageVersion.ts +1 -1
package/dist/packageVersion.d.ts
CHANGED
|
@@ -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-dev-rc.5.0.0.
|
|
8
|
+
export declare const pkgVersion = "2.0.0-dev-rc.5.0.0.271717";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
package/dist/packageVersion.js
CHANGED
|
@@ -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-dev-rc.5.0.0.
|
|
11
|
+
exports.pkgVersion = "2.0.0-dev-rc.5.0.0.271717";
|
|
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,2BAA2B,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-dev-rc.5.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,2BAA2B,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-dev-rc.5.0.0.271717\";\n"]}
|
|
@@ -14,10 +14,6 @@ const snapshotFileName = "header";
|
|
|
14
14
|
* @alpha
|
|
15
15
|
*/
|
|
16
16
|
class SharedSummaryBlockClass extends internal_2.SharedObject {
|
|
17
|
-
/**
|
|
18
|
-
* The data held by this object.
|
|
19
|
-
*/
|
|
20
|
-
data = new Map();
|
|
21
17
|
/**
|
|
22
18
|
* Constructs a new SharedSummaryBlock. If the object is non-local, an id and service interfaces will
|
|
23
19
|
* be provided.
|
|
@@ -28,6 +24,10 @@ class SharedSummaryBlockClass extends internal_2.SharedObject {
|
|
|
28
24
|
*/
|
|
29
25
|
constructor(id, runtime, attributes) {
|
|
30
26
|
super(id, runtime, attributes, "fluid_sharedSummaryBlock_");
|
|
27
|
+
/**
|
|
28
|
+
* The data held by this object.
|
|
29
|
+
*/
|
|
30
|
+
this.data = new Map();
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
33
|
* {@inheritDoc ISharedSummaryBlock.get}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sharedSummaryBlock.js","sourceRoot":"","sources":["../src/sharedSummaryBlock.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AASH,oEAAqE;AAErE,0EAIqD;AAIrD,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AAUlC;;;;GAIG;AACH,MAAa,uBAAwB,SAAQ,uBAAY;
|
|
1
|
+
{"version":3,"file":"sharedSummaryBlock.js","sourceRoot":"","sources":["../src/sharedSummaryBlock.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AASH,oEAAqE;AAErE,0EAIqD;AAIrD,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AAUlC;;;;GAIG;AACH,MAAa,uBAAwB,SAAQ,uBAAY;IAMxD;;;;;;;OAOG;IACH,YAAY,EAAU,EAAE,OAA+B,EAAE,UAA8B;QACtF,KAAK,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,2BAA2B,CAAC,CAAC;QAd7D;;WAEG;QACc,SAAI,GAAG,IAAI,GAAG,EAA6B,CAAC;IAY7D,CAAC;IAED;;OAEG;IACI,GAAG,CAAI,GAAW;QACxB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAgB,CAAC;IAC1C,CAAC;IAED;;OAEG;IACI,GAAG,CAAI,GAAW,EAAE,KAAkB;QAC5C,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC1B,mEAAmE;QACnE,IAAI,CAAC,KAAK,EAAE,CAAC;IACd,CAAC;IAED;;OAEG;IACO,aAAa,CAAC,UAA4B;QACnD,MAAM,YAAY,GAAwC,EAAE,CAAC;QAC7D,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;YAChC,YAAY,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QAC3B,CAAC,CAAC,CAAC;QACH,OAAO,IAAA,kCAAuB,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,uBAAY,EAClC,OAAO,EACP,gBAAgB,CAChB,CAAC;QACF,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;YACrD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC3B,CAAC;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;AAzED,0DAyEC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tJsonable,\n\tIChannelAttributes,\n\tIFluidDataStoreRuntime,\n\tIChannelStorageService,\n} from \"@fluidframework/datastore-definitions/internal\";\nimport { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\nimport { readAndParse } from \"@fluidframework/driver-utils/internal\";\nimport { ISummaryTreeWithStats } from \"@fluidframework/runtime-definitions/internal\";\nimport {\n\tIFluidSerializer,\n\tSharedObject,\n\tcreateSingleBlobSummary,\n} from \"@fluidframework/shared-object-base/internal\";\n\nimport { ISharedSummaryBlock } from \"./interfaces.js\";\n\nconst snapshotFileName = \"header\";\n\n/**\n * Defines the in-memory object structure to be used for the conversion to/from serialized.\n * Directly used in JSON.stringify, direct result from JSON.parse.\n */\ninterface ISharedSummaryBlockDataSerializable {\n\t[key: string]: Jsonable<unknown>;\n}\n\n/**\n * Implementation of a shared summary block. It does not generate any ops. It is only part of the summary.\n * Data should be set in this object in response to a remote op.\n * @alpha\n */\nexport class SharedSummaryBlockClass extends SharedObject implements ISharedSummaryBlock {\n\t/**\n\t * The data held by this object.\n\t */\n\tprivate readonly data = new Map<string, Jsonable<unknown>>();\n\n\t/**\n\t * Constructs a new SharedSummaryBlock. If the object is non-local, an id and service interfaces will\n\t * be provided.\n\t *\n\t * @param id - optional name of the shared summary block.\n\t * @param runtime - data store runtime thee object belongs to.\n\t * @param attributes - The attributes for the object.\n\t */\n\tconstructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes) {\n\t\tsuper(id, runtime, attributes, \"fluid_sharedSummaryBlock_\");\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedSummaryBlock.get}\n\t */\n\tpublic get<T>(key: string): Jsonable<T> {\n\t\treturn this.data.get(key) as Jsonable<T>;\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedSummaryBlock.set}\n\t */\n\tpublic set<T>(key: string, value: Jsonable<T>): void {\n\t\tthis.data.set(key, value);\n\t\t// Set this object as dirty so that it is part of the next summary.\n\t\tthis.dirty();\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}\n\t */\n\tprotected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats {\n\t\tconst contentsBlob: ISharedSummaryBlockDataSerializable = {};\n\t\tthis.data.forEach((value, key) => {\n\t\t\tcontentsBlob[key] = value;\n\t\t});\n\t\treturn createSingleBlobSummary(snapshotFileName, JSON.stringify(contentsBlob));\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}\n\t */\n\tprotected async loadCore(storage: IChannelStorageService): Promise<void> {\n\t\tconst contents = await readAndParse<ISharedSummaryBlockDataSerializable>(\n\t\t\tstorage,\n\t\t\tsnapshotFileName,\n\t\t);\n\t\tfor (const [key, value] of Object.entries(contents)) {\n\t\t\tthis.data.set(key, value);\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}\n\t */\n\tprotected onDisconnect() {}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}\n\t */\n\tprotected processCore(message: ISequencedDocumentMessage, local: boolean) {\n\t\tthrow new Error(\"shared summary block should not generate any ops.\");\n\t}\n\n\tprotected applyStashedOp() {\n\t\tthrow new Error(\"not implemented\");\n\t}\n}\n"]}
|
|
@@ -12,18 +12,6 @@ const sharedSummaryBlock_js_1 = require("./sharedSummaryBlock.js");
|
|
|
12
12
|
* The factory that defines the shared summary block.
|
|
13
13
|
*/
|
|
14
14
|
class SharedSummaryBlockFactory {
|
|
15
|
-
/**
|
|
16
|
-
* {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory."type"}
|
|
17
|
-
*/
|
|
18
|
-
static Type = "https://graph.microsoft.com/types/shared-summary-block";
|
|
19
|
-
/**
|
|
20
|
-
* {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}
|
|
21
|
-
*/
|
|
22
|
-
static Attributes = {
|
|
23
|
-
type: SharedSummaryBlockFactory.Type,
|
|
24
|
-
snapshotFormatVersion: "0.1",
|
|
25
|
-
packageVersion: packageVersion_js_1.pkgVersion,
|
|
26
|
-
};
|
|
27
15
|
/**
|
|
28
16
|
* {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory."type"}
|
|
29
17
|
*/
|
|
@@ -54,6 +42,18 @@ class SharedSummaryBlockFactory {
|
|
|
54
42
|
}
|
|
55
43
|
}
|
|
56
44
|
exports.SharedSummaryBlockFactory = SharedSummaryBlockFactory;
|
|
45
|
+
/**
|
|
46
|
+
* {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory."type"}
|
|
47
|
+
*/
|
|
48
|
+
SharedSummaryBlockFactory.Type = "https://graph.microsoft.com/types/shared-summary-block";
|
|
49
|
+
/**
|
|
50
|
+
* {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}
|
|
51
|
+
*/
|
|
52
|
+
SharedSummaryBlockFactory.Attributes = {
|
|
53
|
+
type: SharedSummaryBlockFactory.Type,
|
|
54
|
+
snapshotFormatVersion: "0.1",
|
|
55
|
+
packageVersion: packageVersion_js_1.pkgVersion,
|
|
56
|
+
};
|
|
57
57
|
/**
|
|
58
58
|
* {@inheritDoc ISharedSummaryBlock}
|
|
59
59
|
* @alpha
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sharedSummaryBlockFactory.js","sourceRoot":"","sources":["../src/sharedSummaryBlockFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAQH,0EAAqF;AAGrF,2DAAiD;AACjD,mEAAkE;AAElE;;GAEG;AACH,MAAa,yBAAyB;
|
|
1
|
+
{"version":3,"file":"sharedSummaryBlockFactory.js","sourceRoot":"","sources":["../src/sharedSummaryBlockFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAQH,0EAAqF;AAGrF,2DAAiD;AACjD,mEAAkE;AAElE;;GAEG;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,+CAAuB,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QAChF,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,+CAAuB,CACrD,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,8BAAU;CAC1B,CAAC;AA8CH;;;GAGG;AACU,QAAA,kBAAkB,GAAG,IAAA,iCAAsB,EAAC,yBAAyB,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIChannelAttributes,\n\tIChannelFactory,\n\tIFluidDataStoreRuntime,\n\tIChannelServices,\n} from \"@fluidframework/datastore-definitions/internal\";\nimport { createSharedObjectKind } from \"@fluidframework/shared-object-base/internal\";\n\nimport type { ISharedSummaryBlock } from \"./interfaces.js\";\nimport { pkgVersion } from \"./packageVersion.js\";\nimport { SharedSummaryBlockClass } from \"./sharedSummaryBlock.js\";\n\n/**\n * The factory that defines the shared summary block.\n */\nexport class SharedSummaryBlockFactory implements IChannelFactory<ISharedSummaryBlock> {\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<ISharedSummaryBlock> {\n\t\tconst sharedSummaryBlock = new SharedSummaryBlockClass(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): ISharedSummaryBlock {\n\t\tconst sharedSummaryBlock = new SharedSummaryBlockClass(\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\n/**\n * {@inheritDoc ISharedSummaryBlock}\n * @alpha\n */\nexport const SharedSummaryBlock = createSharedObjectKind(SharedSummaryBlockFactory);\n\n/**\n * {@inheritDoc ISharedSummaryBlock}\n * @alpha\n */\nexport type SharedSummaryBlock = ISharedSummaryBlock;\n"]}
|
package/lib/packageVersion.d.ts
CHANGED
|
@@ -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-dev-rc.5.0.0.
|
|
8
|
+
export declare const pkgVersion = "2.0.0-dev-rc.5.0.0.271717";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
package/lib/packageVersion.js
CHANGED
|
@@ -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-dev-rc.5.0.0.
|
|
8
|
+
export const pkgVersion = "2.0.0-dev-rc.5.0.0.271717";
|
|
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,2BAA2B,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-dev-rc.5.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,2BAA2B,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-dev-rc.5.0.0.271717\";\n"]}
|
|
@@ -11,10 +11,6 @@ const snapshotFileName = "header";
|
|
|
11
11
|
* @alpha
|
|
12
12
|
*/
|
|
13
13
|
export class SharedSummaryBlockClass extends SharedObject {
|
|
14
|
-
/**
|
|
15
|
-
* The data held by this object.
|
|
16
|
-
*/
|
|
17
|
-
data = new Map();
|
|
18
14
|
/**
|
|
19
15
|
* Constructs a new SharedSummaryBlock. If the object is non-local, an id and service interfaces will
|
|
20
16
|
* be provided.
|
|
@@ -25,6 +21,10 @@ export class SharedSummaryBlockClass extends SharedObject {
|
|
|
25
21
|
*/
|
|
26
22
|
constructor(id, runtime, attributes) {
|
|
27
23
|
super(id, runtime, attributes, "fluid_sharedSummaryBlock_");
|
|
24
|
+
/**
|
|
25
|
+
* The data held by this object.
|
|
26
|
+
*/
|
|
27
|
+
this.data = new Map();
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
30
|
* {@inheritDoc ISharedSummaryBlock.get}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sharedSummaryBlock.js","sourceRoot":"","sources":["../src/sharedSummaryBlock.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAErE,OAAO,EAEN,YAAY,EACZ,uBAAuB,GACvB,MAAM,6CAA6C,CAAC;AAIrD,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AAUlC;;;;GAIG;AACH,MAAM,OAAO,uBAAwB,SAAQ,YAAY;
|
|
1
|
+
{"version":3,"file":"sharedSummaryBlock.js","sourceRoot":"","sources":["../src/sharedSummaryBlock.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAErE,OAAO,EAEN,YAAY,EACZ,uBAAuB,GACvB,MAAM,6CAA6C,CAAC;AAIrD,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AAUlC;;;;GAIG;AACH,MAAM,OAAO,uBAAwB,SAAQ,YAAY;IAM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KAAc;QACvE,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACtE,CAAC;IAES,cAAc;QACvB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACpC,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tJsonable,\n\tIChannelAttributes,\n\tIFluidDataStoreRuntime,\n\tIChannelStorageService,\n} from \"@fluidframework/datastore-definitions/internal\";\nimport { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\nimport { readAndParse } from \"@fluidframework/driver-utils/internal\";\nimport { ISummaryTreeWithStats } from \"@fluidframework/runtime-definitions/internal\";\nimport {\n\tIFluidSerializer,\n\tSharedObject,\n\tcreateSingleBlobSummary,\n} from \"@fluidframework/shared-object-base/internal\";\n\nimport { ISharedSummaryBlock } from \"./interfaces.js\";\n\nconst snapshotFileName = \"header\";\n\n/**\n * Defines the in-memory object structure to be used for the conversion to/from serialized.\n * Directly used in JSON.stringify, direct result from JSON.parse.\n */\ninterface ISharedSummaryBlockDataSerializable {\n\t[key: string]: Jsonable<unknown>;\n}\n\n/**\n * Implementation of a shared summary block. It does not generate any ops. It is only part of the summary.\n * Data should be set in this object in response to a remote op.\n * @alpha\n */\nexport class SharedSummaryBlockClass extends SharedObject implements ISharedSummaryBlock {\n\t/**\n\t * The data held by this object.\n\t */\n\tprivate readonly data = new Map<string, Jsonable<unknown>>();\n\n\t/**\n\t * Constructs a new SharedSummaryBlock. If the object is non-local, an id and service interfaces will\n\t * be provided.\n\t *\n\t * @param id - optional name of the shared summary block.\n\t * @param runtime - data store runtime thee object belongs to.\n\t * @param attributes - The attributes for the object.\n\t */\n\tconstructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes) {\n\t\tsuper(id, runtime, attributes, \"fluid_sharedSummaryBlock_\");\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedSummaryBlock.get}\n\t */\n\tpublic get<T>(key: string): Jsonable<T> {\n\t\treturn this.data.get(key) as Jsonable<T>;\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedSummaryBlock.set}\n\t */\n\tpublic set<T>(key: string, value: Jsonable<T>): void {\n\t\tthis.data.set(key, value);\n\t\t// Set this object as dirty so that it is part of the next summary.\n\t\tthis.dirty();\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}\n\t */\n\tprotected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats {\n\t\tconst contentsBlob: ISharedSummaryBlockDataSerializable = {};\n\t\tthis.data.forEach((value, key) => {\n\t\t\tcontentsBlob[key] = value;\n\t\t});\n\t\treturn createSingleBlobSummary(snapshotFileName, JSON.stringify(contentsBlob));\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}\n\t */\n\tprotected async loadCore(storage: IChannelStorageService): Promise<void> {\n\t\tconst contents = await readAndParse<ISharedSummaryBlockDataSerializable>(\n\t\t\tstorage,\n\t\t\tsnapshotFileName,\n\t\t);\n\t\tfor (const [key, value] of Object.entries(contents)) {\n\t\t\tthis.data.set(key, value);\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}\n\t */\n\tprotected onDisconnect() {}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}\n\t */\n\tprotected processCore(message: ISequencedDocumentMessage, local: boolean) {\n\t\tthrow new Error(\"shared summary block should not generate any ops.\");\n\t}\n\n\tprotected applyStashedOp() {\n\t\tthrow new Error(\"not implemented\");\n\t}\n}\n"]}
|
|
@@ -9,18 +9,6 @@ import { SharedSummaryBlockClass } from "./sharedSummaryBlock.js";
|
|
|
9
9
|
* The factory that defines the shared summary block.
|
|
10
10
|
*/
|
|
11
11
|
export class SharedSummaryBlockFactory {
|
|
12
|
-
/**
|
|
13
|
-
* {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory."type"}
|
|
14
|
-
*/
|
|
15
|
-
static Type = "https://graph.microsoft.com/types/shared-summary-block";
|
|
16
|
-
/**
|
|
17
|
-
* {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}
|
|
18
|
-
*/
|
|
19
|
-
static Attributes = {
|
|
20
|
-
type: SharedSummaryBlockFactory.Type,
|
|
21
|
-
snapshotFormatVersion: "0.1",
|
|
22
|
-
packageVersion: pkgVersion,
|
|
23
|
-
};
|
|
24
12
|
/**
|
|
25
13
|
* {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory."type"}
|
|
26
14
|
*/
|
|
@@ -50,6 +38,18 @@ export class SharedSummaryBlockFactory {
|
|
|
50
38
|
return sharedSummaryBlock;
|
|
51
39
|
}
|
|
52
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory."type"}
|
|
43
|
+
*/
|
|
44
|
+
SharedSummaryBlockFactory.Type = "https://graph.microsoft.com/types/shared-summary-block";
|
|
45
|
+
/**
|
|
46
|
+
* {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}
|
|
47
|
+
*/
|
|
48
|
+
SharedSummaryBlockFactory.Attributes = {
|
|
49
|
+
type: SharedSummaryBlockFactory.Type,
|
|
50
|
+
snapshotFormatVersion: "0.1",
|
|
51
|
+
packageVersion: pkgVersion,
|
|
52
|
+
};
|
|
53
53
|
/**
|
|
54
54
|
* {@inheritDoc ISharedSummaryBlock}
|
|
55
55
|
* @alpha
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sharedSummaryBlockFactory.js","sourceRoot":"","sources":["../src/sharedSummaryBlockFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAGrF,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,yB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AM,CAAC,MAAM,kBAAkB,GAAG,sBAAsB,CAAC,yBAAyB,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIChannelAttributes,\n\tIChannelFactory,\n\tIFluidDataStoreRuntime,\n\tIChannelServices,\n} from \"@fluidframework/datastore-definitions/internal\";\nimport { createSharedObjectKind } from \"@fluidframework/shared-object-base/internal\";\n\nimport type { ISharedSummaryBlock } from \"./interfaces.js\";\nimport { pkgVersion } from \"./packageVersion.js\";\nimport { SharedSummaryBlockClass } from \"./sharedSummaryBlock.js\";\n\n/**\n * The factory that defines the shared summary block.\n */\nexport class SharedSummaryBlockFactory implements IChannelFactory<ISharedSummaryBlock> {\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<ISharedSummaryBlock> {\n\t\tconst sharedSummaryBlock = new SharedSummaryBlockClass(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): ISharedSummaryBlock {\n\t\tconst sharedSummaryBlock = new SharedSummaryBlockClass(\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\n/**\n * {@inheritDoc ISharedSummaryBlock}\n * @alpha\n */\nexport const SharedSummaryBlock = createSharedObjectKind(SharedSummaryBlockFactory);\n\n/**\n * {@inheritDoc ISharedSummaryBlock}\n * @alpha\n */\nexport type SharedSummaryBlock = ISharedSummaryBlock;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/shared-summary-block",
|
|
3
|
-
"version": "2.0.0-dev-rc.5.0.0.
|
|
3
|
+
"version": "2.0.0-dev-rc.5.0.0.271717",
|
|
4
4
|
"description": "A DDS that does not generate ops but is part of summary",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -67,24 +67,24 @@
|
|
|
67
67
|
"temp-directory": "nyc/.nyc_output"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@fluidframework/core-interfaces": "2.0.0-dev-rc.5.0.0.
|
|
71
|
-
"@fluidframework/datastore-definitions": "2.0.0-dev-rc.5.0.0.
|
|
72
|
-
"@fluidframework/driver-definitions": "2.0.0-dev-rc.5.0.0.
|
|
73
|
-
"@fluidframework/driver-utils": "2.0.0-dev-rc.5.0.0.
|
|
74
|
-
"@fluidframework/runtime-definitions": "2.0.0-dev-rc.5.0.0.
|
|
75
|
-
"@fluidframework/shared-object-base": "2.0.0-dev-rc.5.0.0.
|
|
70
|
+
"@fluidframework/core-interfaces": "2.0.0-dev-rc.5.0.0.271717",
|
|
71
|
+
"@fluidframework/datastore-definitions": "2.0.0-dev-rc.5.0.0.271717",
|
|
72
|
+
"@fluidframework/driver-definitions": "2.0.0-dev-rc.5.0.0.271717",
|
|
73
|
+
"@fluidframework/driver-utils": "2.0.0-dev-rc.5.0.0.271717",
|
|
74
|
+
"@fluidframework/runtime-definitions": "2.0.0-dev-rc.5.0.0.271717",
|
|
75
|
+
"@fluidframework/shared-object-base": "2.0.0-dev-rc.5.0.0.271717"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
78
|
"@arethetypeswrong/cli": "^0.15.2",
|
|
79
79
|
"@biomejs/biome": "^1.7.3",
|
|
80
|
-
"@fluid-internal/mocha-test-setup": "2.0.0-dev-rc.5.0.0.
|
|
80
|
+
"@fluid-internal/mocha-test-setup": "2.0.0-dev-rc.5.0.0.271717",
|
|
81
81
|
"@fluid-tools/build-cli": "^0.39.0",
|
|
82
82
|
"@fluidframework/build-common": "^2.0.3",
|
|
83
83
|
"@fluidframework/build-tools": "^0.39.0",
|
|
84
|
-
"@fluidframework/container-definitions": "2.0.0-dev-rc.5.0.0.
|
|
84
|
+
"@fluidframework/container-definitions": "2.0.0-dev-rc.5.0.0.271717",
|
|
85
85
|
"@fluidframework/eslint-config-fluid": "^5.3.0",
|
|
86
86
|
"@fluidframework/shared-summary-block-previous": "npm:@fluidframework/shared-summary-block@2.0.0-rc.4.0.0",
|
|
87
|
-
"@fluidframework/test-runtime-utils": "2.0.0-dev-rc.5.0.0.
|
|
87
|
+
"@fluidframework/test-runtime-utils": "2.0.0-dev-rc.5.0.0.271717",
|
|
88
88
|
"@microsoft/api-extractor": "^7.45.1",
|
|
89
89
|
"@types/benchmark": "^2.1.0",
|
|
90
90
|
"@types/mocha": "^9.1.1",
|
package/src/packageVersion.ts
CHANGED