@fluid-experimental/property-dds 2.0.0-internal.1.1.2 → 2.0.0-internal.1.2.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propertyTreeExtFactories.d.ts","sourceRoot":"","sources":["../src/propertyTreeExtFactories.ts"],"names":[],"mappings":"AAQA,OAAO,EACH,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,
|
|
1
|
+
{"version":3,"file":"propertyTreeExtFactories.d.ts","sourceRoot":"","sources":["../src/propertyTreeExtFactories.ts"],"names":[],"mappings":"AAQA,OAAO,EACH,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EAClB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACH,mBAAmB,EAAwB,yBAAyB,EAClD,kBAAkB,EAAE,yBAAyB,EAClE,MACQ,gBAAgB,CAAC;AAC1B,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE1E,8BAAsB,6BAA8B,YAAW,eAAe;IAC1E,aAAoB,UAAU,QAAG;IACjC,aAAoB,IAAI,QAAG;aACX,YAAY;aACZ,YAAY;IAC5B,OAAO,CAAC,wBAAwB;IA0CzB,SAAS,IAAI,yBAAyB;aAG7B,eAAe,CAC3B,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,sBAAsB,EAC/B,UAAU,EAAE,kBAAkB,EAC9B,OAAO,EAAE,yBAAyB,EAClC,kBAAkB,EAAE,mBAAmB,GAAG,kBAAkB;IAEnD,IAAI,CACb,OAAO,EAAE,sBAAsB,EAC/B,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,gBAAgB,EAC1B,UAAU,EAAE,kBAAkB,EAC9B,GAAG,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,kBAAkB,CAAC;IASvB,MAAM,CAAC,QAAQ,EAAE,sBAAsB,EAAE,EA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,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 \"@fluidframework/common-utils\";\nimport {\n IChannelAttributes,\n IFluidDataStoreRuntime,\n IChannelServices,\n IChannelFactory,\n IChannel,\n} from \"@fluidframework/datastore-definitions\";\nimport {\n IPropertyTreeConfig, IPropertyTreeMessage, ISharedPropertyTreeEncDec,\n ISnapshotSummary, SharedPropertyTree, SharedPropertyTreeOptions,\n}\n from \"./propertyTree\";\nimport { DeflatedPropertyTree, LZ4PropertyTree } from \"./propertyTreeExt\";\n\nexport abstract class CompressedPropertyTreeFactory implements IChannelFactory {\n public abstract get attributes();\n public abstract get type();\n public abstract getEncodeFce();\n public abstract getDecodeFce();\n private createCompressionMethods(encodeFn, decodeFn): ISharedPropertyTreeEncDec {\n return {\n messageEncoder: {\n encode: (change: IPropertyTreeMessage) => {\n const changeSetStr = JSON.stringify(change.changeSet);\n const unzipped = new TextEncoder().encode(changeSetStr);\n const zipped: Buffer = encodeFn(unzipped);\n const zippedStr = bufferToString(zipped, \"base64\");\n if (zippedStr.length < changeSetStr.length) {\n // eslint-disable-next-line @typescript-eslint/dot-notation\n change[\"isZipped\"] = \"1\";\n change.changeSet = zippedStr;\n }\n return change;\n },\n decode: (transferChange: IPropertyTreeMessage) => {\n // eslint-disable-next-line @typescript-eslint/dot-notation\n if (transferChange[\"isZipped\"]) {\n const zipped = new Uint8Array(stringToBuffer(transferChange.changeSet, \"base64\"));\n const unzipped = decodeFn(zipped);\n const changeSetStr = new TextDecoder().decode(unzipped);\n transferChange.changeSet = JSON.parse(changeSetStr);\n }\n return transferChange;\n },\n },\n summaryEncoder: {\n encode: (snapshotSummary: ISnapshotSummary): Buffer => {\n const summaryStr = JSON.stringify(snapshotSummary);\n const unzipped = new TextEncoder().encode(summaryStr);\n const serializedSummary: Buffer = encodeFn(unzipped);\n return serializedSummary;\n },\n decode: (serializedSummary): ISnapshotSummary => {\n const unzipped = decodeFn(serializedSummary);\n const summaryStr = new TextDecoder().decode(unzipped);\n const snapshotSummary: ISnapshotSummary = JSON.parse(summaryStr);\n return snapshotSummary;\n },\n },\n };\n }\n public getEncDec(): ISharedPropertyTreeEncDec {\n return this.createCompressionMethods(this.getEncodeFce(), this.getDecodeFce());\n }\n public abstract newPropertyTree(\n id: string,\n runtime: IFluidDataStoreRuntime,\n attributes: IChannelAttributes,\n options: SharedPropertyTreeOptions,\n propertyTreeConfig: IPropertyTreeConfig): SharedPropertyTree;\n\n public async load(\n runtime: IFluidDataStoreRuntime,\n id: string,\n services: IChannelServices,\n attributes: IChannelAttributes,\n url?: string,\n ): Promise<SharedPropertyTree> {\n const options = {};\n const instance = this.newPropertyTree(id, runtime, attributes,\n options as SharedPropertyTreeOptions\n , { encDec: this.getEncDec() });\n await instance.load(services);\n return instance;\n }\n\n public create(document: IFluidDataStoreRuntime, id: string, requestUrl?: string): SharedPropertyTree {\n const options = {};\n const cell = this.newPropertyTree(id, document,\n this.attributes, options as SharedPropertyTreeOptions,\n { encDec: this.getEncDec() });\n cell.initializeLocal();\n return cell;\n }\n}\n\nexport class DeflatedPropertyTreeFactory extends CompressedPropertyTreeFactory {\n public static readonly Type = \"DeflatedPropertyTree:84534a0fe613522101f6\";\n\n public static readonly Attributes: IChannelAttributes = {\n type: DeflatedPropertyTreeFactory.Type,\n snapshotFormatVersion: \"0.1\",\n packageVersion: \"0.0.1\",\n };\n\n public async load(\n runtime: IFluidDataStoreRuntime,\n id: string,\n services: IChannelServices,\n attributes: IChannelAttributes,\n url?: string,\n ): Promise<DeflatedPropertyTree> {\n return await super.load(runtime, id, services, attributes, url) as DeflatedPropertyTree;\n }\n\n public create(document: IFluidDataStoreRuntime, id: string, requestUrl?: string): DeflatedPropertyTree {\n return super.create(document, id, requestUrl);\n }\n\n public get type() {\n return DeflatedPropertyTreeFactory.Type;\n }\n\n public get attributes() {\n return DeflatedPropertyTreeFactory.Attributes;\n }\n\n public getEncodeFce() { return deflate; }\n public getDecodeFce() { return inflate; }\n public newPropertyTree(\n id: string,\n runtime: IFluidDataStoreRuntime,\n attributes: IChannelAttributes,\n options: SharedPropertyTreeOptions,\n propertyTreeConfig: IPropertyTreeConfig): SharedPropertyTree {\n return new DeflatedPropertyTree(id, runtime, attributes, options, propertyTreeConfig);\n }\n}\n\nexport class LZ4PropertyTreeFactory extends CompressedPropertyTreeFactory {\n public static readonly Type = \"LZ4PropertyTree:84534a0fe613522101f6\";\n\n public static readonly Attributes: IChannelAttributes = {\n type: LZ4PropertyTreeFactory.Type,\n snapshotFormatVersion: \"0.1\",\n packageVersion: \"0.0.1\",\n };\n\n public async load(\n runtime: IFluidDataStoreRuntime,\n id: string,\n services: IChannelServices,\n attributes: IChannelAttributes,\n url?: string,\n ): Promise<LZ4PropertyTree> {\n return await super.load(runtime, id, services, attributes, url) as LZ4PropertyTree;\n }\n\n public create(document: IFluidDataStoreRuntime, id: string, requestUrl?: string): LZ4PropertyTree {\n return super.create(document, id, requestUrl);\n }\n\n public get type() {\n return LZ4PropertyTreeFactory.Type;\n }\n\n public get attributes() {\n return LZ4PropertyTreeFactory.Attributes;\n }\n\n public getEncodeFce() { return compress; }\n public getDecodeFce() { return decompress; }\n public newPropertyTree(\n id: string,\n runtime: IFluidDataStoreRuntime,\n attributes: IChannelAttributes,\n options: SharedPropertyTreeOptions,\n propertyTreeConfig: IPropertyTreeConfig): SharedPropertyTree {\n return new LZ4PropertyTree(id, runtime, attributes, options, propertyTreeConfig);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"propertyTreeExtFactories.js","sourceRoot":"","sources":["../src/propertyTreeExtFactories.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,wDAAwD;AACxD,+BAAwC;AACxC,iCAA6C;AAC7C,+DAA8E;AAY9E,uDAA0E;AAE1E,MAAsB,6BAA6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,QAA0B,EAC1B,UAA8B,EAC9B,GAAY;QAEZ,OAAO,MAAM,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,CAAoB,CAAC;IACvF,CAAC;IAEM,MAAM,CAAC,QAAgC,EAAE,EAAU,EAAE,UAAmB;QAC3E,OAAO,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,EAAE,UAAU,CAAC,CAAC;IAClD,CAAC;IAED,IAAW,IAAI;QACX,OAAO,sBAAsB,CAAC,IAAI,CAAC;IACvC,CAAC;IAED,IAAW,UAAU;QACjB,OAAO,sBAAsB,CAAC,UAAU,CAAC;IAC7C,CAAC;IAEM,YAAY,KAAK,OAAO,gBAAQ,CAAC,CAAC,CAAC;IACnC,YAAY,KAAK,OAAO,kBAAU,CAAC,CAAC,CAAC;IACrC,eAAe,CAClB,EAAU,EACV,OAA+B,EAC/B,UAA8B,EAC9B,OAAkC,EAClC,kBAAuC;QACvC,OAAO,IAAI,iCAAe,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,kBAAkB,CAAC,CAAC;IACrF,CAAC;;AAxCL,wDAyCC;AAxC0B,2BAAI,GAAG,sCAAsC,CAAC;AAE9C,iCAAU,GAAuB;IACpD,IAAI,EAAE,sBAAsB,CAAC,IAAI;IACjC,qBAAqB,EAAE,KAAK;IAC5B,cAAc,EAAE,OAAO;CAC1B,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 \"@fluidframework/common-utils\";\nimport {\n IChannelAttributes,\n IFluidDataStoreRuntime,\n IChannelServices,\n IChannelFactory,\n} from \"@fluidframework/datastore-definitions\";\nimport {\n IPropertyTreeConfig, IPropertyTreeMessage, ISharedPropertyTreeEncDec,\n ISnapshotSummary, SharedPropertyTree, SharedPropertyTreeOptions,\n}\n from \"./propertyTree\";\nimport { DeflatedPropertyTree, LZ4PropertyTree } from \"./propertyTreeExt\";\n\nexport abstract class CompressedPropertyTreeFactory implements IChannelFactory {\n public abstract get attributes();\n public abstract get type();\n public abstract getEncodeFce();\n public abstract getDecodeFce();\n private createCompressionMethods(encodeFn, decodeFn): ISharedPropertyTreeEncDec {\n return {\n messageEncoder: {\n encode: (change: IPropertyTreeMessage) => {\n const changeSetStr = JSON.stringify(change.changeSet);\n const unzipped = new TextEncoder().encode(changeSetStr);\n const zipped: Buffer = encodeFn(unzipped);\n const zippedStr = bufferToString(zipped, \"base64\");\n if (zippedStr.length < changeSetStr.length) {\n // eslint-disable-next-line @typescript-eslint/dot-notation\n change[\"isZipped\"] = \"1\";\n change.changeSet = zippedStr;\n }\n return change;\n },\n decode: (transferChange: IPropertyTreeMessage) => {\n // eslint-disable-next-line @typescript-eslint/dot-notation\n if (transferChange[\"isZipped\"]) {\n const zipped = new Uint8Array(stringToBuffer(transferChange.changeSet, \"base64\"));\n const unzipped = decodeFn(zipped);\n const changeSetStr = new TextDecoder().decode(unzipped);\n transferChange.changeSet = JSON.parse(changeSetStr);\n }\n return transferChange;\n },\n },\n summaryEncoder: {\n encode: (snapshotSummary: ISnapshotSummary): Buffer => {\n const summaryStr = JSON.stringify(snapshotSummary);\n const unzipped = new TextEncoder().encode(summaryStr);\n const serializedSummary: Buffer = encodeFn(unzipped);\n return serializedSummary;\n },\n decode: (serializedSummary): ISnapshotSummary => {\n const unzipped = decodeFn(serializedSummary);\n const summaryStr = new TextDecoder().decode(unzipped);\n const snapshotSummary: ISnapshotSummary = JSON.parse(summaryStr);\n return snapshotSummary;\n },\n },\n };\n }\n public getEncDec(): ISharedPropertyTreeEncDec {\n return this.createCompressionMethods(this.getEncodeFce(), this.getDecodeFce());\n }\n public abstract newPropertyTree(\n id: string,\n runtime: IFluidDataStoreRuntime,\n attributes: IChannelAttributes,\n options: SharedPropertyTreeOptions,\n propertyTreeConfig: IPropertyTreeConfig): SharedPropertyTree;\n\n public async load(\n runtime: IFluidDataStoreRuntime,\n id: string,\n services: IChannelServices,\n attributes: IChannelAttributes,\n url?: string,\n ): Promise<SharedPropertyTree> {\n const options = {};\n const instance = this.newPropertyTree(id, runtime, attributes,\n options as SharedPropertyTreeOptions\n , { encDec: this.getEncDec() });\n await instance.load(services);\n return instance;\n }\n\n public create(document: IFluidDataStoreRuntime, id: string, requestUrl?: string): SharedPropertyTree {\n const options = {};\n const cell = this.newPropertyTree(id, document,\n this.attributes, options as SharedPropertyTreeOptions,\n { encDec: this.getEncDec() });\n cell.initializeLocal();\n return cell;\n }\n}\n\nexport class DeflatedPropertyTreeFactory extends CompressedPropertyTreeFactory {\n public static readonly Type = \"DeflatedPropertyTree:84534a0fe613522101f6\";\n\n public static readonly Attributes: IChannelAttributes = {\n type: DeflatedPropertyTreeFactory.Type,\n snapshotFormatVersion: \"0.1\",\n packageVersion: \"0.0.1\",\n };\n\n public async load(\n runtime: IFluidDataStoreRuntime,\n id: string,\n services: IChannelServices,\n attributes: IChannelAttributes,\n url?: string,\n ): Promise<DeflatedPropertyTree> {\n return await super.load(runtime, id, services, attributes, url) as DeflatedPropertyTree;\n }\n\n public create(document: IFluidDataStoreRuntime, id: string, requestUrl?: string): DeflatedPropertyTree {\n return super.create(document, id, requestUrl);\n }\n\n public get type() {\n return DeflatedPropertyTreeFactory.Type;\n }\n\n public get attributes() {\n return DeflatedPropertyTreeFactory.Attributes;\n }\n\n public getEncodeFce() { return deflate; }\n public getDecodeFce() { return inflate; }\n public newPropertyTree(\n id: string,\n runtime: IFluidDataStoreRuntime,\n attributes: IChannelAttributes,\n options: SharedPropertyTreeOptions,\n propertyTreeConfig: IPropertyTreeConfig): SharedPropertyTree {\n return new DeflatedPropertyTree(id, runtime, attributes, options, propertyTreeConfig);\n }\n}\n\nexport class LZ4PropertyTreeFactory extends CompressedPropertyTreeFactory {\n public static readonly Type = \"LZ4PropertyTree:84534a0fe613522101f6\";\n\n public static readonly Attributes: IChannelAttributes = {\n type: LZ4PropertyTreeFactory.Type,\n snapshotFormatVersion: \"0.1\",\n packageVersion: \"0.0.1\",\n };\n\n public async load(\n runtime: IFluidDataStoreRuntime,\n id: string,\n services: IChannelServices,\n attributes: IChannelAttributes,\n url?: string,\n ): Promise<LZ4PropertyTree> {\n return await super.load(runtime, id, services, attributes, url) as LZ4PropertyTree;\n }\n\n public create(document: IFluidDataStoreRuntime, id: string, requestUrl?: string): LZ4PropertyTree {\n return super.create(document, id, requestUrl);\n }\n\n public get type() {\n return LZ4PropertyTreeFactory.Type;\n }\n\n public get attributes() {\n return LZ4PropertyTreeFactory.Attributes;\n }\n\n public getEncodeFce() { return compress; }\n public getDecodeFce() { return decompress; }\n public newPropertyTree(\n id: string,\n runtime: IFluidDataStoreRuntime,\n attributes: IChannelAttributes,\n options: SharedPropertyTreeOptions,\n propertyTreeConfig: IPropertyTreeConfig): SharedPropertyTree {\n return new LZ4PropertyTree(id, runtime, attributes, options, propertyTreeConfig);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propertyTreeExtFactories.d.ts","sourceRoot":"","sources":["../src/propertyTreeExtFactories.ts"],"names":[],"mappings":"AAQA,OAAO,EACH,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,
|
|
1
|
+
{"version":3,"file":"propertyTreeExtFactories.d.ts","sourceRoot":"","sources":["../src/propertyTreeExtFactories.ts"],"names":[],"mappings":"AAQA,OAAO,EACH,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EAClB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACH,mBAAmB,EAAwB,yBAAyB,EAClD,kBAAkB,EAAE,yBAAyB,EAClE,MACQ,gBAAgB,CAAC;AAC1B,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE1E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AAE,EAAU,EAAE,UAAmB;QAC3E,OAAO,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,EAAE,UAAU,CAAC,CAAC;IAClD,CAAC;IAED,IAAW,IAAI;QACX,OAAO,sBAAsB,CAAC,IAAI,CAAC;IACvC,CAAC;IAED,IAAW,UAAU;QACjB,OAAO,sBAAsB,CAAC,UAAU,CAAC;IAC7C,CAAC;IAEM,YAAY,KAAK,OAAO,QAAQ,CAAC,CAAC,CAAC;IACnC,YAAY,KAAK,OAAO,UAAU,CAAC,CAAC,CAAC;IACrC,eAAe,CAClB,EAAU,EACV,OAA+B,EAC/B,UAA8B,EAC9B,OAAkC,EAClC,kBAAuC;QACvC,OAAO,IAAI,eAAe,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,kBAAkB,CAAC,CAAC;IACrF,CAAC;;AAvCsB,2BAAI,GAAG,sCAAsC,CAAC;AAE9C,iCAAU,GAAuB;IACpD,IAAI,EAAE,sBAAsB,CAAC,IAAI;IACjC,qBAAqB,EAAE,KAAK;IAC5B,cAAc,EAAE,OAAO;CAC1B,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 \"@fluidframework/common-utils\";\nimport {\n IChannelAttributes,\n IFluidDataStoreRuntime,\n IChannelServices,\n IChannelFactory,\n IChannel,\n} from \"@fluidframework/datastore-definitions\";\nimport {\n IPropertyTreeConfig, IPropertyTreeMessage, ISharedPropertyTreeEncDec,\n ISnapshotSummary, SharedPropertyTree, SharedPropertyTreeOptions,\n}\n from \"./propertyTree\";\nimport { DeflatedPropertyTree, LZ4PropertyTree } from \"./propertyTreeExt\";\n\nexport abstract class CompressedPropertyTreeFactory implements IChannelFactory {\n public abstract get attributes();\n public abstract get type();\n public abstract getEncodeFce();\n public abstract getDecodeFce();\n private createCompressionMethods(encodeFn, decodeFn): ISharedPropertyTreeEncDec {\n return {\n messageEncoder: {\n encode: (change: IPropertyTreeMessage) => {\n const changeSetStr = JSON.stringify(change.changeSet);\n const unzipped = new TextEncoder().encode(changeSetStr);\n const zipped: Buffer = encodeFn(unzipped);\n const zippedStr = bufferToString(zipped, \"base64\");\n if (zippedStr.length < changeSetStr.length) {\n // eslint-disable-next-line @typescript-eslint/dot-notation\n change[\"isZipped\"] = \"1\";\n change.changeSet = zippedStr;\n }\n return change;\n },\n decode: (transferChange: IPropertyTreeMessage) => {\n // eslint-disable-next-line @typescript-eslint/dot-notation\n if (transferChange[\"isZipped\"]) {\n const zipped = new Uint8Array(stringToBuffer(transferChange.changeSet, \"base64\"));\n const unzipped = decodeFn(zipped);\n const changeSetStr = new TextDecoder().decode(unzipped);\n transferChange.changeSet = JSON.parse(changeSetStr);\n }\n return transferChange;\n },\n },\n summaryEncoder: {\n encode: (snapshotSummary: ISnapshotSummary): Buffer => {\n const summaryStr = JSON.stringify(snapshotSummary);\n const unzipped = new TextEncoder().encode(summaryStr);\n const serializedSummary: Buffer = encodeFn(unzipped);\n return serializedSummary;\n },\n decode: (serializedSummary): ISnapshotSummary => {\n const unzipped = decodeFn(serializedSummary);\n const summaryStr = new TextDecoder().decode(unzipped);\n const snapshotSummary: ISnapshotSummary = JSON.parse(summaryStr);\n return snapshotSummary;\n },\n },\n };\n }\n public getEncDec(): ISharedPropertyTreeEncDec {\n return this.createCompressionMethods(this.getEncodeFce(), this.getDecodeFce());\n }\n public abstract newPropertyTree(\n id: string,\n runtime: IFluidDataStoreRuntime,\n attributes: IChannelAttributes,\n options: SharedPropertyTreeOptions,\n propertyTreeConfig: IPropertyTreeConfig): SharedPropertyTree;\n\n public async load(\n runtime: IFluidDataStoreRuntime,\n id: string,\n services: IChannelServices,\n attributes: IChannelAttributes,\n url?: string,\n ): Promise<SharedPropertyTree> {\n const options = {};\n const instance = this.newPropertyTree(id, runtime, attributes,\n options as SharedPropertyTreeOptions\n , { encDec: this.getEncDec() });\n await instance.load(services);\n return instance;\n }\n\n public create(document: IFluidDataStoreRuntime, id: string, requestUrl?: string): SharedPropertyTree {\n const options = {};\n const cell = this.newPropertyTree(id, document,\n this.attributes, options as SharedPropertyTreeOptions,\n { encDec: this.getEncDec() });\n cell.initializeLocal();\n return cell;\n }\n}\n\nexport class DeflatedPropertyTreeFactory extends CompressedPropertyTreeFactory {\n public static readonly Type = \"DeflatedPropertyTree:84534a0fe613522101f6\";\n\n public static readonly Attributes: IChannelAttributes = {\n type: DeflatedPropertyTreeFactory.Type,\n snapshotFormatVersion: \"0.1\",\n packageVersion: \"0.0.1\",\n };\n\n public async load(\n runtime: IFluidDataStoreRuntime,\n id: string,\n services: IChannelServices,\n attributes: IChannelAttributes,\n url?: string,\n ): Promise<DeflatedPropertyTree> {\n return await super.load(runtime, id, services, attributes, url) as DeflatedPropertyTree;\n }\n\n public create(document: IFluidDataStoreRuntime, id: string, requestUrl?: string): DeflatedPropertyTree {\n return super.create(document, id, requestUrl);\n }\n\n public get type() {\n return DeflatedPropertyTreeFactory.Type;\n }\n\n public get attributes() {\n return DeflatedPropertyTreeFactory.Attributes;\n }\n\n public getEncodeFce() { return deflate; }\n public getDecodeFce() { return inflate; }\n public newPropertyTree(\n id: string,\n runtime: IFluidDataStoreRuntime,\n attributes: IChannelAttributes,\n options: SharedPropertyTreeOptions,\n propertyTreeConfig: IPropertyTreeConfig): SharedPropertyTree {\n return new DeflatedPropertyTree(id, runtime, attributes, options, propertyTreeConfig);\n }\n}\n\nexport class LZ4PropertyTreeFactory extends CompressedPropertyTreeFactory {\n public static readonly Type = \"LZ4PropertyTree:84534a0fe613522101f6\";\n\n public static readonly Attributes: IChannelAttributes = {\n type: LZ4PropertyTreeFactory.Type,\n snapshotFormatVersion: \"0.1\",\n packageVersion: \"0.0.1\",\n };\n\n public async load(\n runtime: IFluidDataStoreRuntime,\n id: string,\n services: IChannelServices,\n attributes: IChannelAttributes,\n url?: string,\n ): Promise<LZ4PropertyTree> {\n return await super.load(runtime, id, services, attributes, url) as LZ4PropertyTree;\n }\n\n public create(document: IFluidDataStoreRuntime, id: string, requestUrl?: string): LZ4PropertyTree {\n return super.create(document, id, requestUrl);\n }\n\n public get type() {\n return LZ4PropertyTreeFactory.Type;\n }\n\n public get attributes() {\n return LZ4PropertyTreeFactory.Attributes;\n }\n\n public getEncodeFce() { return compress; }\n public getDecodeFce() { return decompress; }\n public newPropertyTree(\n id: string,\n runtime: IFluidDataStoreRuntime,\n attributes: IChannelAttributes,\n options: SharedPropertyTreeOptions,\n propertyTreeConfig: IPropertyTreeConfig): SharedPropertyTree {\n return new LZ4PropertyTree(id, runtime, attributes, options, propertyTreeConfig);\n }\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;AAY9E,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE1E,MAAM,OAAgB,6BAA6B;IAKvC,wBAAwB,CAAC,QAAQ,EAAE,QAAQ;QAC/C,OAAO;YACH,cAAc,EAAE;gBACZ,MAAM,EAAE,CAAC,MAA4B,EAAE,EAAE;oBACrC,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;oBACtD,MAAM,QAAQ,GAAG,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;oBACxD,MAAM,MAAM,GAAW,QAAQ,CAAC,QAAQ,CAAC,CAAC;oBAC1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AW,UAAU;QACjB,OAAO,sBAAsB,CAAC,UAAU,CAAC;IAC7C,CAAC;IAEM,YAAY,KAAK,OAAO,QAAQ,CAAC,CAAC,CAAC;IACnC,YAAY,KAAK,OAAO,UAAU,CAAC,CAAC,CAAC;IACrC,eAAe,CAClB,EAAU,EACV,OAA+B,EAC/B,UAA8B,EAC9B,OAAkC,EAClC,kBAAuC;QACvC,OAAO,IAAI,eAAe,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,kBAAkB,CAAC,CAAC;IACrF,CAAC;;AAvCsB,2BAAI,GAAG,sCAAsC,CAAC;AAE9C,iCAAU,GAAuB;IACpD,IAAI,EAAE,sBAAsB,CAAC,IAAI;IACjC,qBAAqB,EAAE,KAAK;IAC5B,cAAc,EAAE,OAAO;CAC1B,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 \"@fluidframework/common-utils\";\nimport {\n IChannelAttributes,\n IFluidDataStoreRuntime,\n IChannelServices,\n IChannelFactory,\n} from \"@fluidframework/datastore-definitions\";\nimport {\n IPropertyTreeConfig, IPropertyTreeMessage, ISharedPropertyTreeEncDec,\n ISnapshotSummary, SharedPropertyTree, SharedPropertyTreeOptions,\n}\n from \"./propertyTree\";\nimport { DeflatedPropertyTree, LZ4PropertyTree } from \"./propertyTreeExt\";\n\nexport abstract class CompressedPropertyTreeFactory implements IChannelFactory {\n public abstract get attributes();\n public abstract get type();\n public abstract getEncodeFce();\n public abstract getDecodeFce();\n private createCompressionMethods(encodeFn, decodeFn): ISharedPropertyTreeEncDec {\n return {\n messageEncoder: {\n encode: (change: IPropertyTreeMessage) => {\n const changeSetStr = JSON.stringify(change.changeSet);\n const unzipped = new TextEncoder().encode(changeSetStr);\n const zipped: Buffer = encodeFn(unzipped);\n const zippedStr = bufferToString(zipped, \"base64\");\n if (zippedStr.length < changeSetStr.length) {\n // eslint-disable-next-line @typescript-eslint/dot-notation\n change[\"isZipped\"] = \"1\";\n change.changeSet = zippedStr;\n }\n return change;\n },\n decode: (transferChange: IPropertyTreeMessage) => {\n // eslint-disable-next-line @typescript-eslint/dot-notation\n if (transferChange[\"isZipped\"]) {\n const zipped = new Uint8Array(stringToBuffer(transferChange.changeSet, \"base64\"));\n const unzipped = decodeFn(zipped);\n const changeSetStr = new TextDecoder().decode(unzipped);\n transferChange.changeSet = JSON.parse(changeSetStr);\n }\n return transferChange;\n },\n },\n summaryEncoder: {\n encode: (snapshotSummary: ISnapshotSummary): Buffer => {\n const summaryStr = JSON.stringify(snapshotSummary);\n const unzipped = new TextEncoder().encode(summaryStr);\n const serializedSummary: Buffer = encodeFn(unzipped);\n return serializedSummary;\n },\n decode: (serializedSummary): ISnapshotSummary => {\n const unzipped = decodeFn(serializedSummary);\n const summaryStr = new TextDecoder().decode(unzipped);\n const snapshotSummary: ISnapshotSummary = JSON.parse(summaryStr);\n return snapshotSummary;\n },\n },\n };\n }\n public getEncDec(): ISharedPropertyTreeEncDec {\n return this.createCompressionMethods(this.getEncodeFce(), this.getDecodeFce());\n }\n public abstract newPropertyTree(\n id: string,\n runtime: IFluidDataStoreRuntime,\n attributes: IChannelAttributes,\n options: SharedPropertyTreeOptions,\n propertyTreeConfig: IPropertyTreeConfig): SharedPropertyTree;\n\n public async load(\n runtime: IFluidDataStoreRuntime,\n id: string,\n services: IChannelServices,\n attributes: IChannelAttributes,\n url?: string,\n ): Promise<SharedPropertyTree> {\n const options = {};\n const instance = this.newPropertyTree(id, runtime, attributes,\n options as SharedPropertyTreeOptions\n , { encDec: this.getEncDec() });\n await instance.load(services);\n return instance;\n }\n\n public create(document: IFluidDataStoreRuntime, id: string, requestUrl?: string): SharedPropertyTree {\n const options = {};\n const cell = this.newPropertyTree(id, document,\n this.attributes, options as SharedPropertyTreeOptions,\n { encDec: this.getEncDec() });\n cell.initializeLocal();\n return cell;\n }\n}\n\nexport class DeflatedPropertyTreeFactory extends CompressedPropertyTreeFactory {\n public static readonly Type = \"DeflatedPropertyTree:84534a0fe613522101f6\";\n\n public static readonly Attributes: IChannelAttributes = {\n type: DeflatedPropertyTreeFactory.Type,\n snapshotFormatVersion: \"0.1\",\n packageVersion: \"0.0.1\",\n };\n\n public async load(\n runtime: IFluidDataStoreRuntime,\n id: string,\n services: IChannelServices,\n attributes: IChannelAttributes,\n url?: string,\n ): Promise<DeflatedPropertyTree> {\n return await super.load(runtime, id, services, attributes, url) as DeflatedPropertyTree;\n }\n\n public create(document: IFluidDataStoreRuntime, id: string, requestUrl?: string): DeflatedPropertyTree {\n return super.create(document, id, requestUrl);\n }\n\n public get type() {\n return DeflatedPropertyTreeFactory.Type;\n }\n\n public get attributes() {\n return DeflatedPropertyTreeFactory.Attributes;\n }\n\n public getEncodeFce() { return deflate; }\n public getDecodeFce() { return inflate; }\n public newPropertyTree(\n id: string,\n runtime: IFluidDataStoreRuntime,\n attributes: IChannelAttributes,\n options: SharedPropertyTreeOptions,\n propertyTreeConfig: IPropertyTreeConfig): SharedPropertyTree {\n return new DeflatedPropertyTree(id, runtime, attributes, options, propertyTreeConfig);\n }\n}\n\nexport class LZ4PropertyTreeFactory extends CompressedPropertyTreeFactory {\n public static readonly Type = \"LZ4PropertyTree:84534a0fe613522101f6\";\n\n public static readonly Attributes: IChannelAttributes = {\n type: LZ4PropertyTreeFactory.Type,\n snapshotFormatVersion: \"0.1\",\n packageVersion: \"0.0.1\",\n };\n\n public async load(\n runtime: IFluidDataStoreRuntime,\n id: string,\n services: IChannelServices,\n attributes: IChannelAttributes,\n url?: string,\n ): Promise<LZ4PropertyTree> {\n return await super.load(runtime, id, services, attributes, url) as LZ4PropertyTree;\n }\n\n public create(document: IFluidDataStoreRuntime, id: string, requestUrl?: string): LZ4PropertyTree {\n return super.create(document, id, requestUrl);\n }\n\n public get type() {\n return LZ4PropertyTreeFactory.Type;\n }\n\n public get attributes() {\n return LZ4PropertyTreeFactory.Attributes;\n }\n\n public getEncodeFce() { return compress; }\n public getDecodeFce() { return decompress; }\n public newPropertyTree(\n id: string,\n runtime: IFluidDataStoreRuntime,\n attributes: IChannelAttributes,\n options: SharedPropertyTreeOptions,\n propertyTreeConfig: IPropertyTreeConfig): SharedPropertyTree {\n return new LZ4PropertyTree(id, runtime, attributes, options, propertyTreeConfig);\n }\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.1.
|
|
3
|
+
"version": "2.0.0-internal.1.2.0",
|
|
4
4
|
"description": "definition of the property distributed data store",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -35,16 +35,16 @@
|
|
|
35
35
|
"tsc": "tsc"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@fluid-experimental/property-changeset": "^2.0.0-internal.1.
|
|
39
|
-
"@fluid-experimental/property-properties": "^2.0.0-internal.1.
|
|
38
|
+
"@fluid-experimental/property-changeset": "^2.0.0-internal.1.2.0",
|
|
39
|
+
"@fluid-experimental/property-properties": "^2.0.0-internal.1.2.0",
|
|
40
40
|
"@fluidframework/common-utils": "^1.0.0",
|
|
41
|
-
"@fluidframework/container-definitions": "^2.0.0-internal.1.
|
|
42
|
-
"@fluidframework/core-interfaces": "^2.0.0-internal.1.
|
|
43
|
-
"@fluidframework/datastore-definitions": "^2.0.0-internal.1.
|
|
41
|
+
"@fluidframework/container-definitions": "^2.0.0-internal.1.2.0",
|
|
42
|
+
"@fluidframework/core-interfaces": "^2.0.0-internal.1.2.0",
|
|
43
|
+
"@fluidframework/datastore-definitions": "^2.0.0-internal.1.2.0",
|
|
44
44
|
"@fluidframework/protocol-definitions": "^1.0.0",
|
|
45
|
-
"@fluidframework/runtime-definitions": "^2.0.0-internal.1.
|
|
46
|
-
"@fluidframework/runtime-utils": "^2.0.0-internal.1.
|
|
47
|
-
"@fluidframework/shared-object-base": "^2.0.0-internal.1.
|
|
45
|
+
"@fluidframework/runtime-definitions": "^2.0.0-internal.1.2.0",
|
|
46
|
+
"@fluidframework/runtime-utils": "^2.0.0-internal.1.2.0",
|
|
47
|
+
"@fluidframework/shared-object-base": "^2.0.0-internal.1.2.0",
|
|
48
48
|
"axios": "^0.26.0",
|
|
49
49
|
"fastest-json-copy": "^1.0.1",
|
|
50
50
|
"lodash": "^4.17.21",
|
|
@@ -54,16 +54,16 @@
|
|
|
54
54
|
"uuid": "^8.3.1"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@fluid-experimental/property-common": "^2.0.0-internal.1.
|
|
58
|
-
"@fluidframework/build-common": "^0.
|
|
59
|
-
"@fluidframework/driver-definitions": "^2.0.0-internal.1.
|
|
60
|
-
"@fluidframework/eslint-config-fluid": "^0.
|
|
61
|
-
"@fluidframework/local-driver": "^2.0.0-internal.1.
|
|
62
|
-
"@fluidframework/mocha-test-setup": "^2.0.0-internal.1.
|
|
63
|
-
"@fluidframework/sequence": "^2.0.0-internal.1.
|
|
64
|
-
"@fluidframework/server-local-server": "^0.
|
|
65
|
-
"@fluidframework/test-runtime-utils": "^2.0.0-internal.1.
|
|
66
|
-
"@fluidframework/test-utils": "^2.0.0-internal.1.
|
|
57
|
+
"@fluid-experimental/property-common": "^2.0.0-internal.1.2.0",
|
|
58
|
+
"@fluidframework/build-common": "^1.0.0",
|
|
59
|
+
"@fluidframework/driver-definitions": "^2.0.0-internal.1.2.0",
|
|
60
|
+
"@fluidframework/eslint-config-fluid": "^1.0.0",
|
|
61
|
+
"@fluidframework/local-driver": "^2.0.0-internal.1.2.0",
|
|
62
|
+
"@fluidframework/mocha-test-setup": "^2.0.0-internal.1.2.0",
|
|
63
|
+
"@fluidframework/sequence": "^2.0.0-internal.1.2.0",
|
|
64
|
+
"@fluidframework/server-local-server": "^0.1038.1000",
|
|
65
|
+
"@fluidframework/test-runtime-utils": "^2.0.0-internal.1.2.0",
|
|
66
|
+
"@fluidframework/test-utils": "^2.0.0-internal.1.2.0",
|
|
67
67
|
"@microsoft/api-extractor": "^7.22.2",
|
|
68
68
|
"@rushstack/eslint-config": "^2.5.1",
|
|
69
69
|
"@types/mocha": "^9.1.1",
|