@fluidframework/ordered-collection 2.102.0 → 2.110.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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # @fluidframework/ordered-collection
2
2
 
3
+ ## 2.110.0
4
+
5
+ Dependency updates only.
6
+
7
+ ## 2.103.0
8
+
9
+ Dependency updates only.
10
+
3
11
  ## 2.102.0
4
12
 
5
13
  Dependency updates only.
@@ -2,24 +2,21 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import type { IChannelAttributes, IFluidDataStoreRuntime, IChannelServices } from "@fluidframework/datastore-definitions/internal";
5
+ import type { IChannelAttributes, IChannelFactory, IChannelServices, IFluidDataStoreRuntime } from "@fluidframework/datastore-definitions/internal";
6
6
  import { ConsensusQueueClass } from "./consensusQueue.js";
7
- import type { IConsensusOrderedCollection, IConsensusOrderedCollectionFactory } from "./interfaces.js";
7
+ import type { IConsensusOrderedCollection } from "./interfaces.js";
8
8
  /**
9
9
  * The factory that defines the consensus queue
10
10
  *
11
11
  * @internal
12
12
  */
13
- export declare class ConsensusQueueFactory implements IConsensusOrderedCollectionFactory {
13
+ export declare class ConsensusQueueFactory<T> implements IChannelFactory<IConsensusOrderedCollection<T>> {
14
14
  static Type: string;
15
15
  static readonly Attributes: IChannelAttributes;
16
16
  get type(): string;
17
17
  get attributes(): IChannelAttributes;
18
- /**
19
- * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}
20
- */
21
- load(runtime: IFluidDataStoreRuntime, id: string, services: IChannelServices, attributes: IChannelAttributes): Promise<IConsensusOrderedCollection>;
22
- create(document: IFluidDataStoreRuntime, id: string): IConsensusOrderedCollection;
18
+ load(runtime: IFluidDataStoreRuntime, id: string, services: IChannelServices, attributes: IChannelAttributes): Promise<IConsensusOrderedCollection<T>>;
19
+ create(document: IFluidDataStoreRuntime, id: string): IConsensusOrderedCollection<T>;
23
20
  }
24
21
  /**
25
22
  * {@inheritDoc ConsensusQueueClass}
@@ -1 +1 @@
1
- {"version":3,"file":"consensusOrderedCollectionFactory.d.ts","sourceRoot":"","sources":["../src/consensusOrderedCollectionFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,MAAM,gDAAgD,CAAC;AAIxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EACX,2BAA2B,EAC3B,kCAAkC,EAClC,MAAM,iBAAiB,CAAC;AAGzB;;;;GAIG;AACH,qBAAa,qBAAsB,YAAW,kCAAkC;IAI/E,OAAc,IAAI,SAAuD;IAEzE,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,2BAA2B,CAAC;IAOhC,MAAM,CAAC,QAAQ,EAAE,sBAAsB,EAAE,EAAE,EAAE,MAAM,GAAG,2BAA2B;CAMxF;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,sNAAgD,CAAC;AAE5E;;;;GAIG;AAGH,MAAM,MAAM,cAAc,CAAC,CAAC,GAAG,GAAG,IAAI,mBAAmB,CAAC,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"consensusOrderedCollectionFactory.d.ts","sourceRoot":"","sources":["../src/consensusOrderedCollectionFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,sBAAsB,EACtB,MAAM,gDAAgD,CAAC;AAIxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAGnE;;;;GAIG;AACH,qBAAa,qBAAqB,CAAC,CAAC,CACnC,YAAW,eAAe,CAAC,2BAA2B,CAAC,CAAC,CAAC,CAAC;IAK1D,OAAc,IAAI,SAAuD;IAEzE,gBAAuB,UAAU,EAAE,kBAAkB,CAInD;IAEF,IAAW,IAAI,IAAI,MAAM,CAExB;IAED,IAAW,UAAU,IAAI,kBAAkB,CAE1C;IAEY,IAAI,CAChB,OAAO,EAAE,sBAAsB,EAC/B,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,gBAAgB,EAC1B,UAAU,EAAE,kBAAkB,GAC5B,OAAO,CAAC,2BAA2B,CAAC,CAAC,CAAC,CAAC;IAOnC,MAAM,CAAC,QAAQ,EAAE,sBAAsB,EAAE,EAAE,EAAE,MAAM,GAAG,2BAA2B,CAAC,CAAC,CAAC;CAM3F;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,sNACgD,CAAC;AAe5E;;;;GAIG;AAGH,MAAM,MAAM,cAAc,CAAC,CAAC,GAAG,GAAG,IAAI,mBAAmB,CAAC,CAAC,CAAC,CAAC"}
@@ -21,9 +21,6 @@ class ConsensusQueueFactory {
21
21
  get attributes() {
22
22
  return ConsensusQueueFactory.Attributes;
23
23
  }
24
- /**
25
- * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}
26
- */
27
24
  async load(runtime, id, services, attributes) {
28
25
  // eslint-disable-next-line import-x/no-deprecated -- Internal usage of deprecated class
29
26
  const collection = new consensusQueue_js_1.ConsensusQueueClass(id, runtime, attributes);
@@ -1 +1 @@
1
- {"version":3,"file":"consensusOrderedCollectionFactory.js","sourceRoot":"","sources":["../src/consensusOrderedCollectionFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAOH,0EAAqF;AAErF,mGAAmG;AACnG,2DAA0D;AAK1D,2DAAiD;AAEjD;;;;GAIG;AACH,MAAa,qBAAqB;IAYjC,IAAW,IAAI;QACd,OAAO,qBAAqB,CAAC,IAAI,CAAC;IACnC,CAAC;IAED,IAAW,UAAU;QACpB,OAAO,qBAAqB,CAAC,UAAU,CAAC;IACzC,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,IAAI,CAChB,OAA+B,EAC/B,EAAU,EACV,QAA0B,EAC1B,UAA8B;QAE9B,wFAAwF;QACxF,MAAM,UAAU,GAAG,IAAI,uCAAmB,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QACpE,MAAM,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAChC,OAAO,UAAU,CAAC;IACnB,CAAC;IAEM,MAAM,CAAC,QAAgC,EAAE,EAAU;QACzD,wFAAwF;QACxF,MAAM,UAAU,GAAG,IAAI,uCAAmB,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAC1E,UAAU,CAAC,eAAe,EAAE,CAAC;QAC7B,OAAO,UAAU,CAAC;IACnB,CAAC;;AAxCF,sDAyCC;AAxCA,uGAAuG;AACvG,qFAAqF;AACrF,0CAA0C;AAC5B,0BAAI,GAAG,mDAAmD,CAAC;AAElD,gCAAU,GAAuB;IACvD,IAAI,EAAE,qBAAqB,CAAC,IAAI;IAChC,qBAAqB,EAAE,KAAK;IAC5B,cAAc,EAAE,8BAAU;CAC1B,CAAC;AAiCH;;;GAGG;AACU,QAAA,cAAc,GAAG,IAAA,iCAAsB,EAAC,qBAAqB,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\tIFluidDataStoreRuntime,\n\tIChannelServices,\n} from \"@fluidframework/datastore-definitions/internal\";\nimport { createSharedObjectKind } from \"@fluidframework/shared-object-base/internal\";\n\n// eslint-disable-next-line import-x/no-deprecated -- Internal usage of deprecated class in factory\nimport { ConsensusQueueClass } from \"./consensusQueue.js\";\nimport type {\n\tIConsensusOrderedCollection,\n\tIConsensusOrderedCollectionFactory,\n} from \"./interfaces.js\";\nimport { pkgVersion } from \"./packageVersion.js\";\n\n/**\n * The factory that defines the consensus queue\n *\n * @internal\n */\nexport class ConsensusQueueFactory implements IConsensusOrderedCollectionFactory {\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 Type = \"consensus-queue\";\n\tpublic static Type = \"https://graph.microsoft.com/types/consensus-queue\";\n\n\tpublic static readonly Attributes: IChannelAttributes = {\n\t\ttype: ConsensusQueueFactory.Type,\n\t\tsnapshotFormatVersion: \"0.1\",\n\t\tpackageVersion: pkgVersion,\n\t};\n\n\tpublic get type(): string {\n\t\treturn ConsensusQueueFactory.Type;\n\t}\n\n\tpublic get attributes(): IChannelAttributes {\n\t\treturn ConsensusQueueFactory.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<IConsensusOrderedCollection> {\n\t\t// eslint-disable-next-line import-x/no-deprecated -- Internal usage of deprecated class\n\t\tconst collection = new ConsensusQueueClass(id, runtime, attributes);\n\t\tawait collection.load(services);\n\t\treturn collection;\n\t}\n\n\tpublic create(document: IFluidDataStoreRuntime, id: string): IConsensusOrderedCollection {\n\t\t// eslint-disable-next-line import-x/no-deprecated -- Internal usage of deprecated class\n\t\tconst collection = new ConsensusQueueClass(id, document, this.attributes);\n\t\tcollection.initializeLocal();\n\t\treturn collection;\n\t}\n}\n\n/**\n * {@inheritDoc ConsensusQueueClass}\n * @legacy @beta\n */\nexport const ConsensusQueue = createSharedObjectKind(ConsensusQueueFactory);\n\n/**\n * {@inheritDoc ConsensusQueueClass}\n * @deprecated Use {@link IConsensusOrderedCollection} for typing instead. This type alias will be removed in a future release.\n * @legacy @beta\n */\n// TODO: #22835 Use undefined instead of any (breaking change)\n// eslint-disable-next-line @typescript-eslint/no-explicit-any, import-x/no-deprecated\nexport type ConsensusQueue<T = any> = ConsensusQueueClass<T>;\n"]}
1
+ {"version":3,"file":"consensusOrderedCollectionFactory.js","sourceRoot":"","sources":["../src/consensusOrderedCollectionFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAQH,0EAAqF;AAErF,mGAAmG;AACnG,2DAA0D;AAE1D,2DAAiD;AAEjD;;;;GAIG;AACH,MAAa,qBAAqB;IAcjC,IAAW,IAAI;QACd,OAAO,qBAAqB,CAAC,IAAI,CAAC;IACnC,CAAC;IAED,IAAW,UAAU;QACpB,OAAO,qBAAqB,CAAC,UAAU,CAAC;IACzC,CAAC;IAEM,KAAK,CAAC,IAAI,CAChB,OAA+B,EAC/B,EAAU,EACV,QAA0B,EAC1B,UAA8B;QAE9B,wFAAwF;QACxF,MAAM,UAAU,GAAG,IAAI,uCAAmB,CAAI,EAAE,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QACvE,MAAM,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAChC,OAAO,UAAU,CAAC;IACnB,CAAC;IAEM,MAAM,CAAC,QAAgC,EAAE,EAAU;QACzD,wFAAwF;QACxF,MAAM,UAAU,GAAG,IAAI,uCAAmB,CAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAC7E,UAAU,CAAC,eAAe,EAAE,CAAC;QAC7B,OAAO,UAAU,CAAC;IACnB,CAAC;;AAvCF,sDAwCC;AArCA,uGAAuG;AACvG,qFAAqF;AACrF,0CAA0C;AAC5B,0BAAI,GAAG,mDAAmD,CAAC;AAElD,gCAAU,GAAuB;IACvD,IAAI,EAAE,qBAAqB,CAAC,IAAI;IAChC,qBAAqB,EAAE,KAAK;IAC5B,cAAc,EAAE,8BAAU;CAC1B,CAAC;AA8BH;;;GAGG;AACU,QAAA,cAAc,GAC1B,IAAA,iCAAsB,EAA8B,qBAAqB,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\tIChannelServices,\n\tIFluidDataStoreRuntime,\n} from \"@fluidframework/datastore-definitions/internal\";\nimport { createSharedObjectKind } from \"@fluidframework/shared-object-base/internal\";\n\n// eslint-disable-next-line import-x/no-deprecated -- Internal usage of deprecated class in factory\nimport { ConsensusQueueClass } from \"./consensusQueue.js\";\nimport type { IConsensusOrderedCollection } from \"./interfaces.js\";\nimport { pkgVersion } from \"./packageVersion.js\";\n\n/**\n * The factory that defines the consensus queue\n *\n * @internal\n */\nexport class ConsensusQueueFactory<T>\n\timplements IChannelFactory<IConsensusOrderedCollection<T>>\n{\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 Type = \"consensus-queue\";\n\tpublic static Type = \"https://graph.microsoft.com/types/consensus-queue\";\n\n\tpublic static readonly Attributes: IChannelAttributes = {\n\t\ttype: ConsensusQueueFactory.Type,\n\t\tsnapshotFormatVersion: \"0.1\",\n\t\tpackageVersion: pkgVersion,\n\t};\n\n\tpublic get type(): string {\n\t\treturn ConsensusQueueFactory.Type;\n\t}\n\n\tpublic get attributes(): IChannelAttributes {\n\t\treturn ConsensusQueueFactory.Attributes;\n\t}\n\n\tpublic async load(\n\t\truntime: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\tservices: IChannelServices,\n\t\tattributes: IChannelAttributes,\n\t): Promise<IConsensusOrderedCollection<T>> {\n\t\t// eslint-disable-next-line import-x/no-deprecated -- Internal usage of deprecated class\n\t\tconst collection = new ConsensusQueueClass<T>(id, runtime, attributes);\n\t\tawait collection.load(services);\n\t\treturn collection;\n\t}\n\n\tpublic create(document: IFluidDataStoreRuntime, id: string): IConsensusOrderedCollection<T> {\n\t\t// eslint-disable-next-line import-x/no-deprecated -- Internal usage of deprecated class\n\t\tconst collection = new ConsensusQueueClass<T>(id, document, this.attributes);\n\t\tcollection.initializeLocal();\n\t\treturn collection;\n\t}\n}\n\n/**\n * {@inheritDoc ConsensusQueueClass}\n * @legacy @beta\n */\nexport const ConsensusQueue =\n\tcreateSharedObjectKind<IConsensusOrderedCollection>(ConsensusQueueFactory);\n\n// For #22835, consider exposing a helper to produce type specific ConsensusQueue.\n// One problem, with doing so is that nothing inside ConsensusQueue validates the shape of T.\n// A DDS load might find content that is not the same, expected type.\n// But that is not any worse than the `any` that exists currently.\n// /**\n// * Factory for shared object kind for queue-shaped ordered collections of specific type.\n// * @legacy @beta\n// */\n// export function TypedConsensusQueue<T>(): ISharedObjectKind<IConsensusOrderedCollection<T>> &\n// \tSharedObjectKind<IConsensusOrderedCollection<T>> {\n// \treturn ConsensusQueue;\n// }\n\n/**\n * {@inheritDoc ConsensusQueueClass}\n * @deprecated Use {@link IConsensusOrderedCollection} for typing instead. This type alias will be removed in a future release.\n * @legacy @beta\n */\n// TODO: #22835 Use undefined instead of any (breaking change)\n// eslint-disable-next-line @typescript-eslint/no-explicit-any, import-x/no-deprecated\nexport type ConsensusQueue<T = any> = ConsensusQueueClass<T>;\n"]}
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { type ConsensusCallback, ConsensusResult, type IConsensusOrderedCollection, type IConsensusOrderedCollectionEvents, type IConsensusOrderedCollectionFactory, type IOrderedCollection, type ISnapshotable, } from "./interfaces.js";
5
+ export { type ConsensusCallback, ConsensusResult, type IConsensusOrderedCollection, type IConsensusOrderedCollectionEvents, type IOrderedCollection, type ISnapshotable, } from "./interfaces.js";
6
6
  export { ConsensusQueueFactory, ConsensusQueue } from "./consensusOrderedCollectionFactory.js";
7
7
  export { ConsensusOrderedCollection } from "./consensusOrderedCollection.js";
8
8
  export { ConsensusQueueClass } from "./consensusQueue.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,iBAAiB,EACtB,eAAe,EACf,KAAK,2BAA2B,EAChC,KAAK,iCAAiC,EACtC,KAAK,kCAAkC,EACvC,KAAK,kBAAkB,EACvB,KAAK,aAAa,GAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAC/F,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EACN,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,GACrB,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,iBAAiB,EACtB,eAAe,EACf,KAAK,2BAA2B,EAChC,KAAK,iCAAiC,EACtC,KAAK,kBAAkB,EACvB,KAAK,aAAa,GAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAC/F,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EACN,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,GACrB,MAAM,gBAAgB,CAAC"}
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,iDAQyB;AANxB,gHAAA,eAAe,OAAA;AAOhB,+FAA+F;AAAtF,6IAAA,qBAAqB,OAAA;AAAE,sIAAA,cAAc,OAAA;AAC9C,iFAA6E;AAApE,2IAAA,0BAA0B,OAAA;AACnC,yDAA0D;AAAjD,wHAAA,mBAAmB,OAAA;AAC5B,+CAKwB;AAJvB,kHAAA,kBAAkB,OAAA;AAClB,sHAAA,sBAAsB,OAAA;AACtB,iHAAA,iBAAiB,OAAA;AACjB,qHAAA,qBAAqB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype ConsensusCallback,\n\tConsensusResult,\n\ttype IConsensusOrderedCollection,\n\ttype IConsensusOrderedCollectionEvents,\n\ttype IConsensusOrderedCollectionFactory,\n\ttype IOrderedCollection,\n\ttype ISnapshotable,\n} from \"./interfaces.js\";\nexport { ConsensusQueueFactory, ConsensusQueue } from \"./consensusOrderedCollectionFactory.js\";\nexport { ConsensusOrderedCollection } from \"./consensusOrderedCollection.js\";\nexport { ConsensusQueueClass } from \"./consensusQueue.js\";\nexport {\n\tacquireAndComplete,\n\twaitAcquireAndComplete,\n\tacquireAndRelease,\n\twaitAcquireAndRelease,\n} from \"./testUtils.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,iDAOyB;AALxB,gHAAA,eAAe,OAAA;AAMhB,+FAA+F;AAAtF,6IAAA,qBAAqB,OAAA;AAAE,sIAAA,cAAc,OAAA;AAC9C,iFAA6E;AAApE,2IAAA,0BAA0B,OAAA;AACnC,yDAA0D;AAAjD,wHAAA,mBAAmB,OAAA;AAC5B,+CAKwB;AAJvB,kHAAA,kBAAkB,OAAA;AAClB,sHAAA,sBAAsB,OAAA;AACtB,iHAAA,iBAAiB,OAAA;AACjB,qHAAA,qBAAqB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype ConsensusCallback,\n\tConsensusResult,\n\ttype IConsensusOrderedCollection,\n\ttype IConsensusOrderedCollectionEvents,\n\ttype IOrderedCollection,\n\ttype ISnapshotable,\n} from \"./interfaces.js\";\nexport { ConsensusQueueFactory, ConsensusQueue } from \"./consensusOrderedCollectionFactory.js\";\nexport { ConsensusOrderedCollection } from \"./consensusOrderedCollection.js\";\nexport { ConsensusQueueClass } from \"./consensusQueue.js\";\nexport {\n\tacquireAndComplete,\n\twaitAcquireAndComplete,\n\tacquireAndRelease,\n\twaitAcquireAndRelease,\n} from \"./testUtils.js\";\n"]}
@@ -2,7 +2,6 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import type { IChannelAttributes, IChannelFactory, IFluidDataStoreRuntime, IChannelServices } from "@fluidframework/datastore-definitions/internal";
6
5
  import type { ISharedObject, ISharedObjectEvents } from "@fluidframework/shared-object-base/internal";
7
6
  /**
8
7
  * @legacy @beta
@@ -17,17 +16,6 @@ export declare enum ConsensusResult {
17
16
  * @legacy @beta
18
17
  */
19
18
  export type ConsensusCallback<T> = (value: T) => Promise<ConsensusResult>;
20
- /**
21
- * Consensus Ordered Collection channel factory interface
22
- *
23
- * Extends the base IChannelFactory to return a more definite type of IConsensusOrderedCollection
24
- * Use for the runtime to create and load distributed data structure by type name of each channel
25
- * @internal
26
- */
27
- export interface IConsensusOrderedCollectionFactory extends IChannelFactory {
28
- load(document: IFluidDataStoreRuntime, id: string, services: IChannelServices, attributes: IChannelAttributes): Promise<IConsensusOrderedCollection>;
29
- create(document: IFluidDataStoreRuntime, id: string): IConsensusOrderedCollection;
30
- }
31
19
  /**
32
20
  * Events notifying about addition, acquisition, release and completion of items
33
21
  * @legacy @beta
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":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C;IAC/B,OAAO,IAAI,CAAC,EAAE,CAAC;IAEf,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC;CAC5B;AAED;;;;;;;GAOG;AAGH,MAAM,WAAW,kBAAkB,CAAC,CAAC,GAAG,GAAG,CAAE,SAAQ,aAAa,CAAC,CAAC,CAAC;IACpE;;OAEG;IACH,GAAG,CAAC,KAAK,EAAE,CAAC,OAAE;IAEd;;OAEG;IACH,MAAM,IAAI,CAAC,CAAC;IAEZ;;OAEG;IACH,IAAI,IAAI,MAAM,CAAC;CACf"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAaH;;GAEG;AACH,IAAY,eAGX;AAHD,WAAY,eAAe;IAC1B,2DAAO,CAAA;IACP,6DAAQ,CAAA;AACT,CAAC,EAHW,eAAe,+BAAf,eAAe,QAG1B","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 type {\n\tISharedObject,\n\tISharedObjectEvents,\n} from \"@fluidframework/shared-object-base/internal\";\n\n/**\n * @legacy @beta\n */\nexport enum ConsensusResult {\n\tRelease,\n\tComplete,\n}\n\n/**\n * Callback provided to acquire() and waitAndAcquire() methods.\n * @returns ConsensusResult indicating whether item was completed, or releases back to the queue.\n * @legacy @beta\n */\nexport type ConsensusCallback<T> = (value: T) => Promise<ConsensusResult>;\n\n/**\n * Consensus Ordered Collection channel factory interface\n *\n * Extends the base IChannelFactory to return a more definite type of IConsensusOrderedCollection\n * Use for the runtime to create and load distributed data structure by type name of each channel\n * @internal\n */\nexport interface IConsensusOrderedCollectionFactory extends IChannelFactory {\n\tload(\n\t\tdocument: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\tservices: IChannelServices,\n\t\tattributes: IChannelAttributes,\n\t): Promise<IConsensusOrderedCollection>;\n\n\tcreate(document: IFluidDataStoreRuntime, id: string): IConsensusOrderedCollection;\n}\n\n/**\n * Events notifying about addition, acquisition, release and completion of items\n * @legacy @beta\n */\nexport interface IConsensusOrderedCollectionEvents<T> extends ISharedObjectEvents {\n\t/**\n\t * Event fires when new item is added to the queue or\n\t * an item previously acquired is returned back to a queue (including client loosing connection)\n\t * @param newlyAdded - indicates if it's newly added item of previously acquired item\n\t */\n\t(event: \"add\", listener: (value: T, newlyAdded: boolean) => void): this;\n\t/**\n\t * Event fires when a client acquired an item\n\t * Fires both for locally acquired items, as well as items acquired by remote clients\n\t */\n\t(event: \"acquire\", listener: (value: T, clientId?: string) => void): this;\n\n\t/**\n\t * \"Complete event fires when a client completes an item.\n\t */\n\t(event: \"complete\", listener: (value: T) => void): this;\n\n\t/**\n\t * Event fires when locally acquired item is being released back to the queue.\n\t * Please note that release process is asynchronous, so it takes a while for it to happen\n\t * (\"add\" event will be fired as result of it)\n\t * @param intentional - indicates whether release was intentional (result of returning\n\t * ConsensusResult.Release from callback) or it happened as result of lost connection.\n\t */\n\t(event: \"localRelease\", listener: (value: T, intentional: boolean) => void): this;\n}\n\n/**\n * Consensus Ordered Collection interface\n *\n * An consensus ordered collection is a distributed data structure, which\n * holds a collection of JSON-able or handles, and has a\n * deterministic add/remove order.\n *\n * @remarks\n * The order the server receive the add/remove operation determines the\n * order those operation are applied to the collection. Different clients\n * issuing `add` or `acquire` operations at the same time will be sequenced.\n * The order dictates which `add` is done first, thus determining the order\n * in which it appears in the collection. It also determines which client\n * will get the first removed item, etc. All operations are asynchronous.\n * A function `waitAndAcquire` is provided to wait for and remove an entry in the collection.\n *\n * As a client acquires an item, it processes it and then returns a value (via callback)\n * indicating whether it has completed processing the item, or whether the item should be\n * released back to the collection for another client to process.\n *\n * All objects added to the collection will be cloned (via JSON).\n * They will not be references to the original input object. Thus changed to\n * the input object will not reflect the object in the collection.\n * @legacy @beta\n */\n// TODO: #22835 Use undefined instead of any (breaking change)\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface IConsensusOrderedCollection<T = any>\n\textends ISharedObject<IConsensusOrderedCollectionEvents<T>> {\n\t/**\n\t * Adds a value to the collection\n\t */\n\tadd(value: T): Promise<void>;\n\n\t/**\n\t * Retrieves a value from the collection.\n\t * @returns Returns true (and calls callback with acquired value) if collection was not empty.\n\t * Otherwise returns false.\n\t */\n\tacquire(callback: ConsensusCallback<T>): Promise<boolean>;\n\n\t/**\n\t * Wait for a value to be available and remove it from the consensus collection\n\t * Calls callback with retrieved value.\n\t */\n\twaitAndAcquire(callback: ConsensusCallback<T>): Promise<void>;\n}\n\n/**\n * Interface for object that can be snapshoted\n *\n * TODO: move this to be use in other place\n * TODO: currently input and output is not symmetrical, can they become symmetrical?\n * @legacy @beta\n */\nexport interface ISnapshotable<T> {\n\tasArray(): T[];\n\n\tloadFrom(values: T[]): void;\n}\n\n/**\n * Ordered Collection interface\n *\n * Collection of objects that has deterministic add and remove ordering.\n * Object implementing this interface can be used as the data backing\n * for the ConsensusOrderedCollection\n * @legacy @beta\n */\n// TODO: #22835 Use undefined instead of any (breaking change)\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface IOrderedCollection<T = any> extends ISnapshotable<T> {\n\t/**\n\t * Adds a value to the collection\n\t */\n\tadd(value: T);\n\n\t/**\n\t * Retrieves a value from the collection.\n\t */\n\tremove(): T;\n\n\t/**\n\t * Return the size of the collection\n\t */\n\tsize(): number;\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAOH;;GAEG;AACH,IAAY,eAGX;AAHD,WAAY,eAAe;IAC1B,2DAAO,CAAA;IACP,6DAAQ,CAAA;AACT,CAAC,EAHW,eAAe,+BAAf,eAAe,QAG1B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tISharedObject,\n\tISharedObjectEvents,\n} from \"@fluidframework/shared-object-base/internal\";\n\n/**\n * @legacy @beta\n */\nexport enum ConsensusResult {\n\tRelease,\n\tComplete,\n}\n\n/**\n * Callback provided to acquire() and waitAndAcquire() methods.\n * @returns ConsensusResult indicating whether item was completed, or releases back to the queue.\n * @legacy @beta\n */\nexport type ConsensusCallback<T> = (value: T) => Promise<ConsensusResult>;\n\n/**\n * Events notifying about addition, acquisition, release and completion of items\n * @legacy @beta\n */\nexport interface IConsensusOrderedCollectionEvents<T> extends ISharedObjectEvents {\n\t/**\n\t * Event fires when new item is added to the queue or\n\t * an item previously acquired is returned back to a queue (including client loosing connection)\n\t * @param newlyAdded - indicates if it's newly added item of previously acquired item\n\t */\n\t(event: \"add\", listener: (value: T, newlyAdded: boolean) => void): this;\n\t/**\n\t * Event fires when a client acquired an item\n\t * Fires both for locally acquired items, as well as items acquired by remote clients\n\t */\n\t(event: \"acquire\", listener: (value: T, clientId?: string) => void): this;\n\n\t/**\n\t * \"Complete event fires when a client completes an item.\n\t */\n\t(event: \"complete\", listener: (value: T) => void): this;\n\n\t/**\n\t * Event fires when locally acquired item is being released back to the queue.\n\t * Please note that release process is asynchronous, so it takes a while for it to happen\n\t * (\"add\" event will be fired as result of it)\n\t * @param intentional - indicates whether release was intentional (result of returning\n\t * ConsensusResult.Release from callback) or it happened as result of lost connection.\n\t */\n\t(event: \"localRelease\", listener: (value: T, intentional: boolean) => void): this;\n}\n\n/**\n * Consensus Ordered Collection interface\n *\n * An consensus ordered collection is a distributed data structure, which\n * holds a collection of JSON-able or handles, and has a\n * deterministic add/remove order.\n *\n * @remarks\n * The order the server receive the add/remove operation determines the\n * order those operation are applied to the collection. Different clients\n * issuing `add` or `acquire` operations at the same time will be sequenced.\n * The order dictates which `add` is done first, thus determining the order\n * in which it appears in the collection. It also determines which client\n * will get the first removed item, etc. All operations are asynchronous.\n * A function `waitAndAcquire` is provided to wait for and remove an entry in the collection.\n *\n * As a client acquires an item, it processes it and then returns a value (via callback)\n * indicating whether it has completed processing the item, or whether the item should be\n * released back to the collection for another client to process.\n *\n * All objects added to the collection will be cloned (via JSON).\n * They will not be references to the original input object. Thus changed to\n * the input object will not reflect the object in the collection.\n * @legacy @beta\n */\n// TODO: #22835 Use undefined instead of any (breaking change)\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface IConsensusOrderedCollection<T = any>\n\textends ISharedObject<IConsensusOrderedCollectionEvents<T>> {\n\t/**\n\t * Adds a value to the collection\n\t */\n\tadd(value: T): Promise<void>;\n\n\t/**\n\t * Retrieves a value from the collection.\n\t * @returns Returns true (and calls callback with acquired value) if collection was not empty.\n\t * Otherwise returns false.\n\t */\n\tacquire(callback: ConsensusCallback<T>): Promise<boolean>;\n\n\t/**\n\t * Wait for a value to be available and remove it from the consensus collection\n\t * Calls callback with retrieved value.\n\t */\n\twaitAndAcquire(callback: ConsensusCallback<T>): Promise<void>;\n}\n\n/**\n * Interface for object that can be snapshoted\n *\n * TODO: move this to be use in other place\n * TODO: currently input and output is not symmetrical, can they become symmetrical?\n * @legacy @beta\n */\nexport interface ISnapshotable<T> {\n\tasArray(): T[];\n\n\tloadFrom(values: T[]): void;\n}\n\n/**\n * Ordered Collection interface\n *\n * Collection of objects that has deterministic add and remove ordering.\n * Object implementing this interface can be used as the data backing\n * for the ConsensusOrderedCollection\n * @legacy @beta\n */\n// TODO: #22835 Use undefined instead of any (breaking change)\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface IOrderedCollection<T = any> extends ISnapshotable<T> {\n\t/**\n\t * Adds a value to the collection\n\t */\n\tadd(value: T);\n\n\t/**\n\t * Retrieves a value from the collection.\n\t */\n\tremove(): T;\n\n\t/**\n\t * Return the size of the collection\n\t */\n\tsize(): number;\n}\n"]}
@@ -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 = "@fluidframework/ordered-collection";
8
- export declare const pkgVersion = "2.102.0";
8
+ export declare const pkgVersion = "2.110.0";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -8,5 +8,5 @@
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.pkgVersion = exports.pkgName = void 0;
10
10
  exports.pkgName = "@fluidframework/ordered-collection";
11
- exports.pkgVersion = "2.102.0";
11
+ exports.pkgVersion = "2.110.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,oCAAoC,CAAC;AAC/C,QAAA,UAAU,GAAG,SAAS,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 = \"@fluidframework/ordered-collection\";\nexport const pkgVersion = \"2.102.0\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,oCAAoC,CAAC;AAC/C,QAAA,UAAU,GAAG,SAAS,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 = \"@fluidframework/ordered-collection\";\nexport const pkgVersion = \"2.110.0\";\n"]}
@@ -2,24 +2,21 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import type { IChannelAttributes, IFluidDataStoreRuntime, IChannelServices } from "@fluidframework/datastore-definitions/internal";
5
+ import type { IChannelAttributes, IChannelFactory, IChannelServices, IFluidDataStoreRuntime } from "@fluidframework/datastore-definitions/internal";
6
6
  import { ConsensusQueueClass } from "./consensusQueue.js";
7
- import type { IConsensusOrderedCollection, IConsensusOrderedCollectionFactory } from "./interfaces.js";
7
+ import type { IConsensusOrderedCollection } from "./interfaces.js";
8
8
  /**
9
9
  * The factory that defines the consensus queue
10
10
  *
11
11
  * @internal
12
12
  */
13
- export declare class ConsensusQueueFactory implements IConsensusOrderedCollectionFactory {
13
+ export declare class ConsensusQueueFactory<T> implements IChannelFactory<IConsensusOrderedCollection<T>> {
14
14
  static Type: string;
15
15
  static readonly Attributes: IChannelAttributes;
16
16
  get type(): string;
17
17
  get attributes(): IChannelAttributes;
18
- /**
19
- * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}
20
- */
21
- load(runtime: IFluidDataStoreRuntime, id: string, services: IChannelServices, attributes: IChannelAttributes): Promise<IConsensusOrderedCollection>;
22
- create(document: IFluidDataStoreRuntime, id: string): IConsensusOrderedCollection;
18
+ load(runtime: IFluidDataStoreRuntime, id: string, services: IChannelServices, attributes: IChannelAttributes): Promise<IConsensusOrderedCollection<T>>;
19
+ create(document: IFluidDataStoreRuntime, id: string): IConsensusOrderedCollection<T>;
23
20
  }
24
21
  /**
25
22
  * {@inheritDoc ConsensusQueueClass}
@@ -1 +1 @@
1
- {"version":3,"file":"consensusOrderedCollectionFactory.d.ts","sourceRoot":"","sources":["../src/consensusOrderedCollectionFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,MAAM,gDAAgD,CAAC;AAIxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EACX,2BAA2B,EAC3B,kCAAkC,EAClC,MAAM,iBAAiB,CAAC;AAGzB;;;;GAIG;AACH,qBAAa,qBAAsB,YAAW,kCAAkC;I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AkB,GAC5B,OAAO,CAAC,2BAA2B,CAAC,CAAC,CAAC,CAAC;IAOnC,MAAM,CAAC,QAAQ,EAAE,sBAAsB,EAAE,EAAE,EAAE,MAAM,GAAG,2BAA2B,CAAC,CAAC,CAAC;CAM3F;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,sNACgD,CAAC;AAe5E;;;;GAIG;AAGH,MAAM,MAAM,cAAc,CAAC,CAAC,GAAG,GAAG,IAAI,mBAAmB,CAAC,CAAC,CAAC,CAAC"}
@@ -18,9 +18,6 @@ export class ConsensusQueueFactory {
18
18
  get attributes() {
19
19
  return ConsensusQueueFactory.Attributes;
20
20
  }
21
- /**
22
- * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}
23
- */
24
21
  async load(runtime, id, services, attributes) {
25
22
  // eslint-disable-next-line import-x/no-deprecated -- Internal usage of deprecated class
26
23
  const collection = new ConsensusQueueClass(id, runtime, attributes);
@@ -1 +1 @@
1
- {"version":3,"file":"consensusOrderedCollectionFactory.js","sourceRoot":"","sources":["../src/consensusOrderedCollectionFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAErF,mGAAmG;AACnG,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAK1D,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD;;;;GAIG;AACH,MAAM,OAAO,qBAAqB;IAYjC,IAAW,IAAI;QACd,OAAO,qBAAqB,CAAC,IAAI,CAAC;IACnC,CAAC;IAED,IAAW,UAAU;QACpB,OAAO,qBAAqB,CAAC,UAAU,CAAC;IACzC,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,IAAI,CAChB,OAA+B,EAC/B,EAAU,EACV,QAA0B,EAC1B,UAA8B;QAE9B,wFAAwF;QACxF,MAAM,UAAU,GAAG,IAAI,mBAAmB,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QACpE,MAAM,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAChC,OAAO,UAAU,CAAC;IACnB,CAAC;IAEM,MAAM,CAAC,QAAgC,EAAE,EAAU;QACzD,wFAAwF;QACxF,MAAM,UAAU,GAAG,IAAI,mBAAmB,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAC1E,UAAU,CAAC,eAAe,EAAE,CAAC;QAC7B,OAAO,UAAU,CAAC;IACnB,CAAC;;AAvCD,uGAAuG;AACvG,qFAAqF;AACrF,0CAA0C;AAC5B,0BAAI,GAAG,mDAAmD,CAAC;AAElD,gCAAU,GAAuB;IACvD,IAAI,EAAE,qBAAqB,CAAC,IAAI;IAChC,qBAAqB,EAAE,KAAK;IAC5B,cAAc,EAAE,UAAU;CAC1B,CAAC;AAiCH;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,sBAAsB,CAAC,qBAAqB,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\tIFluidDataStoreRuntime,\n\tIChannelServices,\n} from \"@fluidframework/datastore-definitions/internal\";\nimport { createSharedObjectKind } from \"@fluidframework/shared-object-base/internal\";\n\n// eslint-disable-next-line import-x/no-deprecated -- Internal usage of deprecated class in factory\nimport { ConsensusQueueClass } from \"./consensusQueue.js\";\nimport type {\n\tIConsensusOrderedCollection,\n\tIConsensusOrderedCollectionFactory,\n} from \"./interfaces.js\";\nimport { pkgVersion } from \"./packageVersion.js\";\n\n/**\n * The factory that defines the consensus queue\n *\n * @internal\n */\nexport class ConsensusQueueFactory implements IConsensusOrderedCollectionFactory {\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 Type = \"consensus-queue\";\n\tpublic static Type = \"https://graph.microsoft.com/types/consensus-queue\";\n\n\tpublic static readonly Attributes: IChannelAttributes = {\n\t\ttype: ConsensusQueueFactory.Type,\n\t\tsnapshotFormatVersion: \"0.1\",\n\t\tpackageVersion: pkgVersion,\n\t};\n\n\tpublic get type(): string {\n\t\treturn ConsensusQueueFactory.Type;\n\t}\n\n\tpublic get attributes(): IChannelAttributes {\n\t\treturn ConsensusQueueFactory.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<IConsensusOrderedCollection> {\n\t\t// eslint-disable-next-line import-x/no-deprecated -- Internal usage of deprecated class\n\t\tconst collection = new ConsensusQueueClass(id, runtime, attributes);\n\t\tawait collection.load(services);\n\t\treturn collection;\n\t}\n\n\tpublic create(document: IFluidDataStoreRuntime, id: string): IConsensusOrderedCollection {\n\t\t// eslint-disable-next-line import-x/no-deprecated -- Internal usage of deprecated class\n\t\tconst collection = new ConsensusQueueClass(id, document, this.attributes);\n\t\tcollection.initializeLocal();\n\t\treturn collection;\n\t}\n}\n\n/**\n * {@inheritDoc ConsensusQueueClass}\n * @legacy @beta\n */\nexport const ConsensusQueue = createSharedObjectKind(ConsensusQueueFactory);\n\n/**\n * {@inheritDoc ConsensusQueueClass}\n * @deprecated Use {@link IConsensusOrderedCollection} for typing instead. This type alias will be removed in a future release.\n * @legacy @beta\n */\n// TODO: #22835 Use undefined instead of any (breaking change)\n// eslint-disable-next-line @typescript-eslint/no-explicit-any, import-x/no-deprecated\nexport type ConsensusQueue<T = any> = ConsensusQueueClass<T>;\n"]}
1
+ {"version":3,"file":"consensusOrderedCollectionFactory.js","sourceRoot":"","sources":["../src/consensusOrderedCollectionFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAErF,mGAAmG;AACnG,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD;;;;GAIG;AACH,MAAM,OAAO,qBAAqB;IAcjC,IAAW,IAAI;QACd,OAAO,qBAAqB,CAAC,IAAI,CAAC;IACnC,CAAC;IAED,IAAW,UAAU;QACpB,OAAO,qBAAqB,CAAC,UAAU,CAAC;IACzC,CAAC;IAEM,KAAK,CAAC,IAAI,CAChB,OAA+B,EAC/B,EAAU,EACV,QAA0B,EAC1B,UAA8B;QAE9B,wFAAwF;QACxF,MAAM,UAAU,GAAG,IAAI,mBAAmB,CAAI,EAAE,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QACvE,MAAM,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAChC,OAAO,UAAU,CAAC;IACnB,CAAC;IAEM,MAAM,CAAC,QAAgC,EAAE,EAAU;QACzD,wFAAwF;QACxF,MAAM,UAAU,GAAG,IAAI,mBAAmB,CAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAC7E,UAAU,CAAC,eAAe,EAAE,CAAC;QAC7B,OAAO,UAAU,CAAC;IACnB,CAAC;;AApCD,uGAAuG;AACvG,qFAAqF;AACrF,0CAA0C;AAC5B,0BAAI,GAAG,mDAAmD,CAAC;AAElD,gCAAU,GAAuB;IACvD,IAAI,EAAE,qBAAqB,CAAC,IAAI;IAChC,qBAAqB,EAAE,KAAK;IAC5B,cAAc,EAAE,UAAU;CAC1B,CAAC;AA8BH;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAC1B,sBAAsB,CAA8B,qBAAqB,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\tIChannelServices,\n\tIFluidDataStoreRuntime,\n} from \"@fluidframework/datastore-definitions/internal\";\nimport { createSharedObjectKind } from \"@fluidframework/shared-object-base/internal\";\n\n// eslint-disable-next-line import-x/no-deprecated -- Internal usage of deprecated class in factory\nimport { ConsensusQueueClass } from \"./consensusQueue.js\";\nimport type { IConsensusOrderedCollection } from \"./interfaces.js\";\nimport { pkgVersion } from \"./packageVersion.js\";\n\n/**\n * The factory that defines the consensus queue\n *\n * @internal\n */\nexport class ConsensusQueueFactory<T>\n\timplements IChannelFactory<IConsensusOrderedCollection<T>>\n{\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 Type = \"consensus-queue\";\n\tpublic static Type = \"https://graph.microsoft.com/types/consensus-queue\";\n\n\tpublic static readonly Attributes: IChannelAttributes = {\n\t\ttype: ConsensusQueueFactory.Type,\n\t\tsnapshotFormatVersion: \"0.1\",\n\t\tpackageVersion: pkgVersion,\n\t};\n\n\tpublic get type(): string {\n\t\treturn ConsensusQueueFactory.Type;\n\t}\n\n\tpublic get attributes(): IChannelAttributes {\n\t\treturn ConsensusQueueFactory.Attributes;\n\t}\n\n\tpublic async load(\n\t\truntime: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\tservices: IChannelServices,\n\t\tattributes: IChannelAttributes,\n\t): Promise<IConsensusOrderedCollection<T>> {\n\t\t// eslint-disable-next-line import-x/no-deprecated -- Internal usage of deprecated class\n\t\tconst collection = new ConsensusQueueClass<T>(id, runtime, attributes);\n\t\tawait collection.load(services);\n\t\treturn collection;\n\t}\n\n\tpublic create(document: IFluidDataStoreRuntime, id: string): IConsensusOrderedCollection<T> {\n\t\t// eslint-disable-next-line import-x/no-deprecated -- Internal usage of deprecated class\n\t\tconst collection = new ConsensusQueueClass<T>(id, document, this.attributes);\n\t\tcollection.initializeLocal();\n\t\treturn collection;\n\t}\n}\n\n/**\n * {@inheritDoc ConsensusQueueClass}\n * @legacy @beta\n */\nexport const ConsensusQueue =\n\tcreateSharedObjectKind<IConsensusOrderedCollection>(ConsensusQueueFactory);\n\n// For #22835, consider exposing a helper to produce type specific ConsensusQueue.\n// One problem, with doing so is that nothing inside ConsensusQueue validates the shape of T.\n// A DDS load might find content that is not the same, expected type.\n// But that is not any worse than the `any` that exists currently.\n// /**\n// * Factory for shared object kind for queue-shaped ordered collections of specific type.\n// * @legacy @beta\n// */\n// export function TypedConsensusQueue<T>(): ISharedObjectKind<IConsensusOrderedCollection<T>> &\n// \tSharedObjectKind<IConsensusOrderedCollection<T>> {\n// \treturn ConsensusQueue;\n// }\n\n/**\n * {@inheritDoc ConsensusQueueClass}\n * @deprecated Use {@link IConsensusOrderedCollection} for typing instead. This type alias will be removed in a future release.\n * @legacy @beta\n */\n// TODO: #22835 Use undefined instead of any (breaking change)\n// eslint-disable-next-line @typescript-eslint/no-explicit-any, import-x/no-deprecated\nexport type ConsensusQueue<T = any> = ConsensusQueueClass<T>;\n"]}
package/lib/index.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { type ConsensusCallback, ConsensusResult, type IConsensusOrderedCollection, type IConsensusOrderedCollectionEvents, type IConsensusOrderedCollectionFactory, type IOrderedCollection, type ISnapshotable, } from "./interfaces.js";
5
+ export { type ConsensusCallback, ConsensusResult, type IConsensusOrderedCollection, type IConsensusOrderedCollectionEvents, type IOrderedCollection, type ISnapshotable, } from "./interfaces.js";
6
6
  export { ConsensusQueueFactory, ConsensusQueue } from "./consensusOrderedCollectionFactory.js";
7
7
  export { ConsensusOrderedCollection } from "./consensusOrderedCollection.js";
8
8
  export { ConsensusQueueClass } from "./consensusQueue.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,iBAAiB,EACtB,eAAe,EACf,KAAK,2BAA2B,EAChC,KAAK,iCAAiC,EACtC,KAAK,kCAAkC,EACvC,KAAK,kBAAkB,EACvB,KAAK,aAAa,GAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAC/F,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EACN,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,GACrB,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,iBAAiB,EACtB,eAAe,EACf,KAAK,2BAA2B,EAChC,KAAK,iCAAiC,EACtC,KAAK,kBAAkB,EACvB,KAAK,aAAa,GAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAC/F,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EACN,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,GACrB,MAAM,gBAAgB,CAAC"}
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEN,eAAe,GAMf,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAC/F,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EACN,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,GACrB,MAAM,gBAAgB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype ConsensusCallback,\n\tConsensusResult,\n\ttype IConsensusOrderedCollection,\n\ttype IConsensusOrderedCollectionEvents,\n\ttype IConsensusOrderedCollectionFactory,\n\ttype IOrderedCollection,\n\ttype ISnapshotable,\n} from \"./interfaces.js\";\nexport { ConsensusQueueFactory, ConsensusQueue } from \"./consensusOrderedCollectionFactory.js\";\nexport { ConsensusOrderedCollection } from \"./consensusOrderedCollection.js\";\nexport { ConsensusQueueClass } from \"./consensusQueue.js\";\nexport {\n\tacquireAndComplete,\n\twaitAcquireAndComplete,\n\tacquireAndRelease,\n\twaitAcquireAndRelease,\n} from \"./testUtils.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEN,eAAe,GAKf,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAC/F,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EACN,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,GACrB,MAAM,gBAAgB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype ConsensusCallback,\n\tConsensusResult,\n\ttype IConsensusOrderedCollection,\n\ttype IConsensusOrderedCollectionEvents,\n\ttype IOrderedCollection,\n\ttype ISnapshotable,\n} from \"./interfaces.js\";\nexport { ConsensusQueueFactory, ConsensusQueue } from \"./consensusOrderedCollectionFactory.js\";\nexport { ConsensusOrderedCollection } from \"./consensusOrderedCollection.js\";\nexport { ConsensusQueueClass } from \"./consensusQueue.js\";\nexport {\n\tacquireAndComplete,\n\twaitAcquireAndComplete,\n\tacquireAndRelease,\n\twaitAcquireAndRelease,\n} from \"./testUtils.js\";\n"]}
@@ -2,7 +2,6 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import type { IChannelAttributes, IChannelFactory, IFluidDataStoreRuntime, IChannelServices } from "@fluidframework/datastore-definitions/internal";
6
5
  import type { ISharedObject, ISharedObjectEvents } from "@fluidframework/shared-object-base/internal";
7
6
  /**
8
7
  * @legacy @beta
@@ -17,17 +16,6 @@ export declare enum ConsensusResult {
17
16
  * @legacy @beta
18
17
  */
19
18
  export type ConsensusCallback<T> = (value: T) => Promise<ConsensusResult>;
20
- /**
21
- * Consensus Ordered Collection channel factory interface
22
- *
23
- * Extends the base IChannelFactory to return a more definite type of IConsensusOrderedCollection
24
- * Use for the runtime to create and load distributed data structure by type name of each channel
25
- * @internal
26
- */
27
- export interface IConsensusOrderedCollectionFactory extends IChannelFactory {
28
- load(document: IFluidDataStoreRuntime, id: string, services: IChannelServices, attributes: IChannelAttributes): Promise<IConsensusOrderedCollection>;
29
- create(document: IFluidDataStoreRuntime, id: string): IConsensusOrderedCollection;
30
- }
31
19
  /**
32
20
  * Events notifying about addition, acquisition, release and completion of items
33
21
  * @legacy @beta
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,gBAAgB,EAChB,MAAM,gDAAgD,CAAC;AACxD,OAAO,KAAK,EACX,aAAa,EACb,mBAAmB,EACnB,MAAM,6CAA6C,CAAC;AAErD;;GAEG;AACH,oBAAY,eAAe;IAC1B,OAAO,IAAA;IACP,QAAQ,I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G;IACH,MAAM,IAAI,CAAC,CAAC;IAEZ;;OAEG;IACH,IAAI,IAAI,MAAM,CAAC;CACf"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH;;GAEG;AACH,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;IAC1B,2DAAO,CAAA;IACP,6DAAQ,CAAA;AACT,CAAC,EAHW,eAAe,KAAf,eAAe,QAG1B","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 type {\n\tISharedObject,\n\tISharedObjectEvents,\n} from \"@fluidframework/shared-object-base/internal\";\n\n/**\n * @legacy @beta\n */\nexport enum ConsensusResult {\n\tRelease,\n\tComplete,\n}\n\n/**\n * Callback provided to acquire() and waitAndAcquire() methods.\n * @returns ConsensusResult indicating whether item was completed, or releases back to the queue.\n * @legacy @beta\n */\nexport type ConsensusCallback<T> = (value: T) => Promise<ConsensusResult>;\n\n/**\n * Consensus Ordered Collection channel factory interface\n *\n * Extends the base IChannelFactory to return a more definite type of IConsensusOrderedCollection\n * Use for the runtime to create and load distributed data structure by type name of each channel\n * @internal\n */\nexport interface IConsensusOrderedCollectionFactory extends IChannelFactory {\n\tload(\n\t\tdocument: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\tservices: IChannelServices,\n\t\tattributes: IChannelAttributes,\n\t): Promise<IConsensusOrderedCollection>;\n\n\tcreate(document: IFluidDataStoreRuntime, id: string): IConsensusOrderedCollection;\n}\n\n/**\n * Events notifying about addition, acquisition, release and completion of items\n * @legacy @beta\n */\nexport interface IConsensusOrderedCollectionEvents<T> extends ISharedObjectEvents {\n\t/**\n\t * Event fires when new item is added to the queue or\n\t * an item previously acquired is returned back to a queue (including client loosing connection)\n\t * @param newlyAdded - indicates if it's newly added item of previously acquired item\n\t */\n\t(event: \"add\", listener: (value: T, newlyAdded: boolean) => void): this;\n\t/**\n\t * Event fires when a client acquired an item\n\t * Fires both for locally acquired items, as well as items acquired by remote clients\n\t */\n\t(event: \"acquire\", listener: (value: T, clientId?: string) => void): this;\n\n\t/**\n\t * \"Complete event fires when a client completes an item.\n\t */\n\t(event: \"complete\", listener: (value: T) => void): this;\n\n\t/**\n\t * Event fires when locally acquired item is being released back to the queue.\n\t * Please note that release process is asynchronous, so it takes a while for it to happen\n\t * (\"add\" event will be fired as result of it)\n\t * @param intentional - indicates whether release was intentional (result of returning\n\t * ConsensusResult.Release from callback) or it happened as result of lost connection.\n\t */\n\t(event: \"localRelease\", listener: (value: T, intentional: boolean) => void): this;\n}\n\n/**\n * Consensus Ordered Collection interface\n *\n * An consensus ordered collection is a distributed data structure, which\n * holds a collection of JSON-able or handles, and has a\n * deterministic add/remove order.\n *\n * @remarks\n * The order the server receive the add/remove operation determines the\n * order those operation are applied to the collection. Different clients\n * issuing `add` or `acquire` operations at the same time will be sequenced.\n * The order dictates which `add` is done first, thus determining the order\n * in which it appears in the collection. It also determines which client\n * will get the first removed item, etc. All operations are asynchronous.\n * A function `waitAndAcquire` is provided to wait for and remove an entry in the collection.\n *\n * As a client acquires an item, it processes it and then returns a value (via callback)\n * indicating whether it has completed processing the item, or whether the item should be\n * released back to the collection for another client to process.\n *\n * All objects added to the collection will be cloned (via JSON).\n * They will not be references to the original input object. Thus changed to\n * the input object will not reflect the object in the collection.\n * @legacy @beta\n */\n// TODO: #22835 Use undefined instead of any (breaking change)\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface IConsensusOrderedCollection<T = any>\n\textends ISharedObject<IConsensusOrderedCollectionEvents<T>> {\n\t/**\n\t * Adds a value to the collection\n\t */\n\tadd(value: T): Promise<void>;\n\n\t/**\n\t * Retrieves a value from the collection.\n\t * @returns Returns true (and calls callback with acquired value) if collection was not empty.\n\t * Otherwise returns false.\n\t */\n\tacquire(callback: ConsensusCallback<T>): Promise<boolean>;\n\n\t/**\n\t * Wait for a value to be available and remove it from the consensus collection\n\t * Calls callback with retrieved value.\n\t */\n\twaitAndAcquire(callback: ConsensusCallback<T>): Promise<void>;\n}\n\n/**\n * Interface for object that can be snapshoted\n *\n * TODO: move this to be use in other place\n * TODO: currently input and output is not symmetrical, can they become symmetrical?\n * @legacy @beta\n */\nexport interface ISnapshotable<T> {\n\tasArray(): T[];\n\n\tloadFrom(values: T[]): void;\n}\n\n/**\n * Ordered Collection interface\n *\n * Collection of objects that has deterministic add and remove ordering.\n * Object implementing this interface can be used as the data backing\n * for the ConsensusOrderedCollection\n * @legacy @beta\n */\n// TODO: #22835 Use undefined instead of any (breaking change)\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface IOrderedCollection<T = any> extends ISnapshotable<T> {\n\t/**\n\t * Adds a value to the collection\n\t */\n\tadd(value: T);\n\n\t/**\n\t * Retrieves a value from the collection.\n\t */\n\tremove(): T;\n\n\t/**\n\t * Return the size of the collection\n\t */\n\tsize(): number;\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH;;GAEG;AACH,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;IAC1B,2DAAO,CAAA;IACP,6DAAQ,CAAA;AACT,CAAC,EAHW,eAAe,KAAf,eAAe,QAG1B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tISharedObject,\n\tISharedObjectEvents,\n} from \"@fluidframework/shared-object-base/internal\";\n\n/**\n * @legacy @beta\n */\nexport enum ConsensusResult {\n\tRelease,\n\tComplete,\n}\n\n/**\n * Callback provided to acquire() and waitAndAcquire() methods.\n * @returns ConsensusResult indicating whether item was completed, or releases back to the queue.\n * @legacy @beta\n */\nexport type ConsensusCallback<T> = (value: T) => Promise<ConsensusResult>;\n\n/**\n * Events notifying about addition, acquisition, release and completion of items\n * @legacy @beta\n */\nexport interface IConsensusOrderedCollectionEvents<T> extends ISharedObjectEvents {\n\t/**\n\t * Event fires when new item is added to the queue or\n\t * an item previously acquired is returned back to a queue (including client loosing connection)\n\t * @param newlyAdded - indicates if it's newly added item of previously acquired item\n\t */\n\t(event: \"add\", listener: (value: T, newlyAdded: boolean) => void): this;\n\t/**\n\t * Event fires when a client acquired an item\n\t * Fires both for locally acquired items, as well as items acquired by remote clients\n\t */\n\t(event: \"acquire\", listener: (value: T, clientId?: string) => void): this;\n\n\t/**\n\t * \"Complete event fires when a client completes an item.\n\t */\n\t(event: \"complete\", listener: (value: T) => void): this;\n\n\t/**\n\t * Event fires when locally acquired item is being released back to the queue.\n\t * Please note that release process is asynchronous, so it takes a while for it to happen\n\t * (\"add\" event will be fired as result of it)\n\t * @param intentional - indicates whether release was intentional (result of returning\n\t * ConsensusResult.Release from callback) or it happened as result of lost connection.\n\t */\n\t(event: \"localRelease\", listener: (value: T, intentional: boolean) => void): this;\n}\n\n/**\n * Consensus Ordered Collection interface\n *\n * An consensus ordered collection is a distributed data structure, which\n * holds a collection of JSON-able or handles, and has a\n * deterministic add/remove order.\n *\n * @remarks\n * The order the server receive the add/remove operation determines the\n * order those operation are applied to the collection. Different clients\n * issuing `add` or `acquire` operations at the same time will be sequenced.\n * The order dictates which `add` is done first, thus determining the order\n * in which it appears in the collection. It also determines which client\n * will get the first removed item, etc. All operations are asynchronous.\n * A function `waitAndAcquire` is provided to wait for and remove an entry in the collection.\n *\n * As a client acquires an item, it processes it and then returns a value (via callback)\n * indicating whether it has completed processing the item, or whether the item should be\n * released back to the collection for another client to process.\n *\n * All objects added to the collection will be cloned (via JSON).\n * They will not be references to the original input object. Thus changed to\n * the input object will not reflect the object in the collection.\n * @legacy @beta\n */\n// TODO: #22835 Use undefined instead of any (breaking change)\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface IConsensusOrderedCollection<T = any>\n\textends ISharedObject<IConsensusOrderedCollectionEvents<T>> {\n\t/**\n\t * Adds a value to the collection\n\t */\n\tadd(value: T): Promise<void>;\n\n\t/**\n\t * Retrieves a value from the collection.\n\t * @returns Returns true (and calls callback with acquired value) if collection was not empty.\n\t * Otherwise returns false.\n\t */\n\tacquire(callback: ConsensusCallback<T>): Promise<boolean>;\n\n\t/**\n\t * Wait for a value to be available and remove it from the consensus collection\n\t * Calls callback with retrieved value.\n\t */\n\twaitAndAcquire(callback: ConsensusCallback<T>): Promise<void>;\n}\n\n/**\n * Interface for object that can be snapshoted\n *\n * TODO: move this to be use in other place\n * TODO: currently input and output is not symmetrical, can they become symmetrical?\n * @legacy @beta\n */\nexport interface ISnapshotable<T> {\n\tasArray(): T[];\n\n\tloadFrom(values: T[]): void;\n}\n\n/**\n * Ordered Collection interface\n *\n * Collection of objects that has deterministic add and remove ordering.\n * Object implementing this interface can be used as the data backing\n * for the ConsensusOrderedCollection\n * @legacy @beta\n */\n// TODO: #22835 Use undefined instead of any (breaking change)\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface IOrderedCollection<T = any> extends ISnapshotable<T> {\n\t/**\n\t * Adds a value to the collection\n\t */\n\tadd(value: T);\n\n\t/**\n\t * Retrieves a value from the collection.\n\t */\n\tremove(): T;\n\n\t/**\n\t * Return the size of the collection\n\t */\n\tsize(): number;\n}\n"]}
@@ -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 = "@fluidframework/ordered-collection";
8
- export declare const pkgVersion = "2.102.0";
8
+ export declare const pkgVersion = "2.110.0";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export const pkgName = "@fluidframework/ordered-collection";
8
- export const pkgVersion = "2.102.0";
8
+ export const pkgVersion = "2.110.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,oCAAoC,CAAC;AAC5D,MAAM,CAAC,MAAM,UAAU,GAAG,SAAS,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 = \"@fluidframework/ordered-collection\";\nexport const pkgVersion = \"2.102.0\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,oCAAoC,CAAC;AAC5D,MAAM,CAAC,MAAM,UAAU,GAAG,SAAS,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 = \"@fluidframework/ordered-collection\";\nexport const pkgVersion = \"2.110.0\";\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/ordered-collection",
3
- "version": "2.102.0",
3
+ "version": "2.110.0",
4
4
  "description": "Consensus Collection",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -81,29 +81,29 @@
81
81
  "temp-directory": "nyc/.nyc_output"
82
82
  },
83
83
  "dependencies": {
84
- "@fluid-internal/client-utils": "~2.102.0",
85
- "@fluidframework/core-interfaces": "~2.102.0",
86
- "@fluidframework/core-utils": "~2.102.0",
87
- "@fluidframework/datastore-definitions": "~2.102.0",
88
- "@fluidframework/driver-definitions": "~2.102.0",
89
- "@fluidframework/runtime-definitions": "~2.102.0",
90
- "@fluidframework/runtime-utils": "~2.102.0",
91
- "@fluidframework/shared-object-base": "~2.102.0",
92
- "@fluidframework/telemetry-utils": "~2.102.0",
84
+ "@fluid-internal/client-utils": "~2.110.0",
85
+ "@fluidframework/core-interfaces": "~2.110.0",
86
+ "@fluidframework/core-utils": "~2.110.0",
87
+ "@fluidframework/datastore-definitions": "~2.110.0",
88
+ "@fluidframework/driver-definitions": "~2.110.0",
89
+ "@fluidframework/runtime-definitions": "~2.110.0",
90
+ "@fluidframework/runtime-utils": "~2.110.0",
91
+ "@fluidframework/shared-object-base": "~2.110.0",
92
+ "@fluidframework/telemetry-utils": "~2.110.0",
93
93
  "uuid": "^11.1.0"
94
94
  },
95
95
  "devDependencies": {
96
96
  "@arethetypeswrong/cli": "^0.18.2",
97
97
  "@biomejs/biome": "~2.4.5",
98
- "@fluid-internal/mocha-test-setup": "~2.102.0",
99
- "@fluid-private/stochastic-test-utils": "~2.102.0",
100
- "@fluid-private/test-dds-utils": "~2.102.0",
98
+ "@fluid-internal/mocha-test-setup": "~2.110.0",
99
+ "@fluid-private/stochastic-test-utils": "~2.110.0",
100
+ "@fluid-private/test-dds-utils": "~2.110.0",
101
101
  "@fluid-tools/build-cli": "^0.65.0",
102
102
  "@fluidframework/build-common": "^2.0.3",
103
103
  "@fluidframework/build-tools": "^0.65.0",
104
- "@fluidframework/eslint-config-fluid": "^9.0.0",
105
- "@fluidframework/ordered-collection-previous": "npm:@fluidframework/ordered-collection@2.101.0",
106
- "@fluidframework/test-runtime-utils": "~2.102.0",
104
+ "@fluidframework/eslint-config-fluid": "^13.0.0",
105
+ "@fluidframework/ordered-collection-previous": "npm:@fluidframework/ordered-collection@2.103.0",
106
+ "@fluidframework/test-runtime-utils": "~2.110.0",
107
107
  "@microsoft/api-extractor": "7.58.1",
108
108
  "@types/mocha": "^10.0.10",
109
109
  "@types/node": "~22.19.17",
@@ -5,17 +5,15 @@
5
5
 
6
6
  import type {
7
7
  IChannelAttributes,
8
- IFluidDataStoreRuntime,
8
+ IChannelFactory,
9
9
  IChannelServices,
10
+ IFluidDataStoreRuntime,
10
11
  } from "@fluidframework/datastore-definitions/internal";
11
12
  import { createSharedObjectKind } from "@fluidframework/shared-object-base/internal";
12
13
 
13
14
  // eslint-disable-next-line import-x/no-deprecated -- Internal usage of deprecated class in factory
14
15
  import { ConsensusQueueClass } from "./consensusQueue.js";
15
- import type {
16
- IConsensusOrderedCollection,
17
- IConsensusOrderedCollectionFactory,
18
- } from "./interfaces.js";
16
+ import type { IConsensusOrderedCollection } from "./interfaces.js";
19
17
  import { pkgVersion } from "./packageVersion.js";
20
18
 
21
19
  /**
@@ -23,7 +21,9 @@ import { pkgVersion } from "./packageVersion.js";
23
21
  *
24
22
  * @internal
25
23
  */
26
- export class ConsensusQueueFactory implements IConsensusOrderedCollectionFactory {
24
+ export class ConsensusQueueFactory<T>
25
+ implements IChannelFactory<IConsensusOrderedCollection<T>>
26
+ {
27
27
  // New type string, to be activated once the migration has been fully shipped dark and is safe to flip.
28
28
  // See LegacyTypeAwareRegistry in packages/runtime/datastore/src/dataStoreRuntime.ts.
29
29
  // public static Type = "consensus-queue";
@@ -43,24 +43,21 @@ export class ConsensusQueueFactory implements IConsensusOrderedCollectionFactory
43
43
  return ConsensusQueueFactory.Attributes;
44
44
  }
45
45
 
46
- /**
47
- * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}
48
- */
49
46
  public async load(
50
47
  runtime: IFluidDataStoreRuntime,
51
48
  id: string,
52
49
  services: IChannelServices,
53
50
  attributes: IChannelAttributes,
54
- ): Promise<IConsensusOrderedCollection> {
51
+ ): Promise<IConsensusOrderedCollection<T>> {
55
52
  // eslint-disable-next-line import-x/no-deprecated -- Internal usage of deprecated class
56
- const collection = new ConsensusQueueClass(id, runtime, attributes);
53
+ const collection = new ConsensusQueueClass<T>(id, runtime, attributes);
57
54
  await collection.load(services);
58
55
  return collection;
59
56
  }
60
57
 
61
- public create(document: IFluidDataStoreRuntime, id: string): IConsensusOrderedCollection {
58
+ public create(document: IFluidDataStoreRuntime, id: string): IConsensusOrderedCollection<T> {
62
59
  // eslint-disable-next-line import-x/no-deprecated -- Internal usage of deprecated class
63
- const collection = new ConsensusQueueClass(id, document, this.attributes);
60
+ const collection = new ConsensusQueueClass<T>(id, document, this.attributes);
64
61
  collection.initializeLocal();
65
62
  return collection;
66
63
  }
@@ -70,7 +67,21 @@ export class ConsensusQueueFactory implements IConsensusOrderedCollectionFactory
70
67
  * {@inheritDoc ConsensusQueueClass}
71
68
  * @legacy @beta
72
69
  */
73
- export const ConsensusQueue = createSharedObjectKind(ConsensusQueueFactory);
70
+ export const ConsensusQueue =
71
+ createSharedObjectKind<IConsensusOrderedCollection>(ConsensusQueueFactory);
72
+
73
+ // For #22835, consider exposing a helper to produce type specific ConsensusQueue.
74
+ // One problem, with doing so is that nothing inside ConsensusQueue validates the shape of T.
75
+ // A DDS load might find content that is not the same, expected type.
76
+ // But that is not any worse than the `any` that exists currently.
77
+ // /**
78
+ // * Factory for shared object kind for queue-shaped ordered collections of specific type.
79
+ // * @legacy @beta
80
+ // */
81
+ // export function TypedConsensusQueue<T>(): ISharedObjectKind<IConsensusOrderedCollection<T>> &
82
+ // SharedObjectKind<IConsensusOrderedCollection<T>> {
83
+ // return ConsensusQueue;
84
+ // }
74
85
 
75
86
  /**
76
87
  * {@inheritDoc ConsensusQueueClass}
package/src/index.ts CHANGED
@@ -8,7 +8,6 @@ export {
8
8
  ConsensusResult,
9
9
  type IConsensusOrderedCollection,
10
10
  type IConsensusOrderedCollectionEvents,
11
- type IConsensusOrderedCollectionFactory,
12
11
  type IOrderedCollection,
13
12
  type ISnapshotable,
14
13
  } from "./interfaces.js";
package/src/interfaces.ts CHANGED
@@ -3,12 +3,6 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import type {
7
- IChannelAttributes,
8
- IChannelFactory,
9
- IFluidDataStoreRuntime,
10
- IChannelServices,
11
- } from "@fluidframework/datastore-definitions/internal";
12
6
  import type {
13
7
  ISharedObject,
14
8
  ISharedObjectEvents,
@@ -29,24 +23,6 @@ export enum ConsensusResult {
29
23
  */
30
24
  export type ConsensusCallback<T> = (value: T) => Promise<ConsensusResult>;
31
25
 
32
- /**
33
- * Consensus Ordered Collection channel factory interface
34
- *
35
- * Extends the base IChannelFactory to return a more definite type of IConsensusOrderedCollection
36
- * Use for the runtime to create and load distributed data structure by type name of each channel
37
- * @internal
38
- */
39
- export interface IConsensusOrderedCollectionFactory extends IChannelFactory {
40
- load(
41
- document: IFluidDataStoreRuntime,
42
- id: string,
43
- services: IChannelServices,
44
- attributes: IChannelAttributes,
45
- ): Promise<IConsensusOrderedCollection>;
46
-
47
- create(document: IFluidDataStoreRuntime, id: string): IConsensusOrderedCollection;
48
- }
49
-
50
26
  /**
51
27
  * Events notifying about addition, acquisition, release and completion of items
52
28
  * @legacy @beta
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/ordered-collection";
9
- export const pkgVersion = "2.102.0";
9
+ export const pkgVersion = "2.110.0";