@fluid-experimental/pact-map 2.91.0 → 2.92.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/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/pactMapFactory.d.ts.map +1 -1
- package/dist/pactMapFactory.js +3 -0
- package/dist/pactMapFactory.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/pactMapFactory.d.ts.map +1 -1
- package/lib/pactMapFactory.js +3 -0
- package/lib/pactMapFactory.js.map +1 -1
- package/package.json +15 -15
- package/src/packageVersion.ts +1 -1
- package/src/pactMapFactory.ts +3 -0
package/CHANGELOG.md
CHANGED
package/dist/packageVersion.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export declare const pkgName = "@fluid-experimental/pact-map";
|
|
8
|
-
export declare const pkgVersion = "2.
|
|
8
|
+
export declare const pkgVersion = "2.92.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/pact-map";
|
|
11
|
-
exports.pkgVersion = "2.
|
|
11
|
+
exports.pkgVersion = "2.92.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,8BAA8B,CAAC;AACzC,QAAA,UAAU,GAAG,QAAQ,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/pact-map\";\nexport const pkgVersion = \"2.
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,8BAA8B,CAAC;AACzC,QAAA,UAAU,GAAG,QAAQ,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/pact-map\";\nexport const pkgVersion = \"2.92.0\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pactMapFactory.d.ts","sourceRoot":"","sources":["../src/pactMapFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,gBAAgB,EAChB,MAAM,gDAAgD,CAAC;AAGxD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAIhD;;GAEG;AACH,qBAAa,cAAe,YAAW,eAAe,CAAC,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"pactMapFactory.d.ts","sourceRoot":"","sources":["../src/pactMapFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,gBAAgB,EAChB,MAAM,gDAAgD,CAAC;AAGxD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAIhD;;GAEG;AACH,qBAAa,cAAe,YAAW,eAAe,CAAC,QAAQ,CAAC;IAI/D,gBAAuB,IAAI,gDAAgD;IAE3E,gBAAuB,UAAU,EAAE,kBAAkB,CAInD;IAEF,IAAW,IAAI,IAAI,MAAM,CAExB;IAED,IAAW,UAAU,IAAI,kBAAkB,CAE1C;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,QAAQ,EAAE,sBAAsB,EAAE,EAAE,EAAE,MAAM,GAAG,QAAQ;CAKrE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AACH,eAAO,MAAM,OAAO,wLAAyC,CAAC"}
|
package/dist/pactMapFactory.js
CHANGED
|
@@ -33,6 +33,9 @@ class PactMapFactory {
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
exports.PactMapFactory = PactMapFactory;
|
|
36
|
+
// New type string, to be activated once the migration has been fully shipped dark and is safe to flip.
|
|
37
|
+
// See LegacyTypeAwareRegistry in packages/runtime/datastore/src/dataStoreRuntime.ts.
|
|
38
|
+
// public static readonly Type = "pact-map";
|
|
36
39
|
PactMapFactory.Type = "https://graph.microsoft.com/types/pact-map";
|
|
37
40
|
PactMapFactory.Attributes = {
|
|
38
41
|
type: PactMapFactory.Type,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pactMapFactory.js","sourceRoot":"","sources":["../src/pactMapFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAQH,0EAAqF;AAGrF,2DAAiD;AACjD,6CAA4C;AAE5C;;GAEG;AACH,MAAa,cAAc;
|
|
1
|
+
{"version":3,"file":"pactMapFactory.js","sourceRoot":"","sources":["../src/pactMapFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAQH,0EAAqF;AAGrF,2DAAiD;AACjD,6CAA4C;AAE5C;;GAEG;AACH,MAAa,cAAc;IAY1B,IAAW,IAAI;QACd,OAAO,cAAc,CAAC,IAAI,CAAC;IAC5B,CAAC;IAED,IAAW,UAAU;QACpB,OAAO,cAAc,CAAC,UAAU,CAAC;IAClC,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,IAAI,CAChB,OAA+B,EAC/B,EAAU,EACV,QAA0B,EAC1B,UAA8B;QAE9B,MAAM,OAAO,GAAG,IAAI,yBAAY,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QAC1D,MAAM,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC7B,OAAO,OAAO,CAAC;IAChB,CAAC;IAEM,MAAM,CAAC,QAAgC,EAAE,EAAU;QACzD,MAAM,OAAO,GAAG,IAAI,yBAAY,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAChE,OAAO,CAAC,eAAe,EAAE,CAAC;QAC1B,OAAO,OAAO,CAAC;IAChB,CAAC;;AAtCF,wCAuCC;AAtCA,uGAAuG;AACvG,qFAAqF;AACrF,4CAA4C;AACrB,mBAAI,GAAG,4CAA4C,CAAC;AAEpD,yBAAU,GAAuB;IACvD,IAAI,EAAE,cAAc,CAAC,IAAI;IACzB,qBAAqB,EAAE,KAAK;IAC5B,cAAc,EAAE,8BAAU;CAC1B,CAAC;AA+BH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AACU,QAAA,OAAO,GAAG,IAAA,iCAAsB,EAAC,cAAc,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tIChannelAttributes,\n\tIChannelFactory,\n\tIFluidDataStoreRuntime,\n\tIChannelServices,\n} from \"@fluidframework/datastore-definitions/internal\";\nimport { createSharedObjectKind } from \"@fluidframework/shared-object-base/internal\";\n\nimport type { IPactMap } from \"./interfaces.js\";\nimport { pkgVersion } from \"./packageVersion.js\";\nimport { PactMapClass } from \"./pactMap.js\";\n\n/**\n * The factory that produces the PactMap\n */\nexport class PactMapFactory implements IChannelFactory<IPactMap> {\n\t// New type string, to be activated once the migration has been fully shipped dark and is safe to flip.\n\t// See LegacyTypeAwareRegistry in packages/runtime/datastore/src/dataStoreRuntime.ts.\n\t// public static readonly Type = \"pact-map\";\n\tpublic static readonly Type = \"https://graph.microsoft.com/types/pact-map\";\n\n\tpublic static readonly Attributes: IChannelAttributes = {\n\t\ttype: PactMapFactory.Type,\n\t\tsnapshotFormatVersion: \"0.1\",\n\t\tpackageVersion: pkgVersion,\n\t};\n\n\tpublic get type(): string {\n\t\treturn PactMapFactory.Type;\n\t}\n\n\tpublic get attributes(): IChannelAttributes {\n\t\treturn PactMapFactory.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<IPactMap> {\n\t\tconst pactMap = new PactMapClass(id, runtime, attributes);\n\t\tawait pactMap.load(services);\n\t\treturn pactMap;\n\t}\n\n\tpublic create(document: IFluidDataStoreRuntime, id: string): IPactMap {\n\t\tconst pactMap = new PactMapClass(id, document, this.attributes);\n\t\tpactMap.initializeLocal();\n\t\treturn pactMap;\n\t}\n}\n\n/**\n * The PactMap distributed data structure provides key/value storage with a cautious conflict resolution strategy.\n * This strategy optimizes for all clients being aware of the change prior to considering the value as accepted.\n *\n * It is still experimental and under development. Please do try it out, but expect breaking changes in the future.\n *\n * @remarks\n * ### Creation\n *\n * To create a `PactMap`, call the static create method:\n *\n * ```typescript\n * const pactMap = PactMap.create(this.runtime, id);\n * ```\n *\n * ### Usage\n *\n * Setting and reading values is somewhat similar to a `SharedMap`. However, because the acceptance strategy\n * cannot be resolved until other clients have witnessed the set, the new value will only be reflected in the data\n * after the consensus is reached.\n *\n * ```typescript\n * pactMap.on(\"pending\", (key: string) => {\n * console.log(pactMap.getPending(key));\n * });\n * pactMap.on(\"accepted\", (key: string) => {\n * console.log(pactMap.get(key));\n * });\n * pactMap.set(\"myKey\", \"myValue\");\n *\n * // Reading from the pact map prior to the async operation's completion will still return the old value.\n * console.log(pactMap.get(\"myKey\"));\n * ```\n *\n * The acceptance process has two stages. When an op indicating a client's attempt to set a value is sequenced,\n * we first verify that it was set with knowledge of the most recently accepted value (consensus-like FWW). If it\n * meets this bar, then the value is \"pending\". During this time, clients may observe the pending value and act\n * upon it, but should be aware that not all other clients may have witnessed the value yet. Once all clients\n * that were connected at the time of the value being set have explicitly acknowledged the new value, the value\n * becomes \"accepted\". Once the value is accepted, it once again becomes possible to set the value, again with\n * consensus-like FWW resolution.\n *\n * Since all connected clients must explicitly accept the new value, it is important that all connected clients\n * have the PactMap loaded, including e.g. the summarizing client. Otherwise, those clients who have not loaded\n * the PactMap will not be responding to proposals and delay their acceptance (until they disconnect, which implicitly\n * removes them from consideration). The easiest way to ensure all clients load the PactMap is to instantiate it\n * as part of instantiating the IRuntime for the container (containerHasInitialized if using Aqueduct).\n *\n * ### Eventing\n *\n * `PactMap` is an `EventEmitter`, and will emit events when a new value is accepted for a key.\n *\n * ```typescript\n * pactMap.on(\"accept\", (key: string) => {\n * console.log(`New value was accepted for key: ${ key }, value: ${ pactMap.get(key) }`);\n * });\n * ```\n * @internal\n */\nexport const PactMap = createSharedObjectKind(PactMapFactory);\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/pact-map";
|
|
8
|
-
export declare const pkgVersion = "2.
|
|
8
|
+
export declare const pkgVersion = "2.92.0";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
package/lib/packageVersion.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,8BAA8B,CAAC;AACtD,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,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/pact-map\";\nexport const pkgVersion = \"2.
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,8BAA8B,CAAC;AACtD,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,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/pact-map\";\nexport const pkgVersion = \"2.92.0\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pactMapFactory.d.ts","sourceRoot":"","sources":["../src/pactMapFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,gBAAgB,EAChB,MAAM,gDAAgD,CAAC;AAGxD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAIhD;;GAEG;AACH,qBAAa,cAAe,YAAW,eAAe,CAAC,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"pactMapFactory.d.ts","sourceRoot":"","sources":["../src/pactMapFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,gBAAgB,EAChB,MAAM,gDAAgD,CAAC;AAGxD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAIhD;;GAEG;AACH,qBAAa,cAAe,YAAW,eAAe,CAAC,QAAQ,CAAC;IAI/D,gBAAuB,IAAI,gDAAgD;IAE3E,gBAAuB,UAAU,EAAE,kBAAkB,CAInD;IAEF,IAAW,IAAI,IAAI,MAAM,CAExB;IAED,IAAW,UAAU,IAAI,kBAAkB,CAE1C;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,QAAQ,EAAE,sBAAsB,EAAE,EAAE,EAAE,MAAM,GAAG,QAAQ;CAKrE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AACH,eAAO,MAAM,OAAO,wLAAyC,CAAC"}
|
package/lib/pactMapFactory.js
CHANGED
|
@@ -29,6 +29,9 @@ export class PactMapFactory {
|
|
|
29
29
|
return pactMap;
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
+
// New type string, to be activated once the migration has been fully shipped dark and is safe to flip.
|
|
33
|
+
// See LegacyTypeAwareRegistry in packages/runtime/datastore/src/dataStoreRuntime.ts.
|
|
34
|
+
// public static readonly Type = "pact-map";
|
|
32
35
|
PactMapFactory.Type = "https://graph.microsoft.com/types/pact-map";
|
|
33
36
|
PactMapFactory.Attributes = {
|
|
34
37
|
type: PactMapFactory.Type,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pactMapFactory.js","sourceRoot":"","sources":["../src/pactMapFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAGrF,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C;;GAEG;AACH,MAAM,OAAO,cAAc;
|
|
1
|
+
{"version":3,"file":"pactMapFactory.js","sourceRoot":"","sources":["../src/pactMapFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAGrF,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C;;GAEG;AACH,MAAM,OAAO,cAAc;IAY1B,IAAW,IAAI;QACd,OAAO,cAAc,CAAC,IAAI,CAAC;IAC5B,CAAC;IAED,IAAW,UAAU;QACpB,OAAO,cAAc,CAAC,UAAU,CAAC;IAClC,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,IAAI,CAChB,OAA+B,EAC/B,EAAU,EACV,QAA0B,EAC1B,UAA8B;QAE9B,MAAM,OAAO,GAAG,IAAI,YAAY,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QAC1D,MAAM,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC7B,OAAO,OAAO,CAAC;IAChB,CAAC;IAEM,MAAM,CAAC,QAAgC,EAAE,EAAU;QACzD,MAAM,OAAO,GAAG,IAAI,YAAY,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAChE,OAAO,CAAC,eAAe,EAAE,CAAC;QAC1B,OAAO,OAAO,CAAC;IAChB,CAAC;;AArCD,uGAAuG;AACvG,qFAAqF;AACrF,4CAA4C;AACrB,mBAAI,GAAG,4CAA4C,CAAC;AAEpD,yBAAU,GAAuB;IACvD,IAAI,EAAE,cAAc,CAAC,IAAI;IACzB,qBAAqB,EAAE,KAAK;IAC5B,cAAc,EAAE,UAAU;CAC1B,CAAC;AA+BH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,sBAAsB,CAAC,cAAc,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tIChannelAttributes,\n\tIChannelFactory,\n\tIFluidDataStoreRuntime,\n\tIChannelServices,\n} from \"@fluidframework/datastore-definitions/internal\";\nimport { createSharedObjectKind } from \"@fluidframework/shared-object-base/internal\";\n\nimport type { IPactMap } from \"./interfaces.js\";\nimport { pkgVersion } from \"./packageVersion.js\";\nimport { PactMapClass } from \"./pactMap.js\";\n\n/**\n * The factory that produces the PactMap\n */\nexport class PactMapFactory implements IChannelFactory<IPactMap> {\n\t// New type string, to be activated once the migration has been fully shipped dark and is safe to flip.\n\t// See LegacyTypeAwareRegistry in packages/runtime/datastore/src/dataStoreRuntime.ts.\n\t// public static readonly Type = \"pact-map\";\n\tpublic static readonly Type = \"https://graph.microsoft.com/types/pact-map\";\n\n\tpublic static readonly Attributes: IChannelAttributes = {\n\t\ttype: PactMapFactory.Type,\n\t\tsnapshotFormatVersion: \"0.1\",\n\t\tpackageVersion: pkgVersion,\n\t};\n\n\tpublic get type(): string {\n\t\treturn PactMapFactory.Type;\n\t}\n\n\tpublic get attributes(): IChannelAttributes {\n\t\treturn PactMapFactory.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<IPactMap> {\n\t\tconst pactMap = new PactMapClass(id, runtime, attributes);\n\t\tawait pactMap.load(services);\n\t\treturn pactMap;\n\t}\n\n\tpublic create(document: IFluidDataStoreRuntime, id: string): IPactMap {\n\t\tconst pactMap = new PactMapClass(id, document, this.attributes);\n\t\tpactMap.initializeLocal();\n\t\treturn pactMap;\n\t}\n}\n\n/**\n * The PactMap distributed data structure provides key/value storage with a cautious conflict resolution strategy.\n * This strategy optimizes for all clients being aware of the change prior to considering the value as accepted.\n *\n * It is still experimental and under development. Please do try it out, but expect breaking changes in the future.\n *\n * @remarks\n * ### Creation\n *\n * To create a `PactMap`, call the static create method:\n *\n * ```typescript\n * const pactMap = PactMap.create(this.runtime, id);\n * ```\n *\n * ### Usage\n *\n * Setting and reading values is somewhat similar to a `SharedMap`. However, because the acceptance strategy\n * cannot be resolved until other clients have witnessed the set, the new value will only be reflected in the data\n * after the consensus is reached.\n *\n * ```typescript\n * pactMap.on(\"pending\", (key: string) => {\n * console.log(pactMap.getPending(key));\n * });\n * pactMap.on(\"accepted\", (key: string) => {\n * console.log(pactMap.get(key));\n * });\n * pactMap.set(\"myKey\", \"myValue\");\n *\n * // Reading from the pact map prior to the async operation's completion will still return the old value.\n * console.log(pactMap.get(\"myKey\"));\n * ```\n *\n * The acceptance process has two stages. When an op indicating a client's attempt to set a value is sequenced,\n * we first verify that it was set with knowledge of the most recently accepted value (consensus-like FWW). If it\n * meets this bar, then the value is \"pending\". During this time, clients may observe the pending value and act\n * upon it, but should be aware that not all other clients may have witnessed the value yet. Once all clients\n * that were connected at the time of the value being set have explicitly acknowledged the new value, the value\n * becomes \"accepted\". Once the value is accepted, it once again becomes possible to set the value, again with\n * consensus-like FWW resolution.\n *\n * Since all connected clients must explicitly accept the new value, it is important that all connected clients\n * have the PactMap loaded, including e.g. the summarizing client. Otherwise, those clients who have not loaded\n * the PactMap will not be responding to proposals and delay their acceptance (until they disconnect, which implicitly\n * removes them from consideration). The easiest way to ensure all clients load the PactMap is to instantiate it\n * as part of instantiating the IRuntime for the container (containerHasInitialized if using Aqueduct).\n *\n * ### Eventing\n *\n * `PactMap` is an `EventEmitter`, and will emit events when a new value is accepted for a key.\n *\n * ```typescript\n * pactMap.on(\"accept\", (key: string) => {\n * console.log(`New value was accepted for key: ${ key }, value: ${ pactMap.get(key) }`);\n * });\n * ```\n * @internal\n */\nexport const PactMap = createSharedObjectKind(PactMapFactory);\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-experimental/pact-map",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.92.0",
|
|
4
4
|
"description": "Distributed data structure for key-value pairs using pact consensus",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -49,25 +49,25 @@
|
|
|
49
49
|
"temp-directory": "nyc/.nyc_output"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@fluid-internal/client-utils": "~2.
|
|
53
|
-
"@fluidframework/core-interfaces": "~2.
|
|
54
|
-
"@fluidframework/core-utils": "~2.
|
|
55
|
-
"@fluidframework/datastore-definitions": "~2.
|
|
56
|
-
"@fluidframework/driver-definitions": "~2.
|
|
57
|
-
"@fluidframework/driver-utils": "~2.
|
|
58
|
-
"@fluidframework/runtime-definitions": "~2.
|
|
59
|
-
"@fluidframework/shared-object-base": "~2.
|
|
52
|
+
"@fluid-internal/client-utils": "~2.92.0",
|
|
53
|
+
"@fluidframework/core-interfaces": "~2.92.0",
|
|
54
|
+
"@fluidframework/core-utils": "~2.92.0",
|
|
55
|
+
"@fluidframework/datastore-definitions": "~2.92.0",
|
|
56
|
+
"@fluidframework/driver-definitions": "~2.92.0",
|
|
57
|
+
"@fluidframework/driver-utils": "~2.92.0",
|
|
58
|
+
"@fluidframework/runtime-definitions": "~2.92.0",
|
|
59
|
+
"@fluidframework/shared-object-base": "~2.92.0"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@arethetypeswrong/cli": "^0.18.2",
|
|
63
63
|
"@biomejs/biome": "~2.4.5",
|
|
64
|
-
"@fluid-internal/mocha-test-setup": "~2.
|
|
65
|
-
"@fluid-private/test-dds-utils": "~2.
|
|
66
|
-
"@fluid-tools/build-cli": "^0.
|
|
64
|
+
"@fluid-internal/mocha-test-setup": "~2.92.0",
|
|
65
|
+
"@fluid-private/test-dds-utils": "~2.92.0",
|
|
66
|
+
"@fluid-tools/build-cli": "^0.64.0",
|
|
67
67
|
"@fluidframework/build-common": "^2.0.3",
|
|
68
|
-
"@fluidframework/build-tools": "^0.
|
|
69
|
-
"@fluidframework/eslint-config-fluid": "
|
|
70
|
-
"@fluidframework/test-runtime-utils": "~2.
|
|
68
|
+
"@fluidframework/build-tools": "^0.64.0",
|
|
69
|
+
"@fluidframework/eslint-config-fluid": "^9.0.0",
|
|
70
|
+
"@fluidframework/test-runtime-utils": "~2.92.0",
|
|
71
71
|
"@microsoft/api-extractor": "7.52.11",
|
|
72
72
|
"@types/mocha": "^10.0.10",
|
|
73
73
|
"@types/node": "~20.19.30",
|
package/src/packageVersion.ts
CHANGED
package/src/pactMapFactory.ts
CHANGED
|
@@ -19,6 +19,9 @@ import { PactMapClass } from "./pactMap.js";
|
|
|
19
19
|
* The factory that produces the PactMap
|
|
20
20
|
*/
|
|
21
21
|
export class PactMapFactory implements IChannelFactory<IPactMap> {
|
|
22
|
+
// New type string, to be activated once the migration has been fully shipped dark and is safe to flip.
|
|
23
|
+
// See LegacyTypeAwareRegistry in packages/runtime/datastore/src/dataStoreRuntime.ts.
|
|
24
|
+
// public static readonly Type = "pact-map";
|
|
22
25
|
public static readonly Type = "https://graph.microsoft.com/types/pact-map";
|
|
23
26
|
|
|
24
27
|
public static readonly Attributes: IChannelAttributes = {
|