@fluid-experimental/sharejs-json1 2.0.0-internal.3.0.2 → 2.0.0-internal.3.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.
- package/.eslintrc.js +5 -7
- package/.mocharc.js +2 -2
- package/api-extractor.json +2 -2
- package/dist/factory.d.ts.map +1 -1
- package/dist/factory.js +6 -2
- package/dist/factory.js.map +1 -1
- package/dist/json1.d.ts.map +1 -1
- package/dist/json1.js +9 -3
- package/dist/json1.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/lib/factory.d.ts.map +1 -1
- package/lib/factory.js +6 -2
- package/lib/factory.js.map +1 -1
- package/lib/json1.d.ts.map +1 -1
- package/lib/json1.js +10 -4
- package/lib/json1.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/package.json +36 -36
- package/prettier.config.cjs +1 -1
- package/src/factory.ts +35 -31
- package/src/json1.ts +49 -30
- package/src/packageVersion.ts +1 -1
- package/tsconfig.esnext.json +6 -6
- package/tsconfig.json +9 -13
package/.eslintrc.js
CHANGED
|
@@ -4,10 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
module.exports = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
},
|
|
13
|
-
}
|
|
7
|
+
extends: [require.resolve("@fluidframework/eslint-config-fluid/minimal"), "prettier"],
|
|
8
|
+
parserOptions: {
|
|
9
|
+
project: ["./tsconfig.json", "./src/test/tsconfig.json"],
|
|
10
|
+
},
|
|
11
|
+
};
|
package/.mocharc.js
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
"use strict";
|
|
7
7
|
|
|
8
|
-
const getFluidTestMochaConfig = require(
|
|
8
|
+
const getFluidTestMochaConfig = require("@fluidframework/mocha-test-setup/mocharc-common");
|
|
9
9
|
|
|
10
10
|
const packageDir = __dirname;
|
|
11
11
|
const config = getFluidTestMochaConfig(packageDir);
|
package/api-extractor.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
+
"extends": "@fluidframework/build-common/api-extractor-common.json"
|
|
4
4
|
}
|
package/dist/factory.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,QAAQ,EACR,eAAe,EACf,MAAM,uCAAuC,CAAC;AAI/C,qBAAa,YAAa,YAAW,eAAe;IACnD,OAAc,IAAI,SAAmD;IAErE,gBAAuB,UAAU,EAAE,kBAAkB,CAInD;IAEF,IAAW,IAAI,WAEd;IACD,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,QAAQ,CAAC;IAMb,MAAM,CAAC,OAAO,EAAE,sBAAsB,EAAE,EAAE,EAAE,MAAM,GAAG,QAAQ;CAKpE"}
|
package/dist/factory.js
CHANGED
|
@@ -8,8 +8,12 @@ exports.Json1Factory = void 0;
|
|
|
8
8
|
const packageVersion_1 = require("./packageVersion");
|
|
9
9
|
const json1_1 = require("./json1");
|
|
10
10
|
class Json1Factory {
|
|
11
|
-
get type() {
|
|
12
|
-
|
|
11
|
+
get type() {
|
|
12
|
+
return Json1Factory.Type;
|
|
13
|
+
}
|
|
14
|
+
get attributes() {
|
|
15
|
+
return Json1Factory.Attributes;
|
|
16
|
+
}
|
|
13
17
|
/**
|
|
14
18
|
* {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}
|
|
15
19
|
*/
|
package/dist/factory.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AASH,qDAA8C;AAC9C,mCAAsC;AAEtC,MAAa,YAAY;
|
|
1
|
+
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AASH,qDAA8C;AAC9C,mCAAsC;AAEtC,MAAa,YAAY;IASxB,IAAW,IAAI;QACd,OAAO,YAAY,CAAC,IAAI,CAAC;IAC1B,CAAC;IACD,IAAW,UAAU;QACpB,OAAO,YAAY,CAAC,UAAU,CAAC;IAChC,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,IAAI,CAChB,OAA+B,EAC/B,EAAU,EACV,QAA0B,EAC1B,UAA8B;QAE9B,MAAM,QAAQ,GAAG,IAAI,mBAAW,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QAC1D,MAAM,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC9B,OAAO,QAAQ,CAAC;IACjB,CAAC;IAEM,MAAM,CAAC,OAA+B,EAAE,EAAU;QACxD,MAAM,QAAQ,GAAG,IAAI,mBAAW,CAAC,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAC/D,QAAQ,CAAC,eAAe,EAAE,CAAC;QAC3B,OAAO,QAAQ,CAAC;IACjB,CAAC;;AAlCF,oCAmCC;AAlCc,iBAAI,GAAG,+CAA+C,CAAC;AAE9C,uBAAU,GAAuB;IACvD,IAAI,EAAE,YAAY,CAAC,IAAI;IACvB,qBAAqB,EAAE,KAAK;IAC5B,cAAc,EAAE,2BAAU;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\tIChannel,\n\tIChannelFactory,\n} from \"@fluidframework/datastore-definitions\";\nimport { pkgVersion } from \"./packageVersion\";\nimport { SharedJson1 } from \"./json1\";\n\nexport class Json1Factory implements IChannelFactory {\n\tpublic static Type = \"https://graph.microsoft.com/types/sharedjson1\";\n\n\tpublic static readonly Attributes: IChannelAttributes = {\n\t\ttype: Json1Factory.Type,\n\t\tsnapshotFormatVersion: \"0.1\",\n\t\tpackageVersion: pkgVersion,\n\t};\n\n\tpublic get type() {\n\t\treturn Json1Factory.Type;\n\t}\n\tpublic get attributes() {\n\t\treturn Json1Factory.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<IChannel> {\n\t\tconst instance = new SharedJson1(id, runtime, attributes);\n\t\tawait instance.load(services);\n\t\treturn instance;\n\t}\n\n\tpublic create(runtime: IFluidDataStoreRuntime, id: string): IChannel {\n\t\tconst instance = new SharedJson1(id, runtime, this.attributes);\n\t\tinstance.initializeLocal();\n\t\treturn instance;\n\t}\n}\n"]}
|
package/dist/json1.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json1.d.ts","sourceRoot":"","sources":["../src/json1.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"json1.d.ts","sourceRoot":"","sources":["../src/json1.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,kBAAkB,EAClB,sBAAsB,EACtB,YAAY,EACZ,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EACN,GAAG,EAEH,MAAM,EAKN,IAAI,EACJ,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,qBAAa,WAAY,SAAQ,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;WACvC,MAAM,CAAC,OAAO,EAAE,sBAAsB,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,WAAW;WAIjE,UAAU;gBAIZ,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,sBAAsB,EAAE,UAAU,EAAE,kBAAkB;IAKhF,GAAG,IAAI,GAAG;IAIV,KAAK,CAAC,EAAE,EAAE,MAAM;IAIvB,SAAS,CAAC,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM;IAI7D,SAAS,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM;IAInC,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY;IAItC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI;IAIzB,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,EAAE,OAAO;IAIlC,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,YAAY;CAGzE"}
|
package/dist/json1.js
CHANGED
|
@@ -12,13 +12,19 @@ class SharedJson1 extends ot_1.SharedOT {
|
|
|
12
12
|
static create(runtime, id) {
|
|
13
13
|
return runtime.createChannel(id, factory_1.Json1Factory.Type);
|
|
14
14
|
}
|
|
15
|
-
static getFactory() {
|
|
15
|
+
static getFactory() {
|
|
16
|
+
return new factory_1.Json1Factory();
|
|
17
|
+
}
|
|
16
18
|
constructor(id, runtime, attributes) {
|
|
17
19
|
// RATIONALE: 'undefined' is not preserved by JSON.stringify().
|
|
18
20
|
super(id, runtime, attributes, /* initialValue: */ null);
|
|
19
21
|
}
|
|
20
|
-
get() {
|
|
21
|
-
|
|
22
|
+
get() {
|
|
23
|
+
return this.state;
|
|
24
|
+
}
|
|
25
|
+
apply(op) {
|
|
26
|
+
super.apply(op);
|
|
27
|
+
}
|
|
22
28
|
transform(input, transform) {
|
|
23
29
|
return ot_json1_1.type.transformNoConflict(input, transform, "left");
|
|
24
30
|
}
|
package/dist/json1.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json1.js","sourceRoot":"","sources":["../src/json1.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;
|
|
1
|
+
{"version":3,"file":"json1.js","sourceRoot":"","sources":["../src/json1.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAOH,+CAAkD;AAClD,uCASkB;AAClB,uCAAyC;AAEzC,MAAa,WAAY,SAAQ,aAAqB;IAC9C,MAAM,CAAC,MAAM,CAAC,OAA+B,EAAE,EAAW;QAChE,OAAO,OAAO,CAAC,aAAa,CAAC,EAAE,EAAE,sBAAY,CAAC,IAAI,CAAgB,CAAC;IACpE,CAAC;IAEM,MAAM,CAAC,UAAU;QACvB,OAAO,IAAI,sBAAY,EAAE,CAAC;IAC3B,CAAC;IAED,YAAY,EAAU,EAAE,OAA+B,EAAE,UAA8B;QACtF,+DAA+D;QAC/D,KAAK,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAC1D,CAAC;IAEM,GAAG;QACT,OAAO,IAAI,CAAC,KAAK,CAAC;IACnB,CAAC;IAEM,KAAK,CAAC,EAAU;QACtB,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACjB,CAAC;IAES,SAAS,CAAC,KAAa,EAAE,SAAiB;QACnD,OAAO,eAAW,CAAC,mBAAmB,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IAClE,CAAC;IAES,SAAS,CAAC,KAAU,EAAE,EAAU;QACzC,OAAO,eAAW,CAAC,KAAK,CAAC,KAAK,EAAE,EAAE,CAAQ,CAAC;IAC5C,CAAC;IAEM,MAAM,CAAC,IAAU,EAAE,KAAmB;QAC5C,IAAI,CAAC,KAAK,CAAC,IAAA,mBAAQ,EAAC,IAAI,EAAE,KAAY,CAAC,CAAC,CAAC;IAC1C,CAAC;IAEM,IAAI,CAAC,IAAU,EAAE,EAAQ;QAC/B,IAAI,CAAC,KAAK,CAAC,IAAA,iBAAM,EAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;IAC9B,CAAC;IAEM,MAAM,CAAC,IAAU,EAAE,KAAe;QACxC,IAAI,CAAC,KAAK,CAAC,IAAA,mBAAQ,EAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;IACnC,CAAC;IAEM,OAAO,CAAC,IAAU,EAAE,QAAsB,EAAE,QAAsB;QACxE,IAAI,CAAC,KAAK,CAAC,IAAA,oBAAS,EAAC,IAAI,EAAE,QAAe,EAAE,QAAe,CAAC,CAAC,CAAC;IAC/D,CAAC;CACD;AA7CD,kCA6CC","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\tSerializable,\n} from \"@fluidframework/datastore-definitions\";\nimport { SharedOT } from \"@fluid-experimental/ot\";\nimport {\n\tDoc,\n\ttype as Json1OTType,\n\tJSONOp,\n\treplaceOp,\n\tinsertOp,\n\tmoveOp,\n\tremoveOp,\n\tPath,\n} from \"ot-json1\";\nimport { Json1Factory } from \"./factory\";\n\nexport class SharedJson1 extends SharedOT<Doc, JSONOp> {\n\tpublic static create(runtime: IFluidDataStoreRuntime, id?: string): SharedJson1 {\n\t\treturn runtime.createChannel(id, Json1Factory.Type) as SharedJson1;\n\t}\n\n\tpublic static getFactory() {\n\t\treturn new Json1Factory();\n\t}\n\n\tconstructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes) {\n\t\t// RATIONALE: 'undefined' is not preserved by JSON.stringify().\n\t\tsuper(id, runtime, attributes, /* initialValue: */ null);\n\t}\n\n\tpublic get(): Doc {\n\t\treturn this.state;\n\t}\n\n\tpublic apply(op: JSONOp) {\n\t\tsuper.apply(op);\n\t}\n\n\tprotected transform(input: JSONOp, transform: JSONOp): JSONOp {\n\t\treturn Json1OTType.transformNoConflict(input, transform, \"left\");\n\t}\n\n\tprotected applyCore(state: Doc, op: JSONOp) {\n\t\treturn Json1OTType.apply(state, op) as Doc;\n\t}\n\n\tpublic insert(path: Path, value: Serializable) {\n\t\tthis.apply(insertOp(path, value as Doc));\n\t}\n\n\tpublic move(from: Path, to: Path) {\n\t\tthis.apply(moveOp(from, to));\n\t}\n\n\tpublic remove(path: Path, value?: boolean) {\n\t\tthis.apply(removeOp(path, value));\n\t}\n\n\tpublic replace(path: Path, oldValue: Serializable, newValue: Serializable) {\n\t\tthis.apply(replaceOp(path, oldValue as Doc, newValue as Doc));\n\t}\n}\n"]}
|
package/dist/packageVersion.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export declare const pkgName = "@fluid-experimental/sharejs-json1";
|
|
8
|
-
export declare const pkgVersion = "2.0.0-internal.3.0
|
|
8
|
+
export declare const pkgVersion = "2.0.0-internal.3.2.0";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
package/dist/packageVersion.js
CHANGED
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.pkgVersion = exports.pkgName = void 0;
|
|
10
10
|
exports.pkgName = "@fluid-experimental/sharejs-json1";
|
|
11
|
-
exports.pkgVersion = "2.0.0-internal.3.0
|
|
11
|
+
exports.pkgVersion = "2.0.0-internal.3.2.0";
|
|
12
12
|
//# sourceMappingURL=packageVersion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,mCAAmC,CAAC;AAC9C,QAAA,UAAU,GAAG,sBAAsB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluid-experimental/sharejs-json1\";\nexport const pkgVersion = \"2.0.0-internal.3.0
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,mCAAmC,CAAC;AAC9C,QAAA,UAAU,GAAG,sBAAsB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluid-experimental/sharejs-json1\";\nexport const pkgVersion = \"2.0.0-internal.3.2.0\";\n"]}
|
package/lib/factory.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,QAAQ,EACR,eAAe,EACf,MAAM,uCAAuC,CAAC;AAI/C,qBAAa,YAAa,YAAW,eAAe;IACnD,OAAc,IAAI,SAAmD;IAErE,gBAAuB,UAAU,EAAE,kBAAkB,CAInD;IAEF,IAAW,IAAI,WAEd;IACD,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,QAAQ,CAAC;IAMb,MAAM,CAAC,OAAO,EAAE,sBAAsB,EAAE,EAAE,EAAE,MAAM,GAAG,QAAQ;CAKpE"}
|
package/lib/factory.js
CHANGED
|
@@ -5,8 +5,12 @@
|
|
|
5
5
|
import { pkgVersion } from "./packageVersion";
|
|
6
6
|
import { SharedJson1 } from "./json1";
|
|
7
7
|
export class Json1Factory {
|
|
8
|
-
get type() {
|
|
9
|
-
|
|
8
|
+
get type() {
|
|
9
|
+
return Json1Factory.Type;
|
|
10
|
+
}
|
|
11
|
+
get attributes() {
|
|
12
|
+
return Json1Factory.Attributes;
|
|
13
|
+
}
|
|
10
14
|
/**
|
|
11
15
|
* {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}
|
|
12
16
|
*/
|
package/lib/factory.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,MAAM,OAAO,YAAY;
|
|
1
|
+
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,MAAM,OAAO,YAAY;IASxB,IAAW,IAAI;QACd,OAAO,YAAY,CAAC,IAAI,CAAC;IAC1B,CAAC;IACD,IAAW,UAAU;QACpB,OAAO,YAAY,CAAC,UAAU,CAAC;IAChC,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,IAAI,CAChB,OAA+B,EAC/B,EAAU,EACV,QAA0B,EAC1B,UAA8B;QAE9B,MAAM,QAAQ,GAAG,IAAI,WAAW,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QAC1D,MAAM,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC9B,OAAO,QAAQ,CAAC;IACjB,CAAC;IAEM,MAAM,CAAC,OAA+B,EAAE,EAAU;QACxD,MAAM,QAAQ,GAAG,IAAI,WAAW,CAAC,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAC/D,QAAQ,CAAC,eAAe,EAAE,CAAC;QAC3B,OAAO,QAAQ,CAAC;IACjB,CAAC;;AAjCa,iBAAI,GAAG,+CAA+C,CAAC;AAE9C,uBAAU,GAAuB;IACvD,IAAI,EAAE,YAAY,CAAC,IAAI;IACvB,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\tIChannel,\n\tIChannelFactory,\n} from \"@fluidframework/datastore-definitions\";\nimport { pkgVersion } from \"./packageVersion\";\nimport { SharedJson1 } from \"./json1\";\n\nexport class Json1Factory implements IChannelFactory {\n\tpublic static Type = \"https://graph.microsoft.com/types/sharedjson1\";\n\n\tpublic static readonly Attributes: IChannelAttributes = {\n\t\ttype: Json1Factory.Type,\n\t\tsnapshotFormatVersion: \"0.1\",\n\t\tpackageVersion: pkgVersion,\n\t};\n\n\tpublic get type() {\n\t\treturn Json1Factory.Type;\n\t}\n\tpublic get attributes() {\n\t\treturn Json1Factory.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<IChannel> {\n\t\tconst instance = new SharedJson1(id, runtime, attributes);\n\t\tawait instance.load(services);\n\t\treturn instance;\n\t}\n\n\tpublic create(runtime: IFluidDataStoreRuntime, id: string): IChannel {\n\t\tconst instance = new SharedJson1(id, runtime, this.attributes);\n\t\tinstance.initializeLocal();\n\t\treturn instance;\n\t}\n}\n"]}
|
package/lib/json1.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json1.d.ts","sourceRoot":"","sources":["../src/json1.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"json1.d.ts","sourceRoot":"","sources":["../src/json1.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,kBAAkB,EAClB,sBAAsB,EACtB,YAAY,EACZ,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EACN,GAAG,EAEH,MAAM,EAKN,IAAI,EACJ,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,qBAAa,WAAY,SAAQ,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;WACvC,MAAM,CAAC,OAAO,EAAE,sBAAsB,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,WAAW;WAIjE,UAAU;gBAIZ,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,sBAAsB,EAAE,UAAU,EAAE,kBAAkB;IAKhF,GAAG,IAAI,GAAG;IAIV,KAAK,CAAC,EAAE,EAAE,MAAM;IAIvB,SAAS,CAAC,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM;IAI7D,SAAS,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM;IAInC,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY;IAItC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI;IAIzB,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,EAAE,OAAO;IAIlC,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,YAAY;CAGzE"}
|
package/lib/json1.js
CHANGED
|
@@ -3,19 +3,25 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import { SharedOT } from "@fluid-experimental/ot";
|
|
6
|
-
import { type as Json1OTType, replaceOp, insertOp, moveOp, removeOp } from "ot-json1";
|
|
6
|
+
import { type as Json1OTType, replaceOp, insertOp, moveOp, removeOp, } from "ot-json1";
|
|
7
7
|
import { Json1Factory } from "./factory";
|
|
8
8
|
export class SharedJson1 extends SharedOT {
|
|
9
9
|
static create(runtime, id) {
|
|
10
10
|
return runtime.createChannel(id, Json1Factory.Type);
|
|
11
11
|
}
|
|
12
|
-
static getFactory() {
|
|
12
|
+
static getFactory() {
|
|
13
|
+
return new Json1Factory();
|
|
14
|
+
}
|
|
13
15
|
constructor(id, runtime, attributes) {
|
|
14
16
|
// RATIONALE: 'undefined' is not preserved by JSON.stringify().
|
|
15
17
|
super(id, runtime, attributes, /* initialValue: */ null);
|
|
16
18
|
}
|
|
17
|
-
get() {
|
|
18
|
-
|
|
19
|
+
get() {
|
|
20
|
+
return this.state;
|
|
21
|
+
}
|
|
22
|
+
apply(op) {
|
|
23
|
+
super.apply(op);
|
|
24
|
+
}
|
|
19
25
|
transform(input, transform) {
|
|
20
26
|
return Json1OTType.transformNoConflict(input, transform, "left");
|
|
21
27
|
}
|
package/lib/json1.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json1.js","sourceRoot":"","sources":["../src/json1.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"json1.js","sourceRoot":"","sources":["../src/json1.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAEN,IAAI,IAAI,WAAW,EAEnB,SAAS,EACT,QAAQ,EACR,MAAM,EACN,QAAQ,GAER,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,OAAO,WAAY,SAAQ,QAAqB;IAC9C,MAAM,CAAC,MAAM,CAAC,OAA+B,EAAE,EAAW;QAChE,OAAO,OAAO,CAAC,aAAa,CAAC,EAAE,EAAE,YAAY,CAAC,IAAI,CAAgB,CAAC;IACpE,CAAC;IAEM,MAAM,CAAC,UAAU;QACvB,OAAO,IAAI,YAAY,EAAE,CAAC;IAC3B,CAAC;IAED,YAAY,EAAU,EAAE,OAA+B,EAAE,UAA8B;QACtF,+DAA+D;QAC/D,KAAK,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAC1D,CAAC;IAEM,GAAG;QACT,OAAO,IAAI,CAAC,KAAK,CAAC;IACnB,CAAC;IAEM,KAAK,CAAC,EAAU;QACtB,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACjB,CAAC;IAES,SAAS,CAAC,KAAa,EAAE,SAAiB;QACnD,OAAO,WAAW,CAAC,mBAAmB,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IAClE,CAAC;IAES,SAAS,CAAC,KAAU,EAAE,EAAU;QACzC,OAAO,WAAW,CAAC,KAAK,CAAC,KAAK,EAAE,EAAE,CAAQ,CAAC;IAC5C,CAAC;IAEM,MAAM,CAAC,IAAU,EAAE,KAAmB;QAC5C,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAY,CAAC,CAAC,CAAC;IAC1C,CAAC;IAEM,IAAI,CAAC,IAAU,EAAE,EAAQ;QAC/B,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;IAC9B,CAAC;IAEM,MAAM,CAAC,IAAU,EAAE,KAAe;QACxC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;IACnC,CAAC;IAEM,OAAO,CAAC,IAAU,EAAE,QAAsB,EAAE,QAAsB;QACxE,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,QAAe,EAAE,QAAe,CAAC,CAAC,CAAC;IAC/D,CAAC;CACD","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\tSerializable,\n} from \"@fluidframework/datastore-definitions\";\nimport { SharedOT } from \"@fluid-experimental/ot\";\nimport {\n\tDoc,\n\ttype as Json1OTType,\n\tJSONOp,\n\treplaceOp,\n\tinsertOp,\n\tmoveOp,\n\tremoveOp,\n\tPath,\n} from \"ot-json1\";\nimport { Json1Factory } from \"./factory\";\n\nexport class SharedJson1 extends SharedOT<Doc, JSONOp> {\n\tpublic static create(runtime: IFluidDataStoreRuntime, id?: string): SharedJson1 {\n\t\treturn runtime.createChannel(id, Json1Factory.Type) as SharedJson1;\n\t}\n\n\tpublic static getFactory() {\n\t\treturn new Json1Factory();\n\t}\n\n\tconstructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes) {\n\t\t// RATIONALE: 'undefined' is not preserved by JSON.stringify().\n\t\tsuper(id, runtime, attributes, /* initialValue: */ null);\n\t}\n\n\tpublic get(): Doc {\n\t\treturn this.state;\n\t}\n\n\tpublic apply(op: JSONOp) {\n\t\tsuper.apply(op);\n\t}\n\n\tprotected transform(input: JSONOp, transform: JSONOp): JSONOp {\n\t\treturn Json1OTType.transformNoConflict(input, transform, \"left\");\n\t}\n\n\tprotected applyCore(state: Doc, op: JSONOp) {\n\t\treturn Json1OTType.apply(state, op) as Doc;\n\t}\n\n\tpublic insert(path: Path, value: Serializable) {\n\t\tthis.apply(insertOp(path, value as Doc));\n\t}\n\n\tpublic move(from: Path, to: Path) {\n\t\tthis.apply(moveOp(from, to));\n\t}\n\n\tpublic remove(path: Path, value?: boolean) {\n\t\tthis.apply(removeOp(path, value));\n\t}\n\n\tpublic replace(path: Path, oldValue: Serializable, newValue: Serializable) {\n\t\tthis.apply(replaceOp(path, oldValue as Doc, newValue as Doc));\n\t}\n}\n"]}
|
package/lib/packageVersion.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export declare const pkgName = "@fluid-experimental/sharejs-json1";
|
|
8
|
-
export declare const pkgVersion = "2.0.0-internal.3.0
|
|
8
|
+
export declare const pkgVersion = "2.0.0-internal.3.2.0";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
package/lib/packageVersion.js
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export const pkgName = "@fluid-experimental/sharejs-json1";
|
|
8
|
-
export const pkgVersion = "2.0.0-internal.3.0
|
|
8
|
+
export const pkgVersion = "2.0.0-internal.3.2.0";
|
|
9
9
|
//# sourceMappingURL=packageVersion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,mCAAmC,CAAC;AAC3D,MAAM,CAAC,MAAM,UAAU,GAAG,sBAAsB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluid-experimental/sharejs-json1\";\nexport const pkgVersion = \"2.0.0-internal.3.0
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,mCAAmC,CAAC;AAC3D,MAAM,CAAC,MAAM,UAAU,GAAG,sBAAsB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluid-experimental/sharejs-json1\";\nexport const pkgVersion = \"2.0.0-internal.3.2.0\";\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-experimental/sharejs-json1",
|
|
3
|
-
"version": "2.0.0-internal.3.0
|
|
3
|
+
"version": "2.0.0-internal.3.2.0",
|
|
4
4
|
"description": "Distributed data structure for hosting ottypes",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -14,32 +14,6 @@
|
|
|
14
14
|
"main": "dist/index.js",
|
|
15
15
|
"module": "lib/index.js",
|
|
16
16
|
"types": "dist/index.d.ts",
|
|
17
|
-
"scripts": {
|
|
18
|
-
"build": "npm run build:genver && concurrently npm:build:compile npm:lint",
|
|
19
|
-
"build:commonjs": "npm run tsc && npm run build:test",
|
|
20
|
-
"build:compile": "concurrently npm:build:commonjs npm:build:esnext",
|
|
21
|
-
"build:docs": "api-extractor run --local && copyfiles -u 1 ./_api-extractor-temp/doc-models/* ../../../../../_api-extractor-temp/",
|
|
22
|
-
"build:esnext": "tsc --project ./tsconfig.esnext.json",
|
|
23
|
-
"build:full": "npm run build",
|
|
24
|
-
"build:full:compile": "npm run build:compile",
|
|
25
|
-
"build:genver": "gen-version",
|
|
26
|
-
"build:test": "tsc --project ./src/test/tsconfig.json",
|
|
27
|
-
"ci:build:docs": "api-extractor run --typescript-compiler-folder ../../../../../node_modules/typescript && copyfiles -u 1 ./_api-extractor-temp/doc-models/* ../../../../../_api-extractor-temp/",
|
|
28
|
-
"clean": "rimraf dist lib *.tsbuildinfo *.build.log",
|
|
29
|
-
"dev": "npm run tsc && concurrently 'npm run tsc -- --watch' 'npm run build:test -- --watch'",
|
|
30
|
-
"eslint": "eslint --format stylish src",
|
|
31
|
-
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
|
|
32
|
-
"format": "npm run prettier:fix",
|
|
33
|
-
"lint": "npm run eslint",
|
|
34
|
-
"lint:fix": "npm run eslint:fix",
|
|
35
|
-
"prettier": "prettier --check . --ignore-path ../../../.prettierignore",
|
|
36
|
-
"prettier:fix": "prettier --write . --ignore-path ../../../.prettierignore",
|
|
37
|
-
"test": "npm run test:mocha",
|
|
38
|
-
"test:coverage": "nyc npm test -- --reporter xunit --reporter-option output=nyc/junit-report.xml",
|
|
39
|
-
"test:mocha": "mocha --recursive dist/test -r node_modules/@fluidframework/mocha-test-setup --unhandled-rejections=strict",
|
|
40
|
-
"test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha",
|
|
41
|
-
"tsc": "tsc"
|
|
42
|
-
},
|
|
43
17
|
"nyc": {
|
|
44
18
|
"all": true,
|
|
45
19
|
"cache-dir": "nyc/.cache",
|
|
@@ -61,20 +35,20 @@
|
|
|
61
35
|
"temp-directory": "nyc/.nyc_output"
|
|
62
36
|
},
|
|
63
37
|
"dependencies": {
|
|
64
|
-
"@fluid-experimental/ot": ">=2.0.0-internal.3.0
|
|
65
|
-
"@fluidframework/common-utils": "^1.
|
|
66
|
-
"@fluidframework/core-interfaces": ">=2.0.0-internal.3.0
|
|
67
|
-
"@fluidframework/datastore-definitions": ">=2.0.0-internal.3.0
|
|
38
|
+
"@fluid-experimental/ot": ">=2.0.0-internal.3.2.0 <2.0.0-internal.4.0.0",
|
|
39
|
+
"@fluidframework/common-utils": "^1.1.1",
|
|
40
|
+
"@fluidframework/core-interfaces": ">=2.0.0-internal.3.2.0 <2.0.0-internal.4.0.0",
|
|
41
|
+
"@fluidframework/datastore-definitions": ">=2.0.0-internal.3.2.0 <2.0.0-internal.4.0.0",
|
|
68
42
|
"@fluidframework/protocol-definitions": "^1.1.0",
|
|
69
|
-
"@fluidframework/shared-object-base": ">=2.0.0-internal.3.0
|
|
43
|
+
"@fluidframework/shared-object-base": ">=2.0.0-internal.3.2.0 <2.0.0-internal.4.0.0",
|
|
70
44
|
"ot-json1": "^1.0.1"
|
|
71
45
|
},
|
|
72
46
|
"devDependencies": {
|
|
73
|
-
"@fluid-internal/test-dds-utils": ">=2.0.0-internal.3.0
|
|
47
|
+
"@fluid-internal/test-dds-utils": ">=2.0.0-internal.3.2.0 <2.0.0-internal.4.0.0",
|
|
74
48
|
"@fluidframework/build-common": "^1.1.0",
|
|
75
49
|
"@fluidframework/eslint-config-fluid": "^2.0.0",
|
|
76
|
-
"@fluidframework/mocha-test-setup": ">=2.0.0-internal.3.0
|
|
77
|
-
"@fluidframework/test-runtime-utils": ">=2.0.0-internal.3.0
|
|
50
|
+
"@fluidframework/mocha-test-setup": ">=2.0.0-internal.3.2.0 <2.0.0-internal.4.0.0",
|
|
51
|
+
"@fluidframework/test-runtime-utils": ">=2.0.0-internal.3.2.0 <2.0.0-internal.4.0.0",
|
|
78
52
|
"@microsoft/api-extractor": "^7.22.2",
|
|
79
53
|
"@rushstack/eslint-config": "^2.5.1",
|
|
80
54
|
"@types/mocha": "^9.1.1",
|
|
@@ -94,5 +68,31 @@
|
|
|
94
68
|
"disabled": true,
|
|
95
69
|
"version": "2.0.0-internal.2.1.0",
|
|
96
70
|
"broken": {}
|
|
71
|
+
},
|
|
72
|
+
"scripts": {
|
|
73
|
+
"build": "npm run build:genver && concurrently npm:build:compile npm:lint",
|
|
74
|
+
"build:commonjs": "npm run tsc && npm run build:test",
|
|
75
|
+
"build:compile": "concurrently npm:build:commonjs npm:build:esnext",
|
|
76
|
+
"build:docs": "api-extractor run --local && copyfiles -u 1 ./_api-extractor-temp/doc-models/* ../../../../../_api-extractor-temp/",
|
|
77
|
+
"build:esnext": "tsc --project ./tsconfig.esnext.json",
|
|
78
|
+
"build:full": "npm run build",
|
|
79
|
+
"build:full:compile": "npm run build:compile",
|
|
80
|
+
"build:genver": "gen-version",
|
|
81
|
+
"build:test": "tsc --project ./src/test/tsconfig.json",
|
|
82
|
+
"ci:build:docs": "api-extractor run --typescript-compiler-folder ../../../../../node_modules/typescript && copyfiles -u 1 ./_api-extractor-temp/doc-models/* ../../../../../_api-extractor-temp/",
|
|
83
|
+
"clean": "rimraf dist lib *.tsbuildinfo *.build.log",
|
|
84
|
+
"dev": "npm run tsc && concurrently 'npm run tsc -- --watch' 'npm run build:test -- --watch'",
|
|
85
|
+
"eslint": "eslint --format stylish src",
|
|
86
|
+
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
|
|
87
|
+
"format": "npm run prettier:fix",
|
|
88
|
+
"lint": "npm run prettier && npm run eslint",
|
|
89
|
+
"lint:fix": "npm run prettier:fix && npm run eslint:fix",
|
|
90
|
+
"prettier": "prettier --check . --ignore-path ../../../../../.prettierignore",
|
|
91
|
+
"prettier:fix": "prettier --write . --ignore-path ../../../../../.prettierignore",
|
|
92
|
+
"test": "npm run test:mocha",
|
|
93
|
+
"test:coverage": "nyc npm test -- --reporter xunit --reporter-option output=nyc/junit-report.xml",
|
|
94
|
+
"test:mocha": "mocha --recursive dist/test -r node_modules/@fluidframework/mocha-test-setup --unhandled-rejections=strict",
|
|
95
|
+
"test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha",
|
|
96
|
+
"tsc": "tsc"
|
|
97
97
|
}
|
|
98
|
-
}
|
|
98
|
+
}
|
package/prettier.config.cjs
CHANGED
package/src/factory.ts
CHANGED
|
@@ -4,44 +4,48 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
IChannelAttributes,
|
|
8
|
+
IFluidDataStoreRuntime,
|
|
9
|
+
IChannelServices,
|
|
10
|
+
IChannel,
|
|
11
|
+
IChannelFactory,
|
|
12
12
|
} from "@fluidframework/datastore-definitions";
|
|
13
13
|
import { pkgVersion } from "./packageVersion";
|
|
14
14
|
import { SharedJson1 } from "./json1";
|
|
15
15
|
|
|
16
16
|
export class Json1Factory implements IChannelFactory {
|
|
17
|
-
|
|
17
|
+
public static Type = "https://graph.microsoft.com/types/sharedjson1";
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
public static readonly Attributes: IChannelAttributes = {
|
|
20
|
+
type: Json1Factory.Type,
|
|
21
|
+
snapshotFormatVersion: "0.1",
|
|
22
|
+
packageVersion: pkgVersion,
|
|
23
|
+
};
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
public get type() {
|
|
26
|
+
return Json1Factory.Type;
|
|
27
|
+
}
|
|
28
|
+
public get attributes() {
|
|
29
|
+
return Json1Factory.Attributes;
|
|
30
|
+
}
|
|
27
31
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
32
|
+
/**
|
|
33
|
+
* {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}
|
|
34
|
+
*/
|
|
35
|
+
public async load(
|
|
36
|
+
runtime: IFluidDataStoreRuntime,
|
|
37
|
+
id: string,
|
|
38
|
+
services: IChannelServices,
|
|
39
|
+
attributes: IChannelAttributes,
|
|
40
|
+
): Promise<IChannel> {
|
|
41
|
+
const instance = new SharedJson1(id, runtime, attributes);
|
|
42
|
+
await instance.load(services);
|
|
43
|
+
return instance;
|
|
44
|
+
}
|
|
41
45
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
public create(runtime: IFluidDataStoreRuntime, id: string): IChannel {
|
|
47
|
+
const instance = new SharedJson1(id, runtime, this.attributes);
|
|
48
|
+
instance.initializeLocal();
|
|
49
|
+
return instance;
|
|
50
|
+
}
|
|
47
51
|
}
|
package/src/json1.ts
CHANGED
|
@@ -3,48 +3,67 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
IChannelAttributes,
|
|
8
|
+
IFluidDataStoreRuntime,
|
|
9
|
+
Serializable,
|
|
10
|
+
} from "@fluidframework/datastore-definitions";
|
|
7
11
|
import { SharedOT } from "@fluid-experimental/ot";
|
|
8
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
Doc,
|
|
14
|
+
type as Json1OTType,
|
|
15
|
+
JSONOp,
|
|
16
|
+
replaceOp,
|
|
17
|
+
insertOp,
|
|
18
|
+
moveOp,
|
|
19
|
+
removeOp,
|
|
20
|
+
Path,
|
|
21
|
+
} from "ot-json1";
|
|
9
22
|
import { Json1Factory } from "./factory";
|
|
10
23
|
|
|
11
24
|
export class SharedJson1 extends SharedOT<Doc, JSONOp> {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
25
|
+
public static create(runtime: IFluidDataStoreRuntime, id?: string): SharedJson1 {
|
|
26
|
+
return runtime.createChannel(id, Json1Factory.Type) as SharedJson1;
|
|
27
|
+
}
|
|
15
28
|
|
|
16
|
-
|
|
29
|
+
public static getFactory() {
|
|
30
|
+
return new Json1Factory();
|
|
31
|
+
}
|
|
17
32
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
33
|
+
constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes) {
|
|
34
|
+
// RATIONALE: 'undefined' is not preserved by JSON.stringify().
|
|
35
|
+
super(id, runtime, attributes, /* initialValue: */ null);
|
|
36
|
+
}
|
|
22
37
|
|
|
23
|
-
|
|
38
|
+
public get(): Doc {
|
|
39
|
+
return this.state;
|
|
40
|
+
}
|
|
24
41
|
|
|
25
|
-
|
|
42
|
+
public apply(op: JSONOp) {
|
|
43
|
+
super.apply(op);
|
|
44
|
+
}
|
|
26
45
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
46
|
+
protected transform(input: JSONOp, transform: JSONOp): JSONOp {
|
|
47
|
+
return Json1OTType.transformNoConflict(input, transform, "left");
|
|
48
|
+
}
|
|
30
49
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
50
|
+
protected applyCore(state: Doc, op: JSONOp) {
|
|
51
|
+
return Json1OTType.apply(state, op) as Doc;
|
|
52
|
+
}
|
|
34
53
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
54
|
+
public insert(path: Path, value: Serializable) {
|
|
55
|
+
this.apply(insertOp(path, value as Doc));
|
|
56
|
+
}
|
|
38
57
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
58
|
+
public move(from: Path, to: Path) {
|
|
59
|
+
this.apply(moveOp(from, to));
|
|
60
|
+
}
|
|
42
61
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
62
|
+
public remove(path: Path, value?: boolean) {
|
|
63
|
+
this.apply(removeOp(path, value));
|
|
64
|
+
}
|
|
46
65
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
66
|
+
public replace(path: Path, oldValue: Serializable, newValue: Serializable) {
|
|
67
|
+
this.apply(replaceOp(path, oldValue as Doc, newValue as Doc));
|
|
68
|
+
}
|
|
50
69
|
}
|
package/src/packageVersion.ts
CHANGED
package/tsconfig.esnext.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
2
|
+
"extends": "./tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"outDir": "./lib",
|
|
5
|
+
"module": "esnext",
|
|
6
|
+
},
|
|
7
|
+
}
|
package/tsconfig.json
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"include": [
|
|
12
|
-
"src/**/*"
|
|
13
|
-
]
|
|
14
|
-
}
|
|
2
|
+
"extends": "@fluidframework/build-common/ts-common-config.json",
|
|
3
|
+
"exclude": ["src/test/**/*"],
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"rootDir": "./src",
|
|
6
|
+
"outDir": "./dist",
|
|
7
|
+
"composite": true,
|
|
8
|
+
},
|
|
9
|
+
"include": ["src/**/*"],
|
|
10
|
+
}
|