@fluidframework/shared-summary-block 0.54.0-47413 → 0.55.0-48551
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 +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/sharedSummaryBlock.d.ts +5 -5
- package/dist/sharedSummaryBlock.d.ts.map +1 -1
- package/dist/sharedSummaryBlock.js +3 -18
- package/dist/sharedSummaryBlock.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.d.ts +5 -5
- package/lib/sharedSummaryBlock.d.ts.map +1 -1
- package/lib/sharedSummaryBlock.js +4 -19
- package/lib/sharedSummaryBlock.js.map +1 -1
- package/package.json +17 -15
- package/src/packageVersion.ts +1 -1
- package/src/sharedSummaryBlock.ts +7 -26
package/.eslintrc.js
CHANGED
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 = "0.
|
|
8
|
+
export declare const pkgVersion = "0.55.0-48551";
|
|
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 = "0.
|
|
11
|
+
exports.pkgVersion = "0.55.0-48551";
|
|
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,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 = \"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 = \"0.55.0-48551\";\n"]}
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
6
|
-
import { ISequencedDocumentMessage, ITree } from "@fluidframework/protocol-definitions";
|
|
5
|
+
import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
7
6
|
import { IChannelAttributes, IFluidDataStoreRuntime, IChannelStorageService, Jsonable, IChannelFactory } from "@fluidframework/datastore-definitions";
|
|
8
|
-
import {
|
|
7
|
+
import { ISummaryTreeWithStats } from "@fluidframework/runtime-definitions";
|
|
8
|
+
import { IFluidSerializer, SharedObject } from "@fluidframework/shared-object-base";
|
|
9
9
|
import { ISharedSummaryBlock } from "./interfaces";
|
|
10
10
|
/**
|
|
11
11
|
* Implementation of a shared summary block. It does not generate any ops. It is only part of the summary.
|
|
@@ -48,9 +48,9 @@ export declare class SharedSummaryBlock extends SharedObject implements ISharedS
|
|
|
48
48
|
*/
|
|
49
49
|
set<T>(key: string, value: Jsonable<T>): void;
|
|
50
50
|
/**
|
|
51
|
-
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.
|
|
51
|
+
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}
|
|
52
52
|
*/
|
|
53
|
-
protected
|
|
53
|
+
protected summarizeCore(serializer: IFluidSerializer, fullTree: boolean): ISummaryTreeWithStats;
|
|
54
54
|
/**
|
|
55
55
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}
|
|
56
56
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sharedSummaryBlock.d.ts","sourceRoot":"","sources":["../src/sharedSummaryBlock.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,
|
|
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,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,sBAAsB,EAAE,UAAU,EAAE,kBAAkB;IAIvF;;OAEG;IACI,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC;IAIvC;;OAEG;IACI,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI;IAMpD;;OAEG;IACH,SAAS,CAAC,aAAa,CAAC,UAAU,EAAE,gBAAgB,EAAE,QAAQ,EAAE,OAAO,GAAG,qBAAqB;IAQ/F;;OAEG;cACa,QAAQ,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;IAOxE;;OAEG;IACH,SAAS,CAAC,YAAY;IAEtB;;OAEG;IACH,SAAS,CAAC,YAAY;IAEtB;;OAEG;IACH,SAAS,CAAC,WAAW,CAAC,OAAO,EAAE,yBAAyB,EAAE,KAAK,EAAE,OAAO;IAIxE,SAAS,CAAC,cAAc;CAG3B"}
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.SharedSummaryBlock = void 0;
|
|
8
|
-
const protocol_definitions_1 = require("@fluidframework/protocol-definitions");
|
|
9
8
|
const driver_utils_1 = require("@fluidframework/driver-utils");
|
|
10
9
|
const shared_object_base_1 = require("@fluidframework/shared-object-base");
|
|
11
10
|
const sharedSummaryBlockFactory_1 = require("./sharedSummaryBlockFactory");
|
|
@@ -63,28 +62,14 @@ class SharedSummaryBlock extends shared_object_base_1.SharedObject {
|
|
|
63
62
|
this.dirty();
|
|
64
63
|
}
|
|
65
64
|
/**
|
|
66
|
-
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.
|
|
65
|
+
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}
|
|
67
66
|
*/
|
|
68
|
-
|
|
67
|
+
summarizeCore(serializer, fullTree) {
|
|
69
68
|
const contentsBlob = {};
|
|
70
69
|
this.data.forEach((value, key) => {
|
|
71
70
|
contentsBlob[key] = value;
|
|
72
71
|
});
|
|
73
|
-
|
|
74
|
-
const tree = {
|
|
75
|
-
entries: [
|
|
76
|
-
{
|
|
77
|
-
mode: protocol_definitions_1.FileMode.File,
|
|
78
|
-
path: snapshotFileName,
|
|
79
|
-
type: protocol_definitions_1.TreeEntry.Blob,
|
|
80
|
-
value: {
|
|
81
|
-
contents: JSON.stringify(contentsBlob),
|
|
82
|
-
encoding: "utf-8",
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
],
|
|
86
|
-
};
|
|
87
|
-
return tree;
|
|
72
|
+
return shared_object_base_1.createSingleBlobSummary(snapshotFileName, JSON.stringify(contentsBlob));
|
|
88
73
|
}
|
|
89
74
|
/**
|
|
90
75
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sharedSummaryBlock.js","sourceRoot":"","sources":["../src/sharedSummaryBlock.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;
|
|
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,CAAC,CAAC;QAdnC;;WAEG;QACc,SAAI,GAAG,IAAI,GAAG,EAAoB,CA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;OAEG;IACO,YAAY,KAAK,CAAC;IAE5B;;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;AA/FD,gDA+FC","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);\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, fullTree: boolean): 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.registerCore}\n */\n protected registerCore() { }\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"]}
|
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 = "0.
|
|
8
|
+
export declare const pkgVersion = "0.55.0-48551";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
package/lib/packageVersion.js
CHANGED
|
@@ -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,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 = \"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 = \"0.55.0-48551\";\n"]}
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
6
|
-
import { ISequencedDocumentMessage, ITree } from "@fluidframework/protocol-definitions";
|
|
5
|
+
import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
7
6
|
import { IChannelAttributes, IFluidDataStoreRuntime, IChannelStorageService, Jsonable, IChannelFactory } from "@fluidframework/datastore-definitions";
|
|
8
|
-
import {
|
|
7
|
+
import { ISummaryTreeWithStats } from "@fluidframework/runtime-definitions";
|
|
8
|
+
import { IFluidSerializer, SharedObject } from "@fluidframework/shared-object-base";
|
|
9
9
|
import { ISharedSummaryBlock } from "./interfaces";
|
|
10
10
|
/**
|
|
11
11
|
* Implementation of a shared summary block. It does not generate any ops. It is only part of the summary.
|
|
@@ -48,9 +48,9 @@ export declare class SharedSummaryBlock extends SharedObject implements ISharedS
|
|
|
48
48
|
*/
|
|
49
49
|
set<T>(key: string, value: Jsonable<T>): void;
|
|
50
50
|
/**
|
|
51
|
-
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.
|
|
51
|
+
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}
|
|
52
52
|
*/
|
|
53
|
-
protected
|
|
53
|
+
protected summarizeCore(serializer: IFluidSerializer, fullTree: boolean): ISummaryTreeWithStats;
|
|
54
54
|
/**
|
|
55
55
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}
|
|
56
56
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sharedSummaryBlock.d.ts","sourceRoot":"","sources":["../src/sharedSummaryBlock.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,
|
|
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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
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { FileMode, TreeEntry, } from "@fluidframework/protocol-definitions";
|
|
6
5
|
import { readAndParse } from "@fluidframework/driver-utils";
|
|
7
|
-
import { SharedObject, } from "@fluidframework/shared-object-base";
|
|
6
|
+
import { createSingleBlobSummary, SharedObject, } from "@fluidframework/shared-object-base";
|
|
8
7
|
import { SharedSummaryBlockFactory } from "./sharedSummaryBlockFactory";
|
|
9
8
|
const snapshotFileName = "header";
|
|
10
9
|
/**
|
|
@@ -60,28 +59,14 @@ export class SharedSummaryBlock extends SharedObject {
|
|
|
60
59
|
this.dirty();
|
|
61
60
|
}
|
|
62
61
|
/**
|
|
63
|
-
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.
|
|
62
|
+
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}
|
|
64
63
|
*/
|
|
65
|
-
|
|
64
|
+
summarizeCore(serializer, fullTree) {
|
|
66
65
|
const contentsBlob = {};
|
|
67
66
|
this.data.forEach((value, key) => {
|
|
68
67
|
contentsBlob[key] = value;
|
|
69
68
|
});
|
|
70
|
-
|
|
71
|
-
const tree = {
|
|
72
|
-
entries: [
|
|
73
|
-
{
|
|
74
|
-
mode: FileMode.File,
|
|
75
|
-
path: snapshotFileName,
|
|
76
|
-
type: TreeEntry.Blob,
|
|
77
|
-
value: {
|
|
78
|
-
contents: JSON.stringify(contentsBlob),
|
|
79
|
-
encoding: "utf-8",
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
],
|
|
83
|
-
};
|
|
84
|
-
return tree;
|
|
69
|
+
return createSingleBlobSummary(snapshotFileName, JSON.stringify(contentsBlob));
|
|
85
70
|
}
|
|
86
71
|
/**
|
|
87
72
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sharedSummaryBlock.js","sourceRoot":"","sources":["../src/sharedSummaryBlock.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
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,EACH,uBAAuB,EAEvB,YAAY,GACf,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;IA0BhD;;;;;;;OAOG;IACH,YAAY,EAAU,EAAE,OAA+B,EAAE,UAA8B;QACnF,KAAK,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QAdnC;;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,yBAAyB,CAAC,IAAI,CAAuB,CAAC;IAC3F,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,UAAU;QACpB,OAAO,IAAI,yBAAyB,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,EAAE,QAAiB;QACnE,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,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,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);\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, fullTree: boolean): 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.registerCore}\n */\n protected registerCore() { }\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"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/shared-summary-block",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.55.0-48551",
|
|
4
4
|
"description": "A DDS that does not generate ops but is part of summary",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": "https://github.com/microsoft/FluidFramework",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"ci:build:docs": "api-extractor run --typescript-compiler-folder ../../../node_modules/typescript && copyfiles -u 1 ./_api-extractor-temp/* ../../../_api-extractor-temp/",
|
|
25
25
|
"clean": "rimraf dist lib *.tsbuildinfo *.build.log",
|
|
26
26
|
"eslint": "eslint --format stylish src",
|
|
27
|
-
"eslint:fix": "eslint --format stylish src --fix",
|
|
27
|
+
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
|
|
28
28
|
"lint": "npm run eslint",
|
|
29
29
|
"lint:fix": "npm run eslint:fix",
|
|
30
30
|
"test": "npm run test:mocha",
|
|
@@ -58,33 +58,35 @@
|
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@fluidframework/common-utils": "^0.32.1",
|
|
60
60
|
"@fluidframework/core-interfaces": "^0.41.0",
|
|
61
|
-
"@fluidframework/datastore-definitions": "0.
|
|
62
|
-
"@fluidframework/driver-utils": "0.
|
|
61
|
+
"@fluidframework/datastore-definitions": "0.55.0-48551",
|
|
62
|
+
"@fluidframework/driver-utils": "0.55.0-48551",
|
|
63
63
|
"@fluidframework/protocol-definitions": "^0.1026.0",
|
|
64
|
-
"@fluidframework/
|
|
64
|
+
"@fluidframework/runtime-definitions": "0.55.0-48551",
|
|
65
|
+
"@fluidframework/shared-object-base": "0.55.0-48551"
|
|
65
66
|
},
|
|
66
67
|
"devDependencies": {
|
|
67
68
|
"@fluidframework/build-common": "^0.23.0",
|
|
68
|
-
"@fluidframework/eslint-config-fluid": "^0.
|
|
69
|
-
"@fluidframework/mocha-test-setup": "0.
|
|
70
|
-
"@fluidframework/test-runtime-utils": "0.
|
|
69
|
+
"@fluidframework/eslint-config-fluid": "^0.25.0-0",
|
|
70
|
+
"@fluidframework/mocha-test-setup": "0.55.0-48551",
|
|
71
|
+
"@fluidframework/test-runtime-utils": "0.55.0-48551",
|
|
71
72
|
"@microsoft/api-extractor": "^7.16.1",
|
|
73
|
+
"@rushstack/eslint-config": "^2.5.1",
|
|
72
74
|
"@types/benchmark": "^2.1.0",
|
|
73
75
|
"@types/mocha": "^8.2.2",
|
|
74
76
|
"@types/node": "^14.18.0",
|
|
75
|
-
"@typescript-eslint/eslint-plugin": "~
|
|
76
|
-
"@typescript-eslint/parser": "~
|
|
77
|
+
"@typescript-eslint/eslint-plugin": "~5.9.0",
|
|
78
|
+
"@typescript-eslint/parser": "~5.9.0",
|
|
77
79
|
"benchmark": "^2.1.4",
|
|
78
80
|
"concurrently": "^6.2.0",
|
|
79
81
|
"copyfiles": "^2.1.0",
|
|
80
82
|
"cross-env": "^7.0.2",
|
|
81
|
-
"eslint": "~
|
|
83
|
+
"eslint": "~8.6.0",
|
|
84
|
+
"eslint-plugin-editorconfig": "~3.2.0",
|
|
82
85
|
"eslint-plugin-eslint-comments": "~3.2.0",
|
|
83
|
-
"eslint-plugin-import": "~2.
|
|
86
|
+
"eslint-plugin-import": "~2.25.4",
|
|
84
87
|
"eslint-plugin-no-null": "~1.0.2",
|
|
85
|
-
"eslint-plugin-
|
|
86
|
-
"eslint-plugin-
|
|
87
|
-
"eslint-plugin-unicorn": "~26.0.1",
|
|
88
|
+
"eslint-plugin-react": "~7.28.0",
|
|
89
|
+
"eslint-plugin-unicorn": "~40.0.0",
|
|
88
90
|
"mocha": "^8.4.0",
|
|
89
91
|
"nyc": "^15.0.0",
|
|
90
92
|
"rimraf": "^2.6.2",
|
package/src/packageVersion.ts
CHANGED
|
@@ -3,13 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
FileMode,
|
|
9
|
-
ISequencedDocumentMessage,
|
|
10
|
-
ITree,
|
|
11
|
-
TreeEntry,
|
|
12
|
-
} from "@fluidframework/protocol-definitions";
|
|
6
|
+
import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
13
7
|
import {
|
|
14
8
|
IChannelAttributes,
|
|
15
9
|
IFluidDataStoreRuntime,
|
|
@@ -17,8 +11,11 @@ import {
|
|
|
17
11
|
Jsonable,
|
|
18
12
|
IChannelFactory,
|
|
19
13
|
} from "@fluidframework/datastore-definitions";
|
|
14
|
+
import { ISummaryTreeWithStats } from "@fluidframework/runtime-definitions";
|
|
20
15
|
import { readAndParse } from "@fluidframework/driver-utils";
|
|
21
16
|
import {
|
|
17
|
+
createSingleBlobSummary,
|
|
18
|
+
IFluidSerializer,
|
|
22
19
|
SharedObject,
|
|
23
20
|
} from "@fluidframework/shared-object-base";
|
|
24
21
|
import { SharedSummaryBlockFactory } from "./sharedSummaryBlockFactory";
|
|
@@ -93,30 +90,14 @@ export class SharedSummaryBlock extends SharedObject implements ISharedSummaryBl
|
|
|
93
90
|
}
|
|
94
91
|
|
|
95
92
|
/**
|
|
96
|
-
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.
|
|
93
|
+
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}
|
|
97
94
|
*/
|
|
98
|
-
protected
|
|
95
|
+
protected summarizeCore(serializer: IFluidSerializer, fullTree: boolean): ISummaryTreeWithStats {
|
|
99
96
|
const contentsBlob: ISharedSummaryBlockDataSerializable = {};
|
|
100
97
|
this.data.forEach((value, key) => {
|
|
101
98
|
contentsBlob[key] = value;
|
|
102
99
|
});
|
|
103
|
-
|
|
104
|
-
// Construct the tree for the data.
|
|
105
|
-
const tree: ITree = {
|
|
106
|
-
entries: [
|
|
107
|
-
{
|
|
108
|
-
mode: FileMode.File,
|
|
109
|
-
path: snapshotFileName,
|
|
110
|
-
type: TreeEntry.Blob,
|
|
111
|
-
value: {
|
|
112
|
-
contents: JSON.stringify(contentsBlob),
|
|
113
|
-
encoding: "utf-8",
|
|
114
|
-
},
|
|
115
|
-
},
|
|
116
|
-
],
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
return tree;
|
|
100
|
+
return createSingleBlobSummary(snapshotFileName, JSON.stringify(contentsBlob));
|
|
120
101
|
}
|
|
121
102
|
|
|
122
103
|
/**
|