@fluid-experimental/property-dds 2.0.0-internal.7.3.0 → 2.0.0-internal.7.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/api-extractor-lint.json +13 -0
- package/api-extractor.json +2 -2
- package/api-report/property-dds.api.md +17 -17
- package/dist/property-dds-alpha.d.ts +46 -0
- package/dist/property-dds-beta.d.ts +62 -0
- package/dist/property-dds-public.d.ts +62 -0
- package/dist/property-dds-untrimmed.d.ts +306 -0
- package/dist/propertyTree.d.ts +29 -1
- package/dist/propertyTree.d.ts.map +1 -1
- package/dist/propertyTree.js +23 -7
- package/dist/propertyTree.js.map +1 -1
- package/dist/propertyTreeExt.d.ts +4 -0
- package/dist/propertyTreeExt.d.ts.map +1 -1
- package/dist/propertyTreeExt.js +4 -0
- package/dist/propertyTreeExt.js.map +1 -1
- package/dist/propertyTreeExtFactories.d.ts +9 -0
- package/dist/propertyTreeExtFactories.d.ts.map +1 -1
- package/dist/propertyTreeExtFactories.js +9 -0
- package/dist/propertyTreeExtFactories.js.map +1 -1
- package/dist/propertyTreeFactory.d.ts +1 -0
- package/dist/propertyTreeFactory.d.ts.map +1 -1
- package/dist/propertyTreeFactory.js +1 -0
- package/dist/propertyTreeFactory.js.map +1 -1
- package/lib/propertyTree.d.ts +29 -1
- package/lib/propertyTree.d.ts.map +1 -1
- package/lib/propertyTree.js +23 -7
- package/lib/propertyTree.js.map +1 -1
- package/lib/propertyTreeExt.d.ts +4 -0
- package/lib/propertyTreeExt.d.ts.map +1 -1
- package/lib/propertyTreeExt.js +4 -0
- package/lib/propertyTreeExt.js.map +1 -1
- package/lib/propertyTreeExtFactories.d.ts +9 -0
- package/lib/propertyTreeExtFactories.d.ts.map +1 -1
- package/lib/propertyTreeExtFactories.js +9 -0
- package/lib/propertyTreeExtFactories.js.map +1 -1
- package/lib/propertyTreeFactory.d.ts +1 -0
- package/lib/propertyTreeFactory.d.ts.map +1 -1
- package/lib/propertyTreeFactory.js +1 -0
- package/lib/propertyTreeFactory.js.map +1 -1
- package/package.json +25 -23
- package/src/propertyTree.ts +53 -5
- package/src/propertyTreeExt.ts +4 -0
- package/src/propertyTreeExtFactories.ts +9 -0
- package/src/propertyTreeFactory.ts +1 -0
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { IChannelAttributes, IFluidDataStoreRuntime, IChannelServices, IChannelFactory } from "@fluidframework/datastore-definitions";
|
|
2
2
|
import { IPropertyTreeConfig, ISharedPropertyTreeEncDec, SharedPropertyTree, SharedPropertyTreeOptions } from "./propertyTree";
|
|
3
3
|
import { DeflatedPropertyTree, LZ4PropertyTree } from "./propertyTreeExt";
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
4
7
|
export declare abstract class CompressedPropertyTreeFactory implements IChannelFactory {
|
|
5
8
|
abstract get attributes(): any;
|
|
6
9
|
abstract get type(): any;
|
|
@@ -12,6 +15,9 @@ export declare abstract class CompressedPropertyTreeFactory implements IChannelF
|
|
|
12
15
|
load(runtime: IFluidDataStoreRuntime, id: string, services: IChannelServices, attributes: IChannelAttributes, url?: string): Promise<SharedPropertyTree>;
|
|
13
16
|
create(document: IFluidDataStoreRuntime, id: string, requestUrl?: string): SharedPropertyTree;
|
|
14
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
15
21
|
export declare class DeflatedPropertyTreeFactory extends CompressedPropertyTreeFactory {
|
|
16
22
|
static readonly Type = "DeflatedPropertyTree:84534a0fe613522101f6";
|
|
17
23
|
static readonly Attributes: IChannelAttributes;
|
|
@@ -23,6 +29,9 @@ export declare class DeflatedPropertyTreeFactory extends CompressedPropertyTreeF
|
|
|
23
29
|
getDecodeFce(): any;
|
|
24
30
|
newPropertyTree(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes, options: SharedPropertyTreeOptions, propertyTreeConfig: IPropertyTreeConfig): SharedPropertyTree;
|
|
25
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
26
35
|
export declare class LZ4PropertyTreeFactory extends CompressedPropertyTreeFactory {
|
|
27
36
|
static readonly Type = "LZ4PropertyTree:84534a0fe613522101f6";
|
|
28
37
|
static readonly Attributes: IChannelAttributes;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propertyTreeExtFactories.d.ts","sourceRoot":"","sources":["../src/propertyTreeExtFactories.ts"],"names":[],"mappings":"AAQA,OAAO,EACN,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EACf,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACN,mBAAmB,EAEnB,yBAAyB,EAEzB,kBAAkB,EAClB,yBAAyB,EACzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE1E,8BAAsB,6BAA8B,YAAW,eAAe;IAC7E,aAAoB,UAAU,QAAG;IACjC,aAAoB,IAAI,QAAG;aACX,YAAY;aACZ,YAAY;IAC5B,OAAO,CAAC,wBAAwB;IA4CzB,SAAS,IAAI,yBAAyB;aAG7B,eAAe,CAC9B,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,sBAAsB,EAC/B,UAAU,EAAE,kBAAkB,EAC9B,OAAO,EAAE,yBAAyB,EAClC,kBAAkB,EAAE,mBAAmB,GACrC,kBAAkB;IAER,IAAI,CAChB,OAAO,EAAE,sBAAsB,EAC/B,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,gBAAgB,EAC1B,UAAU,EAAE,kBAAkB,EAC9B,GAAG,CAAC,EAAE,MAAM,GACV,OAAO,CAAC,kBAAkB,CAAC;IAavB,MAAM,CACZ,QAAQ,EAAE,sBAAsB,EAChC,EAAE,EAAE,MAAM,EACV,UAAU,CAAC,EAAE,MAAM,GACjB,kBAAkB;CAYrB;AAED,qBAAa,2BAA4B,SAAQ,6BA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BAAkB,EAC9B,GAAG,CAAC,EAAE,MAAM,GACV,OAAO,CAAC,oBAAoB,CAAC;IAIzB,MAAM,CACZ,QAAQ,EAAE,sBAAsB,EAChC,EAAE,EAAE,MAAM,EACV,UAAU,CAAC,EAAE,MAAM,GACjB,oBAAoB;IAIvB,IAAW,IAAI,WAEd;IAED,IAAW,UAAU,uBAEpB;IAEM,YAAY;IAGZ,YAAY;IAGZ,eAAe,CACrB,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,sBAAsB,EAC/B,UAAU,EAAE,kBAAkB,EAC9B,OAAO,EAAE,yBAAyB,EAClC,kBAAkB,EAAE,mBAAmB,GACrC,kBAAkB;CAGrB;AAED;;GAEG;AACH,qBAAa,sBAAuB,SAAQ,6BAA6B;IACxE,gBAAuB,IAAI,0CAA0C;IAErE,gBAAuB,UAAU,EAAE,kBAAkB,CAInD;IAEW,IAAI,CAChB,OAAO,EAAE,sBAAsB,EAC/B,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,gBAAgB,EAC1B,UAAU,EAAE,kBAAkB,EAC9B,GAAG,CAAC,EAAE,MAAM,GACV,OAAO,CAAC,eAAe,CAAC;IAIpB,MAAM,CACZ,QAAQ,EAAE,sBAAsB,EAChC,EAAE,EAAE,MAAM,EACV,UAAU,CAAC,EAAE,MAAM,GACjB,eAAe;IAIlB,IAAW,IAAI,WAEd;IAED,IAAW,UAAU,uBAEpB;IAEM,YAAY;IAGZ,YAAY;IAGZ,eAAe,CACrB,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,sBAAsB,EAC/B,UAAU,EAAE,kBAAkB,EAC9B,OAAO,EAAE,yBAAyB,EAClC,kBAAkB,EAAE,mBAAmB,GACrC,kBAAkB;CAGrB"}
|
|
@@ -7,6 +7,9 @@ import { deflate, inflate } from "pako";
|
|
|
7
7
|
import { compress, decompress } from "lz4js";
|
|
8
8
|
import { bufferToString, stringToBuffer } from "@fluid-internal/client-utils";
|
|
9
9
|
import { DeflatedPropertyTree, LZ4PropertyTree } from "./propertyTreeExt";
|
|
10
|
+
/**
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
10
13
|
export class CompressedPropertyTreeFactory {
|
|
11
14
|
createCompressionMethods(encodeFn, decodeFn) {
|
|
12
15
|
return {
|
|
@@ -66,6 +69,9 @@ export class CompressedPropertyTreeFactory {
|
|
|
66
69
|
return cell;
|
|
67
70
|
}
|
|
68
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* @internal
|
|
74
|
+
*/
|
|
69
75
|
export class DeflatedPropertyTreeFactory extends CompressedPropertyTreeFactory {
|
|
70
76
|
async load(runtime, id, services, attributes, url) {
|
|
71
77
|
return (await super.load(runtime, id, services, attributes, url));
|
|
@@ -95,6 +101,9 @@ DeflatedPropertyTreeFactory.Attributes = {
|
|
|
95
101
|
snapshotFormatVersion: "0.1",
|
|
96
102
|
packageVersion: "0.0.1",
|
|
97
103
|
};
|
|
104
|
+
/**
|
|
105
|
+
* @internal
|
|
106
|
+
*/
|
|
98
107
|
export class LZ4PropertyTreeFactory extends CompressedPropertyTreeFactory {
|
|
99
108
|
async load(runtime, id, services, attributes, url) {
|
|
100
109
|
return (await super.load(runtime, id, services, attributes, url));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propertyTreeExtFactories.js","sourceRoot":"","sources":["../src/propertyTreeExtFactories.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wDAAwD;AACxD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAe9E,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE1E,MAAM,OAAgB,6BAA6B;IAK1C,wBAAwB,CAAC,QAAQ,EAAE,QAAQ;QAClD,OAAO;YACN,cAAc,EAA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AAE,UAAU,EAAE,GAAG,CAAC,CAAoB,CAAC;IACtF,CAAC;IAEM,MAAM,CACZ,QAAgC,EAChC,EAAU,EACV,UAAmB;QAEnB,OAAO,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,EAAE,UAAU,CAAC,CAAC;IAC/C,CAAC;IAED,IAAW,IAAI;QACd,OAAO,sBAAsB,CAAC,IAAI,CAAC;IACpC,CAAC;IAED,IAAW,UAAU;QACpB,OAAO,sBAAsB,CAAC,UAAU,CAAC;IAC1C,CAAC;IAEM,YAAY;QAClB,OAAO,QAAQ,CAAC;IACjB,CAAC;IACM,YAAY;QAClB,OAAO,UAAU,CAAC;IACnB,CAAC;IACM,eAAe,CACrB,EAAU,EACV,OAA+B,EAC/B,UAA8B,EAC9B,OAAkC,EAClC,kBAAuC;QAEvC,OAAO,IAAI,eAAe,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,kBAAkB,CAAC,CAAC;IAClF,CAAC;;AAhDsB,2BAAI,GAAG,sCAAsC,CAAC;AAE9C,iCAAU,GAAuB;IACvD,IAAI,EAAE,sBAAsB,CAAC,IAAI;IACjC,qBAAqB,EAAE,KAAK;IAC5B,cAAc,EAAE,OAAO;CACvB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/* eslint-disable @typescript-eslint/no-unsafe-return */\nimport { deflate, inflate } from \"pako\";\nimport { compress, decompress } from \"lz4js\";\nimport { bufferToString, stringToBuffer } from \"@fluid-internal/client-utils\";\nimport {\n\tIChannelAttributes,\n\tIFluidDataStoreRuntime,\n\tIChannelServices,\n\tIChannelFactory,\n} from \"@fluidframework/datastore-definitions\";\nimport {\n\tIPropertyTreeConfig,\n\tIPropertyTreeMessage,\n\tISharedPropertyTreeEncDec,\n\tISnapshotSummary,\n\tSharedPropertyTree,\n\tSharedPropertyTreeOptions,\n} from \"./propertyTree\";\nimport { DeflatedPropertyTree, LZ4PropertyTree } from \"./propertyTreeExt\";\n\nexport abstract class CompressedPropertyTreeFactory implements IChannelFactory {\n\tpublic abstract get attributes();\n\tpublic abstract get type();\n\tpublic abstract getEncodeFce();\n\tpublic abstract getDecodeFce();\n\tprivate createCompressionMethods(encodeFn, decodeFn): ISharedPropertyTreeEncDec {\n\t\treturn {\n\t\t\tmessageEncoder: {\n\t\t\t\tencode: (change: IPropertyTreeMessage) => {\n\t\t\t\t\tconst changeSetStr = JSON.stringify(change.changeSet);\n\t\t\t\t\tconst unzipped = new TextEncoder().encode(changeSetStr);\n\t\t\t\t\tconst zipped: Buffer = encodeFn(unzipped);\n\t\t\t\t\tconst zippedStr = bufferToString(zipped, \"base64\");\n\t\t\t\t\tif (zippedStr.length < changeSetStr.length) {\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/dot-notation\n\t\t\t\t\t\tchange[\"isZipped\"] = \"1\";\n\t\t\t\t\t\tchange.changeSet = zippedStr;\n\t\t\t\t\t}\n\t\t\t\t\treturn change;\n\t\t\t\t},\n\t\t\t\tdecode: (transferChange: IPropertyTreeMessage) => {\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/dot-notation\n\t\t\t\t\tif (transferChange[\"isZipped\"]) {\n\t\t\t\t\t\tconst zipped = new Uint8Array(\n\t\t\t\t\t\t\tstringToBuffer(transferChange.changeSet, \"base64\"),\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst unzipped = decodeFn(zipped);\n\t\t\t\t\t\tconst changeSetStr = new TextDecoder().decode(unzipped);\n\t\t\t\t\t\ttransferChange.changeSet = JSON.parse(changeSetStr);\n\t\t\t\t\t}\n\t\t\t\t\treturn transferChange;\n\t\t\t\t},\n\t\t\t},\n\t\t\tsummaryEncoder: {\n\t\t\t\tencode: (snapshotSummary: ISnapshotSummary): Buffer => {\n\t\t\t\t\tconst summaryStr = JSON.stringify(snapshotSummary);\n\t\t\t\t\tconst unzipped = new TextEncoder().encode(summaryStr);\n\t\t\t\t\tconst serializedSummary: Buffer = encodeFn(unzipped);\n\t\t\t\t\treturn serializedSummary;\n\t\t\t\t},\n\t\t\t\tdecode: (serializedSummary): ISnapshotSummary => {\n\t\t\t\t\tconst unzipped = decodeFn(serializedSummary);\n\t\t\t\t\tconst summaryStr = new TextDecoder().decode(unzipped);\n\t\t\t\t\tconst snapshotSummary: ISnapshotSummary = JSON.parse(summaryStr);\n\t\t\t\t\treturn snapshotSummary;\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t}\n\tpublic getEncDec(): ISharedPropertyTreeEncDec {\n\t\treturn this.createCompressionMethods(this.getEncodeFce(), this.getDecodeFce());\n\t}\n\tpublic abstract newPropertyTree(\n\t\tid: string,\n\t\truntime: IFluidDataStoreRuntime,\n\t\tattributes: IChannelAttributes,\n\t\toptions: SharedPropertyTreeOptions,\n\t\tpropertyTreeConfig: IPropertyTreeConfig,\n\t): SharedPropertyTree;\n\n\tpublic async load(\n\t\truntime: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\tservices: IChannelServices,\n\t\tattributes: IChannelAttributes,\n\t\turl?: string,\n\t): Promise<SharedPropertyTree> {\n\t\tconst options = {};\n\t\tconst instance = this.newPropertyTree(\n\t\t\tid,\n\t\t\truntime,\n\t\t\tattributes,\n\t\t\toptions as SharedPropertyTreeOptions,\n\t\t\t{ encDec: this.getEncDec() },\n\t\t);\n\t\tawait instance.load(services);\n\t\treturn instance;\n\t}\n\n\tpublic create(\n\t\tdocument: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\trequestUrl?: string,\n\t): SharedPropertyTree {\n\t\tconst options = {};\n\t\tconst cell = this.newPropertyTree(\n\t\t\tid,\n\t\t\tdocument,\n\t\t\tthis.attributes,\n\t\t\toptions as SharedPropertyTreeOptions,\n\t\t\t{ encDec: this.getEncDec() },\n\t\t);\n\t\tcell.initializeLocal();\n\t\treturn cell;\n\t}\n}\n\nexport class DeflatedPropertyTreeFactory extends CompressedPropertyTreeFactory {\n\tpublic static readonly Type = \"DeflatedPropertyTree:84534a0fe613522101f6\";\n\n\tpublic static readonly Attributes: IChannelAttributes = {\n\t\ttype: DeflatedPropertyTreeFactory.Type,\n\t\tsnapshotFormatVersion: \"0.1\",\n\t\tpackageVersion: \"0.0.1\",\n\t};\n\n\tpublic async load(\n\t\truntime: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\tservices: IChannelServices,\n\t\tattributes: IChannelAttributes,\n\t\turl?: string,\n\t): Promise<DeflatedPropertyTree> {\n\t\treturn (await super.load(runtime, id, services, attributes, url)) as DeflatedPropertyTree;\n\t}\n\n\tpublic create(\n\t\tdocument: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\trequestUrl?: string,\n\t): DeflatedPropertyTree {\n\t\treturn super.create(document, id, requestUrl);\n\t}\n\n\tpublic get type() {\n\t\treturn DeflatedPropertyTreeFactory.Type;\n\t}\n\n\tpublic get attributes() {\n\t\treturn DeflatedPropertyTreeFactory.Attributes;\n\t}\n\n\tpublic getEncodeFce() {\n\t\treturn deflate;\n\t}\n\tpublic getDecodeFce() {\n\t\treturn inflate;\n\t}\n\tpublic newPropertyTree(\n\t\tid: string,\n\t\truntime: IFluidDataStoreRuntime,\n\t\tattributes: IChannelAttributes,\n\t\toptions: SharedPropertyTreeOptions,\n\t\tpropertyTreeConfig: IPropertyTreeConfig,\n\t): SharedPropertyTree {\n\t\treturn new DeflatedPropertyTree(id, runtime, attributes, options, propertyTreeConfig);\n\t}\n}\n\nexport class LZ4PropertyTreeFactory extends CompressedPropertyTreeFactory {\n\tpublic static readonly Type = \"LZ4PropertyTree:84534a0fe613522101f6\";\n\n\tpublic static readonly Attributes: IChannelAttributes = {\n\t\ttype: LZ4PropertyTreeFactory.Type,\n\t\tsnapshotFormatVersion: \"0.1\",\n\t\tpackageVersion: \"0.0.1\",\n\t};\n\n\tpublic async load(\n\t\truntime: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\tservices: IChannelServices,\n\t\tattributes: IChannelAttributes,\n\t\turl?: string,\n\t): Promise<LZ4PropertyTree> {\n\t\treturn (await super.load(runtime, id, services, attributes, url)) as LZ4PropertyTree;\n\t}\n\n\tpublic create(\n\t\tdocument: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\trequestUrl?: string,\n\t): LZ4PropertyTree {\n\t\treturn super.create(document, id, requestUrl);\n\t}\n\n\tpublic get type() {\n\t\treturn LZ4PropertyTreeFactory.Type;\n\t}\n\n\tpublic get attributes() {\n\t\treturn LZ4PropertyTreeFactory.Attributes;\n\t}\n\n\tpublic getEncodeFce() {\n\t\treturn compress;\n\t}\n\tpublic getDecodeFce() {\n\t\treturn decompress;\n\t}\n\tpublic newPropertyTree(\n\t\tid: string,\n\t\truntime: IFluidDataStoreRuntime,\n\t\tattributes: IChannelAttributes,\n\t\toptions: SharedPropertyTreeOptions,\n\t\tpropertyTreeConfig: IPropertyTreeConfig,\n\t): SharedPropertyTree {\n\t\treturn new LZ4PropertyTree(id, runtime, attributes, options, propertyTreeConfig);\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"propertyTreeExtFactories.js","sourceRoot":"","sources":["../src/propertyTreeExtFactories.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wDAAwD;AACxD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAe9E,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE1E;;GAEG;AACH,MAAM,OAAgB,6BAA6B;IAK1C,wBAAwB,CAAC,QAAQ,EAAE,QAAQ;QAClD,OAAO;YACN,cAAc,EAAE;gBACf,MAAM,EAAE,CAAC,MAA4B,EAAE,EAAE;oBACxC,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;oBACtD,M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,OAAO,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,EAAE,UAAU,CAAC,CAAC;IAC/C,CAAC;IAED,IAAW,IAAI;QACd,OAAO,sBAAsB,CAAC,IAAI,CAAC;IACpC,CAAC;IAED,IAAW,UAAU;QACpB,OAAO,sBAAsB,CAAC,UAAU,CAAC;IAC1C,CAAC;IAEM,YAAY;QAClB,OAAO,QAAQ,CAAC;IACjB,CAAC;IACM,YAAY;QAClB,OAAO,UAAU,CAAC;IACnB,CAAC;IACM,eAAe,CACrB,EAAU,EACV,OAA+B,EAC/B,UAA8B,EAC9B,OAAkC,EAClC,kBAAuC;QAEvC,OAAO,IAAI,eAAe,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,kBAAkB,CAAC,CAAC;IAClF,CAAC;;AAhDsB,2BAAI,GAAG,sCAAsC,CAAC;AAE9C,iCAAU,GAAuB;IACvD,IAAI,EAAE,sBAAsB,CAAC,IAAI;IACjC,qBAAqB,EAAE,KAAK;IAC5B,cAAc,EAAE,OAAO;CACvB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/* eslint-disable @typescript-eslint/no-unsafe-return */\nimport { deflate, inflate } from \"pako\";\nimport { compress, decompress } from \"lz4js\";\nimport { bufferToString, stringToBuffer } from \"@fluid-internal/client-utils\";\nimport {\n\tIChannelAttributes,\n\tIFluidDataStoreRuntime,\n\tIChannelServices,\n\tIChannelFactory,\n} from \"@fluidframework/datastore-definitions\";\nimport {\n\tIPropertyTreeConfig,\n\tIPropertyTreeMessage,\n\tISharedPropertyTreeEncDec,\n\tISnapshotSummary,\n\tSharedPropertyTree,\n\tSharedPropertyTreeOptions,\n} from \"./propertyTree\";\nimport { DeflatedPropertyTree, LZ4PropertyTree } from \"./propertyTreeExt\";\n\n/**\n * @internal\n */\nexport abstract class CompressedPropertyTreeFactory implements IChannelFactory {\n\tpublic abstract get attributes();\n\tpublic abstract get type();\n\tpublic abstract getEncodeFce();\n\tpublic abstract getDecodeFce();\n\tprivate createCompressionMethods(encodeFn, decodeFn): ISharedPropertyTreeEncDec {\n\t\treturn {\n\t\t\tmessageEncoder: {\n\t\t\t\tencode: (change: IPropertyTreeMessage) => {\n\t\t\t\t\tconst changeSetStr = JSON.stringify(change.changeSet);\n\t\t\t\t\tconst unzipped = new TextEncoder().encode(changeSetStr);\n\t\t\t\t\tconst zipped: Buffer = encodeFn(unzipped);\n\t\t\t\t\tconst zippedStr = bufferToString(zipped, \"base64\");\n\t\t\t\t\tif (zippedStr.length < changeSetStr.length) {\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/dot-notation\n\t\t\t\t\t\tchange[\"isZipped\"] = \"1\";\n\t\t\t\t\t\tchange.changeSet = zippedStr;\n\t\t\t\t\t}\n\t\t\t\t\treturn change;\n\t\t\t\t},\n\t\t\t\tdecode: (transferChange: IPropertyTreeMessage) => {\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/dot-notation\n\t\t\t\t\tif (transferChange[\"isZipped\"]) {\n\t\t\t\t\t\tconst zipped = new Uint8Array(\n\t\t\t\t\t\t\tstringToBuffer(transferChange.changeSet, \"base64\"),\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst unzipped = decodeFn(zipped);\n\t\t\t\t\t\tconst changeSetStr = new TextDecoder().decode(unzipped);\n\t\t\t\t\t\ttransferChange.changeSet = JSON.parse(changeSetStr);\n\t\t\t\t\t}\n\t\t\t\t\treturn transferChange;\n\t\t\t\t},\n\t\t\t},\n\t\t\tsummaryEncoder: {\n\t\t\t\tencode: (snapshotSummary: ISnapshotSummary): Buffer => {\n\t\t\t\t\tconst summaryStr = JSON.stringify(snapshotSummary);\n\t\t\t\t\tconst unzipped = new TextEncoder().encode(summaryStr);\n\t\t\t\t\tconst serializedSummary: Buffer = encodeFn(unzipped);\n\t\t\t\t\treturn serializedSummary;\n\t\t\t\t},\n\t\t\t\tdecode: (serializedSummary): ISnapshotSummary => {\n\t\t\t\t\tconst unzipped = decodeFn(serializedSummary);\n\t\t\t\t\tconst summaryStr = new TextDecoder().decode(unzipped);\n\t\t\t\t\tconst snapshotSummary: ISnapshotSummary = JSON.parse(summaryStr);\n\t\t\t\t\treturn snapshotSummary;\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t}\n\tpublic getEncDec(): ISharedPropertyTreeEncDec {\n\t\treturn this.createCompressionMethods(this.getEncodeFce(), this.getDecodeFce());\n\t}\n\tpublic abstract newPropertyTree(\n\t\tid: string,\n\t\truntime: IFluidDataStoreRuntime,\n\t\tattributes: IChannelAttributes,\n\t\toptions: SharedPropertyTreeOptions,\n\t\tpropertyTreeConfig: IPropertyTreeConfig,\n\t): SharedPropertyTree;\n\n\tpublic async load(\n\t\truntime: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\tservices: IChannelServices,\n\t\tattributes: IChannelAttributes,\n\t\turl?: string,\n\t): Promise<SharedPropertyTree> {\n\t\tconst options = {};\n\t\tconst instance = this.newPropertyTree(\n\t\t\tid,\n\t\t\truntime,\n\t\t\tattributes,\n\t\t\toptions as SharedPropertyTreeOptions,\n\t\t\t{ encDec: this.getEncDec() },\n\t\t);\n\t\tawait instance.load(services);\n\t\treturn instance;\n\t}\n\n\tpublic create(\n\t\tdocument: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\trequestUrl?: string,\n\t): SharedPropertyTree {\n\t\tconst options = {};\n\t\tconst cell = this.newPropertyTree(\n\t\t\tid,\n\t\t\tdocument,\n\t\t\tthis.attributes,\n\t\t\toptions as SharedPropertyTreeOptions,\n\t\t\t{ encDec: this.getEncDec() },\n\t\t);\n\t\tcell.initializeLocal();\n\t\treturn cell;\n\t}\n}\n\n/**\n * @internal\n */\nexport class DeflatedPropertyTreeFactory extends CompressedPropertyTreeFactory {\n\tpublic static readonly Type = \"DeflatedPropertyTree:84534a0fe613522101f6\";\n\n\tpublic static readonly Attributes: IChannelAttributes = {\n\t\ttype: DeflatedPropertyTreeFactory.Type,\n\t\tsnapshotFormatVersion: \"0.1\",\n\t\tpackageVersion: \"0.0.1\",\n\t};\n\n\tpublic async load(\n\t\truntime: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\tservices: IChannelServices,\n\t\tattributes: IChannelAttributes,\n\t\turl?: string,\n\t): Promise<DeflatedPropertyTree> {\n\t\treturn (await super.load(runtime, id, services, attributes, url)) as DeflatedPropertyTree;\n\t}\n\n\tpublic create(\n\t\tdocument: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\trequestUrl?: string,\n\t): DeflatedPropertyTree {\n\t\treturn super.create(document, id, requestUrl);\n\t}\n\n\tpublic get type() {\n\t\treturn DeflatedPropertyTreeFactory.Type;\n\t}\n\n\tpublic get attributes() {\n\t\treturn DeflatedPropertyTreeFactory.Attributes;\n\t}\n\n\tpublic getEncodeFce() {\n\t\treturn deflate;\n\t}\n\tpublic getDecodeFce() {\n\t\treturn inflate;\n\t}\n\tpublic newPropertyTree(\n\t\tid: string,\n\t\truntime: IFluidDataStoreRuntime,\n\t\tattributes: IChannelAttributes,\n\t\toptions: SharedPropertyTreeOptions,\n\t\tpropertyTreeConfig: IPropertyTreeConfig,\n\t): SharedPropertyTree {\n\t\treturn new DeflatedPropertyTree(id, runtime, attributes, options, propertyTreeConfig);\n\t}\n}\n\n/**\n * @internal\n */\nexport class LZ4PropertyTreeFactory extends CompressedPropertyTreeFactory {\n\tpublic static readonly Type = \"LZ4PropertyTree:84534a0fe613522101f6\";\n\n\tpublic static readonly Attributes: IChannelAttributes = {\n\t\ttype: LZ4PropertyTreeFactory.Type,\n\t\tsnapshotFormatVersion: \"0.1\",\n\t\tpackageVersion: \"0.0.1\",\n\t};\n\n\tpublic async load(\n\t\truntime: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\tservices: IChannelServices,\n\t\tattributes: IChannelAttributes,\n\t\turl?: string,\n\t): Promise<LZ4PropertyTree> {\n\t\treturn (await super.load(runtime, id, services, attributes, url)) as LZ4PropertyTree;\n\t}\n\n\tpublic create(\n\t\tdocument: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\trequestUrl?: string,\n\t): LZ4PropertyTree {\n\t\treturn super.create(document, id, requestUrl);\n\t}\n\n\tpublic get type() {\n\t\treturn LZ4PropertyTreeFactory.Type;\n\t}\n\n\tpublic get attributes() {\n\t\treturn LZ4PropertyTreeFactory.Attributes;\n\t}\n\n\tpublic getEncodeFce() {\n\t\treturn compress;\n\t}\n\tpublic getDecodeFce() {\n\t\treturn decompress;\n\t}\n\tpublic newPropertyTree(\n\t\tid: string,\n\t\truntime: IFluidDataStoreRuntime,\n\t\tattributes: IChannelAttributes,\n\t\toptions: SharedPropertyTreeOptions,\n\t\tpropertyTreeConfig: IPropertyTreeConfig,\n\t): SharedPropertyTree {\n\t\treturn new LZ4PropertyTree(id, runtime, attributes, options, propertyTreeConfig);\n\t}\n}\n"]}
|
|
@@ -6,6 +6,7 @@ import { IChannelAttributes, IFluidDataStoreRuntime, IChannelServices, IChannelF
|
|
|
6
6
|
import { SharedPropertyTree } from "./propertyTree";
|
|
7
7
|
/**
|
|
8
8
|
* The factory that defines the map
|
|
9
|
+
* @internal
|
|
9
10
|
*/
|
|
10
11
|
export declare class PropertyTreeFactory implements IChannelFactory {
|
|
11
12
|
static readonly Type = "PropertyTree:01EP5J4Y6C284JR6ATVPPHRJ4E";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propertyTreeFactory.d.ts","sourceRoot":"","sources":["../src/propertyTreeFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EACf,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAA6B,MAAM,gBAAgB,CAAC;AAE/E
|
|
1
|
+
{"version":3,"file":"propertyTreeFactory.d.ts","sourceRoot":"","sources":["../src/propertyTreeFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EACf,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAA6B,MAAM,gBAAgB,CAAC;AAE/E;;;GAGG;AACH,qBAAa,mBAAoB,YAAW,eAAe;IAC1D,gBAAuB,IAAI,6CAA6C;IAExE,gBAAuB,UAAU,EAAE,kBAAkB,CAInD;IAEF,IAAW,IAAI,WAEd;IAED,IAAW,UAAU,uBAEpB;IAEY,IAAI,CAChB,OAAO,EAAE,sBAAsB,EAC/B,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,gBAAgB,EAC1B,UAAU,EAAE,kBAAkB,EAC9B,GAAG,CAAC,EAAE,MAAM,GACV,OAAO,CAAC,kBAAkB,CAAC;IAavB,MAAM,CACZ,QAAQ,EAAE,sBAAsB,EAChC,EAAE,EAAE,MAAM,EACV,UAAU,CAAC,EAAE,MAAM,GACjB,kBAAkB;CAYrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propertyTreeFactory.js","sourceRoot":"","sources":["../src/propertyTreeFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EAAE,kBAAkB,EAA6B,MAAM,gBAAgB,CAAC;AAE/E
|
|
1
|
+
{"version":3,"file":"propertyTreeFactory.js","sourceRoot":"","sources":["../src/propertyTreeFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EAAE,kBAAkB,EAA6B,MAAM,gBAAgB,CAAC;AAE/E;;;GAGG;AACH,MAAM,OAAO,mBAAmB;IAS/B,IAAW,IAAI;QACd,OAAO,mBAAmB,CAAC,IAAI,CAAC;IACjC,CAAC;IAED,IAAW,UAAU;QACpB,OAAO,mBAAmB,CAAC,UAAU,CAAC;IACvC,CAAC;IAEM,KAAK,CAAC,IAAI,CAChB,OAA+B,EAC/B,EAAU,EACV,QAA0B,EAC1B,UAA8B,EAC9B,GAAY;QAEZ,MAAM,OAAO,GAAG,EAAE,CAAC;QACnB,iBAAiB;QACjB,MAAM,QAAQ,GAAG,IAAI,kBAAkB,CACtC,EAAE,EACF,OAAO,EACP,UAAU,EACV,OAAoC,CACpC,CAAC;QACF,MAAM,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC9B,OAAO,QAAQ,CAAC;IACjB,CAAC;IAEM,MAAM,CACZ,QAAgC,EAChC,EAAU,EACV,UAAmB;QAEnB,MAAM,OAAO,GAAG,EAAE,CAAC;QACnB,MAAM,IAAI,GAAG,IAAI,kBAAkB,CAClC,EAAE,EACF,QAAQ,EACR,IAAI,CAAC,UAAU,EACf,OAAoC,CACpC,CAAC;QAEF,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,OAAO,IAAI,CAAC;IACb,CAAC;;AAlDsB,wBAAI,GAAG,yCAAyC,CAAC;AAEjD,8BAAU,GAAuB;IACvD,IAAI,EAAE,mBAAmB,CAAC,IAAI;IAC9B,qBAAqB,EAAE,KAAK;IAC5B,cAAc,EAAE,KAAK;CACrB,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 { SharedPropertyTree, SharedPropertyTreeOptions } from \"./propertyTree\";\n\n/**\n * The factory that defines the map\n * @internal\n */\nexport class PropertyTreeFactory implements IChannelFactory {\n\tpublic static readonly Type = \"PropertyTree:01EP5J4Y6C284JR6ATVPPHRJ4E\";\n\n\tpublic static readonly Attributes: IChannelAttributes = {\n\t\ttype: PropertyTreeFactory.Type,\n\t\tsnapshotFormatVersion: \"0.1\",\n\t\tpackageVersion: \"0.1\",\n\t};\n\n\tpublic get type() {\n\t\treturn PropertyTreeFactory.Type;\n\t}\n\n\tpublic get attributes() {\n\t\treturn PropertyTreeFactory.Attributes;\n\t}\n\n\tpublic async load(\n\t\truntime: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\tservices: IChannelServices,\n\t\tattributes: IChannelAttributes,\n\t\turl?: string,\n\t): Promise<SharedPropertyTree> {\n\t\tconst options = {};\n\t\t// default object\n\t\tconst instance = new SharedPropertyTree(\n\t\t\tid,\n\t\t\truntime,\n\t\t\tattributes,\n\t\t\toptions as SharedPropertyTreeOptions,\n\t\t);\n\t\tawait instance.load(services);\n\t\treturn instance;\n\t}\n\n\tpublic create(\n\t\tdocument: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\trequestUrl?: string,\n\t): SharedPropertyTree {\n\t\tconst options = {};\n\t\tconst cell = new SharedPropertyTree(\n\t\t\tid,\n\t\t\tdocument,\n\t\t\tthis.attributes,\n\t\t\toptions as SharedPropertyTreeOptions,\n\t\t);\n\n\t\tcell.initializeLocal();\n\t\treturn cell;\n\t}\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-experimental/property-dds",
|
|
3
|
-
"version": "2.0.0-internal.7.
|
|
3
|
+
"version": "2.0.0-internal.7.4.0",
|
|
4
4
|
"description": "definition of the property distributed data store",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -15,16 +15,16 @@
|
|
|
15
15
|
"module": "lib/index.js",
|
|
16
16
|
"types": "dist/index.d.ts",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@fluid-experimental/property-changeset": ">=2.0.0-internal.7.
|
|
19
|
-
"@fluid-experimental/property-properties": ">=2.0.0-internal.7.
|
|
20
|
-
"@fluid-internal/client-utils": ">=2.0.0-internal.7.
|
|
21
|
-
"@fluidframework/container-definitions": ">=2.0.0-internal.7.
|
|
22
|
-
"@fluidframework/core-interfaces": ">=2.0.0-internal.7.
|
|
23
|
-
"@fluidframework/datastore-definitions": ">=2.0.0-internal.7.
|
|
18
|
+
"@fluid-experimental/property-changeset": ">=2.0.0-internal.7.4.0 <2.0.0-internal.7.5.0",
|
|
19
|
+
"@fluid-experimental/property-properties": ">=2.0.0-internal.7.4.0 <2.0.0-internal.7.5.0",
|
|
20
|
+
"@fluid-internal/client-utils": ">=2.0.0-internal.7.4.0 <2.0.0-internal.7.5.0",
|
|
21
|
+
"@fluidframework/container-definitions": ">=2.0.0-internal.7.4.0 <2.0.0-internal.7.5.0",
|
|
22
|
+
"@fluidframework/core-interfaces": ">=2.0.0-internal.7.4.0 <2.0.0-internal.7.5.0",
|
|
23
|
+
"@fluidframework/datastore-definitions": ">=2.0.0-internal.7.4.0 <2.0.0-internal.7.5.0",
|
|
24
24
|
"@fluidframework/protocol-definitions": "^3.0.0",
|
|
25
|
-
"@fluidframework/runtime-definitions": ">=2.0.0-internal.7.
|
|
26
|
-
"@fluidframework/runtime-utils": ">=2.0.0-internal.7.
|
|
27
|
-
"@fluidframework/shared-object-base": ">=2.0.0-internal.7.
|
|
25
|
+
"@fluidframework/runtime-definitions": ">=2.0.0-internal.7.4.0 <2.0.0-internal.7.5.0",
|
|
26
|
+
"@fluidframework/runtime-utils": ">=2.0.0-internal.7.4.0 <2.0.0-internal.7.5.0",
|
|
27
|
+
"@fluidframework/shared-object-base": ">=2.0.0-internal.7.4.0 <2.0.0-internal.7.5.0",
|
|
28
28
|
"axios": "^0.26.0",
|
|
29
29
|
"buffer": "^6.0.3",
|
|
30
30
|
"fastest-json-copy": "^1.0.1",
|
|
@@ -35,23 +35,24 @@
|
|
|
35
35
|
"uuid": "^9.0.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@fluid-experimental/property-common": ">=2.0.0-internal.7.
|
|
39
|
-
"@fluid-private/test-drivers": ">=2.0.0-internal.7.
|
|
38
|
+
"@fluid-experimental/property-common": ">=2.0.0-internal.7.4.0 <2.0.0-internal.7.5.0",
|
|
39
|
+
"@fluid-private/test-drivers": ">=2.0.0-internal.7.4.0 <2.0.0-internal.7.5.0",
|
|
40
40
|
"@fluidframework/build-common": "^2.0.3",
|
|
41
41
|
"@fluidframework/build-tools": "^0.28.0",
|
|
42
|
-
"@fluidframework/container-loader": ">=2.0.0-internal.7.
|
|
43
|
-
"@fluidframework/
|
|
42
|
+
"@fluidframework/container-loader": ">=2.0.0-internal.7.4.0 <2.0.0-internal.7.5.0",
|
|
43
|
+
"@fluidframework/container-runtime": ">=2.0.0-internal.7.4.0 <2.0.0-internal.7.5.0",
|
|
44
|
+
"@fluidframework/driver-definitions": ">=2.0.0-internal.7.4.0 <2.0.0-internal.7.5.0",
|
|
44
45
|
"@fluidframework/eslint-config-fluid": "^3.1.0",
|
|
45
|
-
"@fluidframework/local-driver": ">=2.0.0-internal.7.
|
|
46
|
-
"@fluidframework/mocha-test-setup": ">=2.0.0-internal.7.
|
|
47
|
-
"@fluidframework/sequence": ">=2.0.0-internal.7.
|
|
46
|
+
"@fluidframework/local-driver": ">=2.0.0-internal.7.4.0 <2.0.0-internal.7.5.0",
|
|
47
|
+
"@fluidframework/mocha-test-setup": ">=2.0.0-internal.7.4.0 <2.0.0-internal.7.5.0",
|
|
48
|
+
"@fluidframework/sequence": ">=2.0.0-internal.7.4.0 <2.0.0-internal.7.5.0",
|
|
48
49
|
"@fluidframework/server-local-server": "^2.0.1",
|
|
49
|
-
"@fluidframework/test-runtime-utils": ">=2.0.0-internal.7.
|
|
50
|
-
"@fluidframework/test-utils": ">=2.0.0-internal.7.
|
|
50
|
+
"@fluidframework/test-runtime-utils": ">=2.0.0-internal.7.4.0 <2.0.0-internal.7.5.0",
|
|
51
|
+
"@fluidframework/test-utils": ">=2.0.0-internal.7.4.0 <2.0.0-internal.7.5.0",
|
|
51
52
|
"@microsoft/api-extractor": "^7.38.3",
|
|
52
53
|
"@types/lodash": "^4.14.118",
|
|
53
54
|
"@types/mocha": "^9.1.1",
|
|
54
|
-
"@types/node": "^
|
|
55
|
+
"@types/node": "^18.19.0",
|
|
55
56
|
"chai": "^4.2.0",
|
|
56
57
|
"cross-env": "^7.0.3",
|
|
57
58
|
"easy-table": "^1.1.1",
|
|
@@ -75,15 +76,16 @@
|
|
|
75
76
|
"build:docs": "api-extractor run --local",
|
|
76
77
|
"build:esnext": "tsc --project ./tsconfig.esnext.json",
|
|
77
78
|
"build:test": "tsc --project ./src/test/tsconfig.json",
|
|
79
|
+
"check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
|
|
78
80
|
"ci:build:docs": "api-extractor run",
|
|
79
81
|
"clean": "rimraf --glob dist lib \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc",
|
|
80
82
|
"eslint": "eslint src",
|
|
81
83
|
"eslint:fix": "eslint src --fix",
|
|
82
84
|
"format": "npm run prettier:fix",
|
|
83
|
-
"lint": "npm run prettier && npm run eslint",
|
|
85
|
+
"lint": "npm run prettier && npm run check:release-tags && npm run eslint",
|
|
84
86
|
"lint:fix": "npm run prettier:fix && npm run eslint:fix",
|
|
85
|
-
"prettier": "prettier --check . --ignore-path ../../../../.prettierignore",
|
|
86
|
-
"prettier:fix": "prettier --write . --ignore-path ../../../../.prettierignore",
|
|
87
|
+
"prettier": "prettier --check . --cache --ignore-path ../../../../.prettierignore",
|
|
88
|
+
"prettier:fix": "prettier --write . --cache --ignore-path ../../../../.prettierignore",
|
|
87
89
|
"test": "npm run test:mocha",
|
|
88
90
|
"test:mocha": "mocha \"dist/**/*.spec.js\" --exit -r node_modules/@fluidframework/mocha-test-setup",
|
|
89
91
|
"test:mocha-ts": "cross-env FLUID_TEST_VERBOSE=1 TS_NODE_PROJECT=./src/test/tsconfig.json mocha --require ts-node/register --extensions ts,tsx \"src/test/**/*.spec.ts\" --exit -r node_modules/@fluidframework/mocha-test-setup --timeout 1500000",
|
package/src/propertyTree.ts
CHANGED
|
@@ -42,18 +42,30 @@ import { v4 as uuidv4 } from "uuid";
|
|
|
42
42
|
import axios from "axios";
|
|
43
43
|
import { PropertyTreeFactory } from "./propertyTreeFactory";
|
|
44
44
|
|
|
45
|
+
/**
|
|
46
|
+
* @internal
|
|
47
|
+
*/
|
|
45
48
|
export type SerializedChangeSet = any;
|
|
46
49
|
|
|
50
|
+
/**
|
|
51
|
+
* @internal
|
|
52
|
+
*/
|
|
47
53
|
export type Metadata = any;
|
|
48
54
|
|
|
49
55
|
type FetchUnrebasedChangeFn = (guid: string) => IRemotePropertyTreeMessage;
|
|
50
56
|
type FetchRebasedChangesFn = (startGuid: string, endGuid?: string) => IPropertyTreeMessage[];
|
|
51
57
|
|
|
58
|
+
/**
|
|
59
|
+
* @internal
|
|
60
|
+
*/
|
|
52
61
|
export const enum OpKind {
|
|
53
62
|
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
54
63
|
ChangeSet = 0,
|
|
55
64
|
}
|
|
56
65
|
|
|
66
|
+
/**
|
|
67
|
+
* @internal
|
|
68
|
+
*/
|
|
57
69
|
export interface IPropertyTreeMessage {
|
|
58
70
|
op: OpKind;
|
|
59
71
|
changeSet: SerializedChangeSet;
|
|
@@ -66,6 +78,9 @@ export interface IPropertyTreeMessage {
|
|
|
66
78
|
useMH?: boolean;
|
|
67
79
|
}
|
|
68
80
|
|
|
81
|
+
/**
|
|
82
|
+
* @internal
|
|
83
|
+
*/
|
|
69
84
|
export interface IRemotePropertyTreeMessage extends IPropertyTreeMessage {
|
|
70
85
|
sequenceNumber: number;
|
|
71
86
|
}
|
|
@@ -75,6 +90,9 @@ interface ISnapshot {
|
|
|
75
90
|
useMH: boolean;
|
|
76
91
|
numChunks: number;
|
|
77
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* @internal
|
|
95
|
+
*/
|
|
78
96
|
export interface ISnapshotSummary {
|
|
79
97
|
remoteTipView?: SerializedChangeSet;
|
|
80
98
|
remoteChanges?: IPropertyTreeMessage[];
|
|
@@ -82,6 +100,9 @@ export interface ISnapshotSummary {
|
|
|
82
100
|
remoteHeadGuid: string;
|
|
83
101
|
}
|
|
84
102
|
|
|
103
|
+
/**
|
|
104
|
+
* @internal
|
|
105
|
+
*/
|
|
85
106
|
export interface SharedPropertyTreeOptions {
|
|
86
107
|
paths?: string[];
|
|
87
108
|
clientFiltering?: boolean;
|
|
@@ -89,6 +110,9 @@ export interface SharedPropertyTreeOptions {
|
|
|
89
110
|
disablePartialCheckout?: boolean;
|
|
90
111
|
}
|
|
91
112
|
|
|
113
|
+
/**
|
|
114
|
+
* @internal
|
|
115
|
+
*/
|
|
92
116
|
export interface ISharedPropertyTreeEncDec {
|
|
93
117
|
messageEncoder: {
|
|
94
118
|
encode: (IPropertyTreeMessage) => IPropertyTreeMessage;
|
|
@@ -97,6 +121,9 @@ export interface ISharedPropertyTreeEncDec {
|
|
|
97
121
|
summaryEncoder: { encode: (ISnapshotSummary) => Buffer; decode: (Buffer) => ISnapshotSummary };
|
|
98
122
|
}
|
|
99
123
|
|
|
124
|
+
/**
|
|
125
|
+
* @internal
|
|
126
|
+
*/
|
|
100
127
|
export interface IPropertyTreeConfig {
|
|
101
128
|
encDec: ISharedPropertyTreeEncDec;
|
|
102
129
|
}
|
|
@@ -131,6 +158,7 @@ const defaultEncDec: ISharedPropertyTreeEncDec = {
|
|
|
131
158
|
* consensus by simply applying the same number of rolls. (A fun addition would be logging
|
|
132
159
|
* who received which roll, which would need to change as clients learn how races are resolved
|
|
133
160
|
* in the total order)
|
|
161
|
+
* @internal
|
|
134
162
|
*/
|
|
135
163
|
export class SharedPropertyTree extends SharedObject {
|
|
136
164
|
tipView: SerializedChangeSet = {};
|
|
@@ -391,6 +419,7 @@ export class SharedPropertyTree extends SharedObject {
|
|
|
391
419
|
minimumSequenceNumber: number,
|
|
392
420
|
remoteChanges: IPropertyTreeMessage[],
|
|
393
421
|
unrebasedRemoteChanges: Record<string, IRemotePropertyTreeMessage>,
|
|
422
|
+
remoteHeadGuid: string,
|
|
394
423
|
) {
|
|
395
424
|
// for faster lookup of remote change guids
|
|
396
425
|
const remoteChangeMap = new Map<string, number>();
|
|
@@ -422,7 +451,7 @@ export class SharedPropertyTree extends SharedObject {
|
|
|
422
451
|
visitedUnrebasedRemoteChanges.has(visitor.referenceGuid)
|
|
423
452
|
) {
|
|
424
453
|
const guid = visitor.referenceGuid;
|
|
425
|
-
if (guid === "") {
|
|
454
|
+
if (guid === "" || guid === remoteHeadGuid) {
|
|
426
455
|
break;
|
|
427
456
|
}
|
|
428
457
|
// since the change is not in remote it must be in unrebased
|
|
@@ -441,9 +470,9 @@ export class SharedPropertyTree extends SharedObject {
|
|
|
441
470
|
visitedRemoteChanges.add(visitor.referenceGuid);
|
|
442
471
|
}
|
|
443
472
|
|
|
444
|
-
// If we have a change that refers to the start of the history (remoteHeadGuid === ""
|
|
445
|
-
// keep all remote Changes until this change has been processed
|
|
446
|
-
if (visitor.remoteHeadGuid === "") {
|
|
473
|
+
// If we have a change that refers to the start of the history (remoteHeadGuid === "" or the
|
|
474
|
+
// provided remote head guid), we have to keep all remote Changes until this change has been processed
|
|
475
|
+
if (visitor.remoteHeadGuid === "" || visitor.remoteHeadGuid === remoteHeadGuid) {
|
|
447
476
|
visitedRemoteChanges.add(remoteChanges[0].guid);
|
|
448
477
|
}
|
|
449
478
|
}
|
|
@@ -477,10 +506,22 @@ export class SharedPropertyTree extends SharedObject {
|
|
|
477
506
|
public pruneHistory() {
|
|
478
507
|
const msn = this.runtime.deltaManager.minimumSequenceNumber;
|
|
479
508
|
|
|
509
|
+
let lastKnownRemoteGuid = this.headCommitGuid;
|
|
510
|
+
// We use the reference GUID of the first change in the list
|
|
511
|
+
// of remote changes as lastKnownRemoteGuid, because there
|
|
512
|
+
// might still be unrebased changes that reference this GUID
|
|
513
|
+
// as referenceGUID / remoteHeadGuid and if this happens
|
|
514
|
+
// we must make sure we preserve the remote changes and
|
|
515
|
+
// unrebased remote changes
|
|
516
|
+
if (this.remoteChanges.length > 0) {
|
|
517
|
+
lastKnownRemoteGuid = this.remoteChanges[0].referenceGuid;
|
|
518
|
+
}
|
|
519
|
+
|
|
480
520
|
const { remoteChanges, unrebasedRemoteChanges } = SharedPropertyTree.prune(
|
|
481
521
|
msn,
|
|
482
522
|
this.remoteChanges,
|
|
483
523
|
this.unrebasedRemoteChanges,
|
|
524
|
+
lastKnownRemoteGuid,
|
|
484
525
|
);
|
|
485
526
|
|
|
486
527
|
this.remoteChanges = remoteChanges;
|
|
@@ -800,7 +841,14 @@ export class SharedPropertyTree extends SharedObject {
|
|
|
800
841
|
|
|
801
842
|
getRebasedChanges(startGuid: string, endGuid?: string) {
|
|
802
843
|
const startIndex = findIndex(this.remoteChanges, (c) => c.guid === startGuid);
|
|
803
|
-
if (
|
|
844
|
+
if (
|
|
845
|
+
startIndex === -1 &&
|
|
846
|
+
startGuid !== "" &&
|
|
847
|
+
// If the start GUID is the referenceGUID of the first change,
|
|
848
|
+
// we still can get the correct range, because the change with the startGuid itself
|
|
849
|
+
// if not included in the range.
|
|
850
|
+
(this.remoteChanges.length === 0 || startGuid !== this.remoteChanges[0].referenceGuid)
|
|
851
|
+
) {
|
|
804
852
|
// TODO: Consider throwing an error once clients have picked up PR #16277.
|
|
805
853
|
console.error("Unknown start GUID specified.");
|
|
806
854
|
}
|
package/src/propertyTreeExt.ts
CHANGED
|
@@ -10,6 +10,7 @@ import { DeflatedPropertyTreeFactory, LZ4PropertyTreeFactory } from "./propertyT
|
|
|
10
10
|
/**
|
|
11
11
|
* This class is the extension of SharedPropertyTree which compresses
|
|
12
12
|
* the deltas and summaries communicated to the server by Deflate.
|
|
13
|
+
* @internal
|
|
13
14
|
*/
|
|
14
15
|
export class DeflatedPropertyTree extends SharedPropertyTree {
|
|
15
16
|
public static create(runtime: IFluidDataStoreRuntime, id?: string, queryString?: string) {
|
|
@@ -21,6 +22,9 @@ export class DeflatedPropertyTree extends SharedPropertyTree {
|
|
|
21
22
|
}
|
|
22
23
|
}
|
|
23
24
|
|
|
25
|
+
/**
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
24
28
|
export class LZ4PropertyTree extends SharedPropertyTree {
|
|
25
29
|
public static create(runtime: IFluidDataStoreRuntime, id?: string, queryString?: string) {
|
|
26
30
|
return runtime.createChannel(id, LZ4PropertyTreeFactory.Type) as LZ4PropertyTree;
|
|
@@ -22,6 +22,9 @@ import {
|
|
|
22
22
|
} from "./propertyTree";
|
|
23
23
|
import { DeflatedPropertyTree, LZ4PropertyTree } from "./propertyTreeExt";
|
|
24
24
|
|
|
25
|
+
/**
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
25
28
|
export abstract class CompressedPropertyTreeFactory implements IChannelFactory {
|
|
26
29
|
public abstract get attributes();
|
|
27
30
|
public abstract get type();
|
|
@@ -119,6 +122,9 @@ export abstract class CompressedPropertyTreeFactory implements IChannelFactory {
|
|
|
119
122
|
}
|
|
120
123
|
}
|
|
121
124
|
|
|
125
|
+
/**
|
|
126
|
+
* @internal
|
|
127
|
+
*/
|
|
122
128
|
export class DeflatedPropertyTreeFactory extends CompressedPropertyTreeFactory {
|
|
123
129
|
public static readonly Type = "DeflatedPropertyTree:84534a0fe613522101f6";
|
|
124
130
|
|
|
@@ -171,6 +177,9 @@ export class DeflatedPropertyTreeFactory extends CompressedPropertyTreeFactory {
|
|
|
171
177
|
}
|
|
172
178
|
}
|
|
173
179
|
|
|
180
|
+
/**
|
|
181
|
+
* @internal
|
|
182
|
+
*/
|
|
174
183
|
export class LZ4PropertyTreeFactory extends CompressedPropertyTreeFactory {
|
|
175
184
|
public static readonly Type = "LZ4PropertyTree:84534a0fe613522101f6";
|
|
176
185
|
|
|
@@ -13,6 +13,7 @@ import { SharedPropertyTree, SharedPropertyTreeOptions } from "./propertyTree";
|
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* The factory that defines the map
|
|
16
|
+
* @internal
|
|
16
17
|
*/
|
|
17
18
|
export class PropertyTreeFactory implements IChannelFactory {
|
|
18
19
|
public static readonly Type = "PropertyTree:01EP5J4Y6C284JR6ATVPPHRJ4E";
|