@fluidframework/ordered-collection 2.53.1 → 2.61.0-355054
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/.mocharc.cjs +1 -2
- package/CHANGELOG.md +4 -0
- package/api-report/{ordered-collection.legacy.alpha.api.md → ordered-collection.legacy.beta.api.md} +11 -11
- package/dist/consensusOrderedCollection.d.ts +6 -7
- package/dist/consensusOrderedCollection.d.ts.map +1 -1
- package/dist/consensusOrderedCollection.js +1 -2
- package/dist/consensusOrderedCollection.js.map +1 -1
- package/dist/consensusOrderedCollectionFactory.d.ts +4 -6
- package/dist/consensusOrderedCollectionFactory.d.ts.map +1 -1
- package/dist/consensusOrderedCollectionFactory.js +1 -2
- package/dist/consensusOrderedCollectionFactory.js.map +1 -1
- package/dist/consensusQueue.d.ts +2 -3
- package/dist/consensusQueue.d.ts.map +1 -1
- package/dist/consensusQueue.js +1 -2
- package/dist/consensusQueue.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +8 -14
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/interfaces.js +1 -2
- package/dist/interfaces.js.map +1 -1
- package/dist/legacy.d.ts +2 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/testUtils.d.ts +1 -1
- package/dist/testUtils.d.ts.map +1 -1
- package/dist/testUtils.js.map +1 -1
- package/internal.d.ts +1 -1
- package/legacy.d.ts +1 -1
- package/lib/consensusOrderedCollection.d.ts +6 -7
- package/lib/consensusOrderedCollection.d.ts.map +1 -1
- package/lib/consensusOrderedCollection.js +2 -3
- package/lib/consensusOrderedCollection.js.map +1 -1
- package/lib/consensusOrderedCollectionFactory.d.ts +4 -6
- package/lib/consensusOrderedCollectionFactory.d.ts.map +1 -1
- package/lib/consensusOrderedCollectionFactory.js +1 -2
- package/lib/consensusOrderedCollectionFactory.js.map +1 -1
- package/lib/consensusQueue.d.ts +2 -3
- package/lib/consensusQueue.d.ts.map +1 -1
- package/lib/consensusQueue.js +1 -2
- package/lib/consensusQueue.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/interfaces.d.ts +8 -14
- package/lib/interfaces.d.ts.map +1 -1
- package/lib/interfaces.js +1 -2
- package/lib/interfaces.js.map +1 -1
- package/lib/legacy.d.ts +2 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/testUtils.d.ts +1 -1
- package/lib/testUtils.d.ts.map +1 -1
- package/lib/testUtils.js.map +1 -1
- package/lib/tsdoc-metadata.json +1 -1
- package/package.json +23 -23
- package/src/consensusOrderedCollection.ts +12 -10
- package/src/consensusOrderedCollectionFactory.ts +4 -6
- package/src/consensusQueue.ts +3 -4
- package/src/index.ts +6 -6
- package/src/interfaces.ts +8 -14
- package/src/packageVersion.ts +1 -1
- package/src/testUtils.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/ordered-collection",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.61.0-355054",
|
|
4
4
|
"description": "Consensus Collection",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -69,32 +69,32 @@
|
|
|
69
69
|
"temp-directory": "nyc/.nyc_output"
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@fluid-internal/client-utils": "
|
|
73
|
-
"@fluidframework/core-interfaces": "
|
|
74
|
-
"@fluidframework/core-utils": "
|
|
75
|
-
"@fluidframework/datastore-definitions": "
|
|
76
|
-
"@fluidframework/driver-definitions": "
|
|
77
|
-
"@fluidframework/runtime-definitions": "
|
|
78
|
-
"@fluidframework/runtime-utils": "
|
|
79
|
-
"@fluidframework/shared-object-base": "
|
|
80
|
-
"@fluidframework/telemetry-utils": "
|
|
72
|
+
"@fluid-internal/client-utils": "2.61.0-355054",
|
|
73
|
+
"@fluidframework/core-interfaces": "2.61.0-355054",
|
|
74
|
+
"@fluidframework/core-utils": "2.61.0-355054",
|
|
75
|
+
"@fluidframework/datastore-definitions": "2.61.0-355054",
|
|
76
|
+
"@fluidframework/driver-definitions": "2.61.0-355054",
|
|
77
|
+
"@fluidframework/runtime-definitions": "2.61.0-355054",
|
|
78
|
+
"@fluidframework/runtime-utils": "2.61.0-355054",
|
|
79
|
+
"@fluidframework/shared-object-base": "2.61.0-355054",
|
|
80
|
+
"@fluidframework/telemetry-utils": "2.61.0-355054",
|
|
81
81
|
"uuid": "^11.1.0"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
84
|
"@arethetypeswrong/cli": "^0.17.1",
|
|
85
85
|
"@biomejs/biome": "~1.9.3",
|
|
86
|
-
"@fluid-internal/mocha-test-setup": "
|
|
87
|
-
"@fluid-private/test-dds-utils": "
|
|
88
|
-
"@fluid-tools/build-cli": "^0.
|
|
86
|
+
"@fluid-internal/mocha-test-setup": "2.61.0-355054",
|
|
87
|
+
"@fluid-private/test-dds-utils": "2.61.0-355054",
|
|
88
|
+
"@fluid-tools/build-cli": "^0.58.2",
|
|
89
89
|
"@fluidframework/build-common": "^2.0.3",
|
|
90
|
-
"@fluidframework/build-tools": "^0.
|
|
91
|
-
"@fluidframework/eslint-config-fluid": "^
|
|
92
|
-
"@fluidframework/ordered-collection-previous": "npm:@fluidframework/ordered-collection@2.
|
|
93
|
-
"@fluidframework/test-runtime-utils": "
|
|
94
|
-
"@microsoft/api-extractor": "7.52.
|
|
90
|
+
"@fluidframework/build-tools": "^0.58.2",
|
|
91
|
+
"@fluidframework/eslint-config-fluid": "^6.0.0",
|
|
92
|
+
"@fluidframework/ordered-collection-previous": "npm:@fluidframework/ordered-collection@2.60.0",
|
|
93
|
+
"@fluidframework/test-runtime-utils": "2.61.0-355054",
|
|
94
|
+
"@microsoft/api-extractor": "7.52.11",
|
|
95
95
|
"@types/mocha": "^10.0.10",
|
|
96
96
|
"@types/node": "^18.19.0",
|
|
97
|
-
"c8": "^
|
|
97
|
+
"c8": "^10.1.3",
|
|
98
98
|
"concurrently": "^8.2.1",
|
|
99
99
|
"copyfiles": "^2.4.1",
|
|
100
100
|
"cross-env": "^7.0.3",
|
|
@@ -110,8 +110,8 @@
|
|
|
110
110
|
},
|
|
111
111
|
"scripts": {
|
|
112
112
|
"api": "fluid-build . --task api",
|
|
113
|
-
"api-extractor:commonjs": "flub generate entrypoints --outDir ./dist",
|
|
114
|
-
"api-extractor:esnext": "flub generate entrypoints --outDir ./lib --node10TypeCompat",
|
|
113
|
+
"api-extractor:commonjs": "flub generate entrypoints --outFileLegacyBeta legacy --outDir ./dist",
|
|
114
|
+
"api-extractor:esnext": "flub generate entrypoints --outFileLegacyBeta legacy --outDir ./lib --node10TypeCompat",
|
|
115
115
|
"build": "fluid-build . --task build",
|
|
116
116
|
"build:api-reports": "concurrently \"npm:build:api-reports:*\"",
|
|
117
117
|
"build:api-reports:current": "api-extractor run --local --config api-extractor/api-extractor.current.json",
|
|
@@ -147,8 +147,8 @@
|
|
|
147
147
|
"test": "npm run test:mocha",
|
|
148
148
|
"test:coverage": "c8 npm test",
|
|
149
149
|
"test:mocha": "npm run test:mocha:esm && echo skipping cjs to avoid overhead - npm run test:mocha:cjs",
|
|
150
|
-
"test:mocha:cjs": "
|
|
151
|
-
"test:mocha:esm": "mocha
|
|
150
|
+
"test:mocha:cjs": "cross-env MOCHA_SPEC=dist/test mocha",
|
|
151
|
+
"test:mocha:esm": "mocha",
|
|
152
152
|
"test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha",
|
|
153
153
|
"tsc": "fluid-tsc commonjs --project ./tsconfig.cjs.json && copyfiles -f ../../../common/build/build-common/src/cjs/package.json ./dist",
|
|
154
154
|
"typetests:gen": "flub generate typetests --dir . -v",
|
|
@@ -5,26 +5,29 @@
|
|
|
5
5
|
|
|
6
6
|
import { bufferToString } from "@fluid-internal/client-utils";
|
|
7
7
|
import { assert, unreachableCase } from "@fluidframework/core-utils/internal";
|
|
8
|
-
import {
|
|
8
|
+
import type {
|
|
9
9
|
IChannelAttributes,
|
|
10
10
|
IFluidDataStoreRuntime,
|
|
11
11
|
IChannelStorageService,
|
|
12
12
|
} from "@fluidframework/datastore-definitions/internal";
|
|
13
13
|
import {
|
|
14
14
|
MessageType,
|
|
15
|
-
ISequencedDocumentMessage,
|
|
15
|
+
type ISequencedDocumentMessage,
|
|
16
16
|
} from "@fluidframework/driver-definitions/internal";
|
|
17
|
-
import { ISummaryTreeWithStats } from "@fluidframework/runtime-definitions/internal";
|
|
17
|
+
import type { ISummaryTreeWithStats } from "@fluidframework/runtime-definitions/internal";
|
|
18
18
|
import { SummaryTreeBuilder } from "@fluidframework/runtime-utils/internal";
|
|
19
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
type IFluidSerializer,
|
|
21
|
+
SharedObject,
|
|
22
|
+
} from "@fluidframework/shared-object-base/internal";
|
|
20
23
|
import { v4 as uuid } from "uuid";
|
|
21
24
|
|
|
22
25
|
import {
|
|
23
|
-
ConsensusCallback,
|
|
26
|
+
type ConsensusCallback,
|
|
24
27
|
ConsensusResult,
|
|
25
|
-
IConsensusOrderedCollection,
|
|
26
|
-
IConsensusOrderedCollectionEvents,
|
|
27
|
-
IOrderedCollection,
|
|
28
|
+
type IConsensusOrderedCollection,
|
|
29
|
+
type IConsensusOrderedCollectionEvents,
|
|
30
|
+
type IOrderedCollection,
|
|
28
31
|
} from "./interfaces.js";
|
|
29
32
|
|
|
30
33
|
const snapshotFileNameData = "header";
|
|
@@ -97,8 +100,7 @@ const idForLocalUnattachedClient = undefined;
|
|
|
97
100
|
*
|
|
98
101
|
* Generally not used directly. A derived type will pass in a backing data type
|
|
99
102
|
* IOrderedCollection that will define the deterministic add/acquire order and snapshot ability.
|
|
100
|
-
* @legacy
|
|
101
|
-
* @alpha
|
|
103
|
+
* @legacy @beta
|
|
102
104
|
*/
|
|
103
105
|
|
|
104
106
|
// TODO: #22835 Use undefined instead of any (breaking change)
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import type {
|
|
7
7
|
IChannelAttributes,
|
|
8
8
|
IFluidDataStoreRuntime,
|
|
9
9
|
IChannelServices,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
import { createSharedObjectKind } from "@fluidframework/shared-object-base/internal";
|
|
12
12
|
|
|
13
13
|
import { ConsensusQueueClass } from "./consensusQueue.js";
|
|
14
|
-
import {
|
|
14
|
+
import type {
|
|
15
15
|
IConsensusOrderedCollection,
|
|
16
16
|
IConsensusOrderedCollectionFactory,
|
|
17
17
|
} from "./interfaces.js";
|
|
@@ -62,15 +62,13 @@ export class ConsensusQueueFactory implements IConsensusOrderedCollectionFactory
|
|
|
62
62
|
|
|
63
63
|
/**
|
|
64
64
|
* {@inheritDoc ConsensusQueueClass}
|
|
65
|
-
* @legacy
|
|
66
|
-
* @alpha
|
|
65
|
+
* @legacy @beta
|
|
67
66
|
*/
|
|
68
67
|
export const ConsensusQueue = createSharedObjectKind(ConsensusQueueFactory);
|
|
69
68
|
|
|
70
69
|
/**
|
|
71
70
|
* {@inheritDoc ConsensusQueueClass}
|
|
72
|
-
* @legacy
|
|
73
|
-
* @alpha
|
|
71
|
+
* @legacy @beta
|
|
74
72
|
*/
|
|
75
73
|
// TODO: #22835 Use undefined instead of any (breaking change)
|
|
76
74
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
package/src/consensusQueue.ts
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import type {
|
|
7
7
|
IChannelAttributes,
|
|
8
8
|
IFluidDataStoreRuntime,
|
|
9
9
|
} from "@fluidframework/datastore-definitions/internal";
|
|
10
10
|
|
|
11
11
|
import { ConsensusOrderedCollection } from "./consensusOrderedCollection.js";
|
|
12
|
-
import { IOrderedCollection } from "./interfaces.js";
|
|
12
|
+
import type { IOrderedCollection } from "./interfaces.js";
|
|
13
13
|
import { SnapshotableArray } from "./snapshotableArray.js";
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -32,8 +32,7 @@ class SnapshotableQueue<T> extends SnapshotableArray<T> implements IOrderedColle
|
|
|
32
32
|
* Implementation of a consensus stack
|
|
33
33
|
*
|
|
34
34
|
* An derived type of ConsensusOrderedCollection with a queue as the backing data and order.
|
|
35
|
-
* @legacy
|
|
36
|
-
* @alpha
|
|
35
|
+
* @legacy @beta
|
|
37
36
|
*/
|
|
38
37
|
// TODO: #22835 Use undefined instead of any (breaking change)
|
|
39
38
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
package/src/index.ts
CHANGED
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
export {
|
|
7
|
-
ConsensusCallback,
|
|
7
|
+
type ConsensusCallback,
|
|
8
8
|
ConsensusResult,
|
|
9
|
-
IConsensusOrderedCollection,
|
|
10
|
-
IConsensusOrderedCollectionEvents,
|
|
11
|
-
IConsensusOrderedCollectionFactory,
|
|
12
|
-
IOrderedCollection,
|
|
13
|
-
ISnapshotable,
|
|
9
|
+
type IConsensusOrderedCollection,
|
|
10
|
+
type IConsensusOrderedCollectionEvents,
|
|
11
|
+
type IConsensusOrderedCollectionFactory,
|
|
12
|
+
type IOrderedCollection,
|
|
13
|
+
type ISnapshotable,
|
|
14
14
|
} from "./interfaces.js";
|
|
15
15
|
export { ConsensusQueueFactory, ConsensusQueue } from "./consensusOrderedCollectionFactory.js";
|
|
16
16
|
export { ConsensusOrderedCollection } from "./consensusOrderedCollection.js";
|
package/src/interfaces.ts
CHANGED
|
@@ -3,20 +3,19 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import type {
|
|
7
7
|
IChannelAttributes,
|
|
8
8
|
IChannelFactory,
|
|
9
9
|
IFluidDataStoreRuntime,
|
|
10
10
|
IChannelServices,
|
|
11
11
|
} from "@fluidframework/datastore-definitions/internal";
|
|
12
|
-
import {
|
|
12
|
+
import type {
|
|
13
13
|
ISharedObject,
|
|
14
14
|
ISharedObjectEvents,
|
|
15
15
|
} from "@fluidframework/shared-object-base/internal";
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* @legacy
|
|
19
|
-
* @alpha
|
|
18
|
+
* @legacy @beta
|
|
20
19
|
*/
|
|
21
20
|
export enum ConsensusResult {
|
|
22
21
|
Release,
|
|
@@ -26,8 +25,7 @@ export enum ConsensusResult {
|
|
|
26
25
|
/**
|
|
27
26
|
* Callback provided to acquire() and waitAndAcquire() methods.
|
|
28
27
|
* @returns ConsensusResult indicating whether item was completed, or releases back to the queue.
|
|
29
|
-
* @legacy
|
|
30
|
-
* @alpha
|
|
28
|
+
* @legacy @beta
|
|
31
29
|
*/
|
|
32
30
|
export type ConsensusCallback<T> = (value: T) => Promise<ConsensusResult>;
|
|
33
31
|
|
|
@@ -51,8 +49,7 @@ export interface IConsensusOrderedCollectionFactory extends IChannelFactory {
|
|
|
51
49
|
|
|
52
50
|
/**
|
|
53
51
|
* Events notifying about addition, acquisition, release and completion of items
|
|
54
|
-
* @legacy
|
|
55
|
-
* @alpha
|
|
52
|
+
* @legacy @beta
|
|
56
53
|
*/
|
|
57
54
|
export interface IConsensusOrderedCollectionEvents<T> extends ISharedObjectEvents {
|
|
58
55
|
/**
|
|
@@ -105,8 +102,7 @@ export interface IConsensusOrderedCollectionEvents<T> extends ISharedObjectEvent
|
|
|
105
102
|
* All objects added to the collection will be cloned (via JSON).
|
|
106
103
|
* They will not be references to the original input object. Thus changed to
|
|
107
104
|
* the input object will not reflect the object in the collection.
|
|
108
|
-
* @legacy
|
|
109
|
-
* @alpha
|
|
105
|
+
* @legacy @beta
|
|
110
106
|
*/
|
|
111
107
|
// TODO: #22835 Use undefined instead of any (breaking change)
|
|
112
108
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -136,8 +132,7 @@ export interface IConsensusOrderedCollection<T = any>
|
|
|
136
132
|
*
|
|
137
133
|
* TODO: move this to be use in other place
|
|
138
134
|
* TODO: currently input and output is not symmetrical, can they become symmetrical?
|
|
139
|
-
* @legacy
|
|
140
|
-
* @alpha
|
|
135
|
+
* @legacy @beta
|
|
141
136
|
*/
|
|
142
137
|
export interface ISnapshotable<T> {
|
|
143
138
|
asArray(): T[];
|
|
@@ -151,8 +146,7 @@ export interface ISnapshotable<T> {
|
|
|
151
146
|
* Collection of objects that has deterministic add and remove ordering.
|
|
152
147
|
* Object implementing this interface can be used as the data backing
|
|
153
148
|
* for the ConsensusOrderedCollection
|
|
154
|
-
* @legacy
|
|
155
|
-
* @alpha
|
|
149
|
+
* @legacy @beta
|
|
156
150
|
*/
|
|
157
151
|
// TODO: #22835 Use undefined instead of any (breaking change)
|
|
158
152
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
package/src/packageVersion.ts
CHANGED
package/src/testUtils.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { ConsensusResult, IConsensusOrderedCollection } from "./interfaces.js";
|
|
6
|
+
import { ConsensusResult, type IConsensusOrderedCollection } from "./interfaces.js";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Helper method to acquire and complete an item
|