@fluidframework/shared-summary-block 1.4.0-121020 → 2.0.0-dev-rc.1.0.0.225277
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 +5 -7
- package/.mocharc.js +12 -0
- package/CHANGELOG.md +135 -0
- package/README.md +22 -1
- package/api-extractor-esm.json +4 -0
- package/api-extractor-lint.json +4 -0
- package/api-extractor.json +2 -2
- package/api-report/shared-summary-block.api.md +62 -0
- package/dist/index.cjs +12 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/{interfaces.js → interfaces.cjs} +1 -1
- package/dist/interfaces.cjs.map +1 -0
- package/dist/interfaces.d.ts +4 -0
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/{packageVersion.js → packageVersion.cjs} +2 -2
- package/dist/packageVersion.cjs.map +1 -0
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/shared-summary-block-alpha.d.ts +100 -0
- package/dist/shared-summary-block-beta.d.ts +21 -0
- package/dist/shared-summary-block-public.d.ts +21 -0
- package/dist/shared-summary-block-untrimmed.d.ts +131 -0
- package/dist/{sharedSummaryBlock.js → sharedSummaryBlock.cjs} +18 -17
- package/dist/sharedSummaryBlock.cjs.map +1 -0
- package/dist/sharedSummaryBlock.d.ts +1 -0
- package/dist/sharedSummaryBlock.d.ts.map +1 -1
- package/dist/{sharedSummaryBlockFactory.js → sharedSummaryBlockFactory.cjs} +5 -3
- package/dist/sharedSummaryBlockFactory.cjs.map +1 -0
- package/dist/sharedSummaryBlockFactory.d.ts +2 -0
- package/dist/sharedSummaryBlockFactory.d.ts.map +1 -1
- package/dist/tsdoc-metadata.json +11 -0
- package/lib/index.d.mts +8 -0
- package/lib/index.d.mts.map +1 -0
- package/lib/index.mjs +7 -0
- package/lib/index.mjs.map +1 -0
- package/lib/{interfaces.d.ts → interfaces.d.mts} +5 -1
- package/lib/interfaces.d.mts.map +1 -0
- package/lib/{interfaces.js → interfaces.mjs} +1 -1
- package/lib/interfaces.mjs.map +1 -0
- package/lib/{packageVersion.d.ts → packageVersion.d.mts} +2 -2
- package/lib/packageVersion.d.mts.map +1 -0
- package/lib/{packageVersion.js → packageVersion.mjs} +2 -2
- package/lib/packageVersion.mjs.map +1 -0
- package/lib/shared-summary-block-alpha.d.mts +100 -0
- package/lib/shared-summary-block-beta.d.mts +21 -0
- package/lib/shared-summary-block-public.d.mts +21 -0
- package/lib/shared-summary-block-untrimmed.d.mts +131 -0
- package/lib/{sharedSummaryBlock.d.ts → sharedSummaryBlock.d.mts} +3 -2
- package/lib/sharedSummaryBlock.d.mts.map +1 -0
- package/lib/{sharedSummaryBlock.js → sharedSummaryBlock.mjs} +18 -17
- package/lib/sharedSummaryBlock.mjs.map +1 -0
- package/lib/{sharedSummaryBlockFactory.d.ts → sharedSummaryBlockFactory.d.mts} +3 -1
- package/lib/sharedSummaryBlockFactory.d.mts.map +1 -0
- package/lib/{sharedSummaryBlockFactory.js → sharedSummaryBlockFactory.mjs} +5 -3
- package/lib/sharedSummaryBlockFactory.mjs.map +1 -0
- package/package.json +133 -62
- package/prettier.config.cjs +8 -0
- package/src/index.ts +3 -3
- package/src/interfaces.ts +16 -12
- package/src/packageVersion.ts +1 -1
- package/src/sharedSummaryBlock.ts +92 -88
- package/src/sharedSummaryBlockFactory.ts +56 -51
- package/tsc-multi.test.json +4 -0
- package/tsconfig.json +11 -13
- package/dist/index.js +0 -20
- package/dist/index.js.map +0 -1
- package/dist/interfaces.js.map +0 -1
- package/dist/packageVersion.js.map +0 -1
- package/dist/sharedSummaryBlock.js.map +0 -1
- package/dist/sharedSummaryBlockFactory.js.map +0 -1
- package/lib/index.d.ts +0 -8
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -8
- package/lib/index.js.map +0 -1
- package/lib/interfaces.d.ts.map +0 -1
- package/lib/interfaces.js.map +0 -1
- package/lib/packageVersion.d.ts.map +0 -1
- package/lib/packageVersion.js.map +0 -1
- package/lib/sharedSummaryBlock.d.ts.map +0 -1
- package/lib/sharedSummaryBlock.js.map +0 -1
- package/lib/sharedSummaryBlockFactory.d.ts.map +0 -1
- package/lib/sharedSummaryBlockFactory.js.map +0 -1
- package/tsconfig.esnext.json +0 -7
|
@@ -6,7 +6,9 @@ import { IChannelAttributes, IFluidDataStoreRuntime, IChannelServices, IChannelF
|
|
|
6
6
|
import { ISharedObject } from "@fluidframework/shared-object-base";
|
|
7
7
|
/**
|
|
8
8
|
* The factory that defines the shared summary block.
|
|
9
|
+
*
|
|
9
10
|
* @sealed
|
|
11
|
+
* @internal
|
|
10
12
|
*/
|
|
11
13
|
export declare class SharedSummaryBlockFactory implements IChannelFactory {
|
|
12
14
|
/**
|
|
@@ -34,4 +36,4 @@ export declare class SharedSummaryBlockFactory implements IChannelFactory {
|
|
|
34
36
|
*/
|
|
35
37
|
create(runtime: IFluidDataStoreRuntime, id: string): ISharedObject;
|
|
36
38
|
}
|
|
37
|
-
//# sourceMappingURL=sharedSummaryBlockFactory.d.
|
|
39
|
+
//# sourceMappingURL=sharedSummaryBlockFactory.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sharedSummaryBlockFactory.d.mts","sourceRoot":"","sources":["../src/sharedSummaryBlockFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EACN,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EACf,MAAM,uCAAuC;OACvC,EAAE,aAAa,EAAE,MAAM,oCAAoC;AAIlE;;;;;GAKG;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,QAAQ,EAAE,gBAAgB,EAC1B,UAAU,EAAE,kBAAkB,GAC5B,OAAO,CAAC,aAAa,CAAC;IAOzB;;OAEG;IACI,MAAM,CAAC,OAAO,EAAE,sBAAsB,EAAE,EAAE,EAAE,MAAM,GAAG,aAAa;CAUzE"}
|
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { pkgVersion } from "./packageVersion";
|
|
6
|
-
import { SharedSummaryBlock } from "./sharedSummaryBlock";
|
|
5
|
+
import { pkgVersion } from "./packageVersion.mjs";
|
|
6
|
+
import { SharedSummaryBlock } from "./sharedSummaryBlock.mjs";
|
|
7
7
|
/**
|
|
8
8
|
* The factory that defines the shared summary block.
|
|
9
|
+
*
|
|
9
10
|
* @sealed
|
|
11
|
+
* @internal
|
|
10
12
|
*/
|
|
11
13
|
export class SharedSummaryBlockFactory {
|
|
12
14
|
/**
|
|
@@ -50,4 +52,4 @@ SharedSummaryBlockFactory.Attributes = {
|
|
|
50
52
|
snapshotFormatVersion: "0.1",
|
|
51
53
|
packageVersion: pkgVersion,
|
|
52
54
|
};
|
|
53
|
-
//# sourceMappingURL=sharedSummaryBlockFactory.
|
|
55
|
+
//# sourceMappingURL=sharedSummaryBlockFactory.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sharedSummaryBlockFactory.mjs","sourceRoot":"","sources":["../src/sharedSummaryBlockFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;OASI,EAAE,UAAU,EAAE;OACd,EAAE,kBAAkB,EAAE;AAE7B;;;;;GAKG;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 *\n * @sealed\n * @internal\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": "1.
|
|
3
|
+
"version": "2.0.0-dev-rc.1.0.0.225277",
|
|
4
4
|
"description": "A DDS that does not generate ops but is part of summary",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -11,45 +11,72 @@
|
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"author": "Microsoft and contributors",
|
|
13
13
|
"sideEffects": false,
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"import": {
|
|
17
|
+
"types": "./lib/index.d.mts",
|
|
18
|
+
"default": "./lib/index.mjs"
|
|
19
|
+
},
|
|
20
|
+
"require": {
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"default": "./dist/index.cjs"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"./alpha": {
|
|
26
|
+
"import": {
|
|
27
|
+
"types": "./lib/shared-summary-block-alpha.d.mts",
|
|
28
|
+
"default": "./lib/index.mjs"
|
|
29
|
+
},
|
|
30
|
+
"require": {
|
|
31
|
+
"types": "./dist/shared-summary-block-alpha.d.ts",
|
|
32
|
+
"default": "./dist/index.cjs"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"./beta": {
|
|
36
|
+
"import": {
|
|
37
|
+
"types": "./lib/shared-summary-block-beta.d.mts",
|
|
38
|
+
"default": "./lib/index.mjs"
|
|
39
|
+
},
|
|
40
|
+
"require": {
|
|
41
|
+
"types": "./dist/shared-summary-block-beta.d.ts",
|
|
42
|
+
"default": "./dist/index.cjs"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"./internal": {
|
|
46
|
+
"import": {
|
|
47
|
+
"types": "./lib/index.d.mts",
|
|
48
|
+
"default": "./lib/index.mjs"
|
|
49
|
+
},
|
|
50
|
+
"require": {
|
|
51
|
+
"types": "./dist/index.d.ts",
|
|
52
|
+
"default": "./dist/index.cjs"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"./public": {
|
|
56
|
+
"import": {
|
|
57
|
+
"types": "./lib/shared-summary-block-public.d.mts",
|
|
58
|
+
"default": "./lib/index.mjs"
|
|
59
|
+
},
|
|
60
|
+
"require": {
|
|
61
|
+
"types": "./dist/shared-summary-block-public.d.ts",
|
|
62
|
+
"default": "./dist/index.cjs"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
41
65
|
},
|
|
42
|
-
"
|
|
66
|
+
"main": "dist/index.cjs",
|
|
67
|
+
"module": "lib/index.mjs",
|
|
68
|
+
"types": "dist/index.d.ts",
|
|
69
|
+
"c8": {
|
|
43
70
|
"all": true,
|
|
44
71
|
"cache-dir": "nyc/.cache",
|
|
45
72
|
"exclude": [
|
|
46
|
-
"src/test
|
|
47
|
-
"dist/test
|
|
73
|
+
"src/test/**/*.*ts",
|
|
74
|
+
"dist/test/**/*.*js"
|
|
48
75
|
],
|
|
49
76
|
"exclude-after-remap": false,
|
|
50
77
|
"include": [
|
|
51
|
-
"src
|
|
52
|
-
"dist
|
|
78
|
+
"src/**/*.*ts",
|
|
79
|
+
"dist/**/*.*js"
|
|
53
80
|
],
|
|
54
81
|
"report-dir": "nyc/report",
|
|
55
82
|
"reporter": [
|
|
@@ -60,41 +87,85 @@
|
|
|
60
87
|
"temp-directory": "nyc/.nyc_output"
|
|
61
88
|
},
|
|
62
89
|
"dependencies": {
|
|
63
|
-
"@fluidframework/
|
|
64
|
-
"@fluidframework/
|
|
65
|
-
"@fluidframework/
|
|
66
|
-
"@fluidframework/
|
|
67
|
-
"@fluidframework/
|
|
68
|
-
"@fluidframework/
|
|
69
|
-
"@fluidframework/shared-object-base": "1.4.0-121020"
|
|
90
|
+
"@fluidframework/core-interfaces": "2.0.0-dev-rc.1.0.0.225277",
|
|
91
|
+
"@fluidframework/datastore-definitions": "2.0.0-dev-rc.1.0.0.225277",
|
|
92
|
+
"@fluidframework/driver-utils": "2.0.0-dev-rc.1.0.0.225277",
|
|
93
|
+
"@fluidframework/protocol-definitions": "^3.1.0-223007",
|
|
94
|
+
"@fluidframework/runtime-definitions": "2.0.0-dev-rc.1.0.0.225277",
|
|
95
|
+
"@fluidframework/shared-object-base": "2.0.0-dev-rc.1.0.0.225277"
|
|
70
96
|
},
|
|
71
97
|
"devDependencies": {
|
|
72
|
-
"@
|
|
73
|
-
"@
|
|
74
|
-
"@fluidframework/
|
|
75
|
-
"@fluidframework/
|
|
76
|
-
"@fluidframework/
|
|
77
|
-
"@fluidframework/test-
|
|
78
|
-
"@
|
|
79
|
-
"@
|
|
98
|
+
"@arethetypeswrong/cli": "^0.13.3",
|
|
99
|
+
"@fluid-tools/build-cli": "0.29.0-222379",
|
|
100
|
+
"@fluidframework/build-common": "^2.0.3",
|
|
101
|
+
"@fluidframework/build-tools": "0.29.0-222379",
|
|
102
|
+
"@fluidframework/eslint-config-fluid": "^3.1.0",
|
|
103
|
+
"@fluidframework/mocha-test-setup": "2.0.0-dev-rc.1.0.0.225277",
|
|
104
|
+
"@fluidframework/shared-summary-block-previous": "npm:@fluidframework/shared-summary-block@2.0.0-internal.8.0.0",
|
|
105
|
+
"@fluidframework/test-runtime-utils": "2.0.0-dev-rc.1.0.0.225277",
|
|
106
|
+
"@microsoft/api-extractor": "^7.38.3",
|
|
80
107
|
"@types/benchmark": "^2.1.0",
|
|
81
108
|
"@types/mocha": "^9.1.1",
|
|
82
|
-
"@types/node": "^
|
|
109
|
+
"@types/node": "^18.19.0",
|
|
83
110
|
"benchmark": "^2.1.4",
|
|
84
|
-
"
|
|
85
|
-
"copyfiles": "^2.1
|
|
86
|
-
"cross-env": "^7.0.
|
|
87
|
-
"eslint": "~8.
|
|
88
|
-
"mocha": "^10.
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
"
|
|
111
|
+
"c8": "^8.0.1",
|
|
112
|
+
"copyfiles": "^2.4.1",
|
|
113
|
+
"cross-env": "^7.0.3",
|
|
114
|
+
"eslint": "~8.50.0",
|
|
115
|
+
"mocha": "^10.2.0",
|
|
116
|
+
"mocha-json-output-reporter": "^2.0.1",
|
|
117
|
+
"mocha-multi-reporters": "^1.5.1",
|
|
118
|
+
"moment": "^2.21.0",
|
|
119
|
+
"prettier": "~3.0.3",
|
|
120
|
+
"replace-in-file": "^6.3.5",
|
|
121
|
+
"rimraf": "^4.4.0",
|
|
122
|
+
"tsc-multi": "^1.1.0",
|
|
123
|
+
"typescript": "~5.1.6"
|
|
124
|
+
},
|
|
125
|
+
"fluidBuild": {
|
|
126
|
+
"tasks": {
|
|
127
|
+
"build:docs": {
|
|
128
|
+
"dependsOn": [
|
|
129
|
+
"...",
|
|
130
|
+
"api-extractor:commonjs",
|
|
131
|
+
"api-extractor:esnext"
|
|
132
|
+
],
|
|
133
|
+
"script": false
|
|
134
|
+
}
|
|
135
|
+
}
|
|
93
136
|
},
|
|
94
137
|
"typeValidation": {
|
|
95
|
-
"version": "1.4.0",
|
|
96
|
-
"baselineRange": "~1.3.0",
|
|
97
|
-
"baselineVersion": "1.3.1",
|
|
98
138
|
"broken": {}
|
|
139
|
+
},
|
|
140
|
+
"scripts": {
|
|
141
|
+
"api": "fluid-build . --task api",
|
|
142
|
+
"api-extractor:commonjs": "api-extractor run --local",
|
|
143
|
+
"api-extractor:esnext": "api-extractor run --config ./api-extractor-esm.json",
|
|
144
|
+
"build": "fluid-build . --task build",
|
|
145
|
+
"build:commonjs": "fluid-build . --task commonjs",
|
|
146
|
+
"build:compile": "fluid-build . --task compile",
|
|
147
|
+
"build:compile:min": "npm run build:compile",
|
|
148
|
+
"build:docs": "fluid-build . --task api",
|
|
149
|
+
"build:esnext": "tsc-multi --config ../../../common/build/build-common/tsc-multi.esm.json",
|
|
150
|
+
"build:genver": "gen-version",
|
|
151
|
+
"build:test": "tsc-multi --config ./tsc-multi.test.json",
|
|
152
|
+
"check:are-the-types-wrong": "attw --pack . --entrypoints .",
|
|
153
|
+
"check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
|
|
154
|
+
"ci:build:docs": "api-extractor run",
|
|
155
|
+
"clean": "rimraf --glob dist lib \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc",
|
|
156
|
+
"eslint": "eslint --format stylish src",
|
|
157
|
+
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
|
|
158
|
+
"format": "npm run prettier:fix",
|
|
159
|
+
"lint": "npm run prettier && npm run check:release-tags && npm run eslint",
|
|
160
|
+
"lint:fix": "npm run prettier:fix && npm run eslint:fix",
|
|
161
|
+
"prettier": "prettier --check . --cache --ignore-path ../../../.prettierignore",
|
|
162
|
+
"prettier:fix": "prettier --write . --cache --ignore-path ../../../.prettierignore",
|
|
163
|
+
"test": "npm run test:mocha",
|
|
164
|
+
"test:coverage": "c8 npm test",
|
|
165
|
+
"test:mocha": "mocha --ignore \"dist/test/types/*\" --recursive dist/test -r node_modules/@fluidframework/mocha-test-setup",
|
|
166
|
+
"test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha",
|
|
167
|
+
"tsc": "tsc-multi --config ../../../common/build/build-common/tsc-multi.cjs.json",
|
|
168
|
+
"typetests:gen": "fluid-type-test-generator",
|
|
169
|
+
"typetests:prepare": "flub typetests --dir . --reset --previous --normalize"
|
|
99
170
|
}
|
|
100
|
-
}
|
|
171
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
6
|
+
export { ISharedSummaryBlock } from "./interfaces";
|
|
7
|
+
export { SharedSummaryBlock } from "./sharedSummaryBlock";
|
|
8
|
+
export { SharedSummaryBlockFactory } from "./sharedSummaryBlockFactory";
|
package/src/interfaces.ts
CHANGED
|
@@ -11,19 +11,23 @@ import { ISharedObject } from "@fluidframework/shared-object-base";
|
|
|
11
11
|
* The set on this interface must only be called in response to a remote op. Basically, if we replay same ops,
|
|
12
12
|
* the set of calls on this interface to set data should be the same. This is critical because the object does not
|
|
13
13
|
* generate ops of its own, but relies on the above principle to maintain eventual consistency and to summarize.
|
|
14
|
+
* @alpha
|
|
14
15
|
*/
|
|
15
16
|
export interface ISharedSummaryBlock extends ISharedObject {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Retrieves the given key from the map.
|
|
19
|
+
* @param key - Key to retrieve from.
|
|
20
|
+
* @returns The stored value, or undefined if the key is not set.
|
|
21
|
+
*
|
|
22
|
+
* @privateRemarks
|
|
23
|
+
* The return type is underspecified to allow for the possibility of objects with function or undefined values.
|
|
24
|
+
*/
|
|
25
|
+
get<T>(key: string): Jsonable<T>;
|
|
22
26
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Sets the value stored at key to the provided value.
|
|
29
|
+
* @param key - Key to set at.
|
|
30
|
+
* @param value - Jsonable type value to set.
|
|
31
|
+
*/
|
|
32
|
+
set<T>(key: string, value: Jsonable<T>): void;
|
|
29
33
|
}
|
package/src/packageVersion.ts
CHANGED
|
@@ -5,18 +5,18 @@
|
|
|
5
5
|
|
|
6
6
|
import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
7
7
|
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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,101 +28,105 @@ const snapshotFileName = "header";
|
|
|
28
28
|
* Directly used in JSON.stringify, direct result from JSON.parse.
|
|
29
29
|
*/
|
|
30
30
|
interface ISharedSummaryBlockDataSerializable {
|
|
31
|
-
|
|
31
|
+
[key: string]: Jsonable<unknown>;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
35
|
* Implementation of a shared summary block. It does not generate any ops. It is only part of the summary.
|
|
36
36
|
* Data should be set in this object in response to a remote op.
|
|
37
|
+
* @alpha
|
|
37
38
|
*/
|
|
38
39
|
export class SharedSummaryBlock extends SharedObject implements ISharedSummaryBlock {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
40
|
+
/**
|
|
41
|
+
* Create a new shared summary block
|
|
42
|
+
*
|
|
43
|
+
* @param runtime - data store runtime the new shared summary block belongs to.
|
|
44
|
+
* @param id - optional name of the shared summary block.
|
|
45
|
+
* @returns newly created shared summary block (but not attached yet).
|
|
46
|
+
*/
|
|
47
|
+
public static create(runtime: IFluidDataStoreRuntime, id?: string) {
|
|
48
|
+
return runtime.createChannel(id, SharedSummaryBlockFactory.Type) as SharedSummaryBlock;
|
|
49
|
+
}
|
|
49
50
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
51
|
+
/**
|
|
52
|
+
* Get a factory for SharedSummaryBlock to register with the data store.
|
|
53
|
+
*
|
|
54
|
+
* @returns a factory that creates and loads SharedSummaryBlock.
|
|
55
|
+
*/
|
|
56
|
+
public static getFactory(): IChannelFactory {
|
|
57
|
+
return new SharedSummaryBlockFactory();
|
|
58
|
+
}
|
|
58
59
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
/**
|
|
61
|
+
* The data held by this object.
|
|
62
|
+
*/
|
|
63
|
+
private readonly data = new Map<string, Jsonable<unknown>>();
|
|
63
64
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
65
|
+
/**
|
|
66
|
+
* Constructs a new SharedSummaryBlock. If the object is non-local, an id and service interfaces will
|
|
67
|
+
* be provided.
|
|
68
|
+
*
|
|
69
|
+
* @param id - optional name of the shared summary block.
|
|
70
|
+
* @param runtime - data store runtime thee object belongs to.
|
|
71
|
+
* @param attributes - The attributes for the object.
|
|
72
|
+
*/
|
|
73
|
+
constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes) {
|
|
74
|
+
super(id, runtime, attributes, "fluid_sharedSummaryBlock_");
|
|
75
|
+
}
|
|
75
76
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
77
|
+
/**
|
|
78
|
+
* {@inheritDoc ISharedSummaryBlock.get}
|
|
79
|
+
*/
|
|
80
|
+
public get<T>(key: string): Jsonable<T> {
|
|
81
|
+
return this.data.get(key) as Jsonable<T>;
|
|
82
|
+
}
|
|
82
83
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
84
|
+
/**
|
|
85
|
+
* {@inheritDoc ISharedSummaryBlock.set}
|
|
86
|
+
*/
|
|
87
|
+
public set<T>(key: string, value: Jsonable<T>): void {
|
|
88
|
+
this.data.set(key, value);
|
|
89
|
+
// Set this object as dirty so that it is part of the next summary.
|
|
90
|
+
this.dirty();
|
|
91
|
+
}
|
|
91
92
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
93
|
+
/**
|
|
94
|
+
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}
|
|
95
|
+
*/
|
|
96
|
+
protected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats {
|
|
97
|
+
const contentsBlob: ISharedSummaryBlockDataSerializable = {};
|
|
98
|
+
this.data.forEach((value, key) => {
|
|
99
|
+
contentsBlob[key] = value;
|
|
100
|
+
});
|
|
101
|
+
return createSingleBlobSummary(snapshotFileName, JSON.stringify(contentsBlob));
|
|
102
|
+
}
|
|
102
103
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
104
|
+
/**
|
|
105
|
+
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}
|
|
106
|
+
*/
|
|
107
|
+
protected async loadCore(storage: IChannelStorageService): Promise<void> {
|
|
108
|
+
const contents = await readAndParse<ISharedSummaryBlockDataSerializable>(
|
|
109
|
+
storage,
|
|
110
|
+
snapshotFileName,
|
|
111
|
+
);
|
|
112
|
+
for (const [key, value] of Object.entries(contents)) {
|
|
113
|
+
this.data.set(key, value);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
112
116
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
+
/**
|
|
118
|
+
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}
|
|
119
|
+
*/
|
|
120
|
+
protected onDisconnect() {}
|
|
117
121
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
/**
|
|
123
|
+
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}
|
|
124
|
+
*/
|
|
125
|
+
protected processCore(message: ISequencedDocumentMessage, local: boolean) {
|
|
126
|
+
throw new Error("shared summary block should not generate any ops.");
|
|
127
|
+
}
|
|
124
128
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
129
|
+
protected applyStashedOp() {
|
|
130
|
+
throw new Error("not implemented");
|
|
131
|
+
}
|
|
128
132
|
}
|