@fluidframework/runtime-definitions 2.0.0-dev.5.2.0.169897 → 2.0.0-dev.6.4.0.191258
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +1 -0
- package/CHANGELOG.md +139 -0
- package/README.md +4 -3
- package/dist/attribution.d.ts +2 -2
- package/dist/attribution.js.map +1 -1
- package/dist/dataStoreContext.d.ts +47 -8
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/id-compressor/idCompressor.d.ts +32 -50
- package/dist/id-compressor/idCompressor.d.ts.map +1 -1
- package/dist/id-compressor/idCompressor.js.map +1 -1
- package/dist/id-compressor/identifiers.d.ts +10 -51
- package/dist/id-compressor/identifiers.d.ts.map +1 -1
- package/dist/id-compressor/identifiers.js.map +1 -1
- package/dist/id-compressor/index.d.ts +2 -2
- package/dist/id-compressor/index.d.ts.map +1 -1
- package/dist/id-compressor/index.js +3 -0
- package/dist/id-compressor/index.js.map +1 -1
- package/dist/id-compressor/persisted-types/0.0.1.d.ts +18 -136
- package/dist/id-compressor/persisted-types/0.0.1.d.ts.map +1 -1
- package/dist/id-compressor/persisted-types/0.0.1.js +6 -0
- package/dist/id-compressor/persisted-types/0.0.1.js.map +1 -1
- package/dist/id-compressor/persisted-types/index.d.ts +1 -1
- package/dist/id-compressor/persisted-types/index.d.ts.map +1 -1
- package/dist/id-compressor/persisted-types/index.js +3 -0
- package/dist/id-compressor/persisted-types/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/summary.d.ts +3 -2
- package/dist/summary.d.ts.map +1 -1
- package/dist/summary.js.map +1 -1
- package/package.json +12 -14
- package/src/aliasing.md +42 -0
- package/src/attribution.ts +2 -2
- package/src/dataStoreContext.ts +50 -10
- package/src/id-compressor/idCompressor.ts +32 -59
- package/src/id-compressor/identifiers.ts +10 -58
- package/src/id-compressor/index.ts +2 -19
- package/src/id-compressor/persisted-types/0.0.1.ts +18 -159
- package/src/id-compressor/persisted-types/index.ts +1 -8
- package/src/index.ts +1 -13
- package/src/summary.ts +3 -2
|
@@ -3,188 +3,47 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import type {
|
|
7
|
-
FinalCompressedId,
|
|
8
|
-
LocalCompressedId,
|
|
9
|
-
OpSpaceCompressedId,
|
|
10
|
-
SessionId,
|
|
11
|
-
} from "../identifiers";
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* A serialized ID allocation session for an `IdCompressor`.
|
|
15
|
-
*/
|
|
16
|
-
export type SerializedSessionData = readonly [
|
|
17
|
-
/**
|
|
18
|
-
* The ID of the session.
|
|
19
|
-
*/
|
|
20
|
-
sessionId: SessionId,
|
|
21
|
-
];
|
|
22
|
-
|
|
23
|
-
export type SerializedClusterOverrides = readonly [
|
|
24
|
-
/** The overridden final ID, represented as an index into the cluster's ID range */
|
|
25
|
-
overriddenFinalIndex: number, // A cluster with base UUID '...beef' and an `overriddenFinalIndex` of 3 would correspond to '...bef2'
|
|
26
|
-
/** The override string */
|
|
27
|
-
override: string,
|
|
28
|
-
/** The first ID that was finalized and associated with this override, set only if different than the `overriddenFinalIndex` */
|
|
29
|
-
overriddenId?: FinalCompressedId,
|
|
30
|
-
][];
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* A serialized final ID cluster.
|
|
34
|
-
*/
|
|
35
|
-
export type SerializedCluster = readonly [
|
|
36
|
-
/**
|
|
37
|
-
* Index into the serialized sessions array. Can be converted into a baseUuid via its order in `clusters`.
|
|
38
|
-
* If negative, then this cluster was created by the local session.
|
|
39
|
-
*/
|
|
40
|
-
sessionIndex: number,
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* The capacity of the cluster.
|
|
44
|
-
*/
|
|
45
|
-
capacity: number,
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* The number of IDs in the cluster. Omitted if count === capacity.
|
|
49
|
-
* --OR--
|
|
50
|
-
* The overrides in this cluster. Omitted if no overrides exist in the cluster.
|
|
51
|
-
*/
|
|
52
|
-
countOrOverrides?: number | SerializedClusterOverrides,
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Overrides in this cluster. Omitted if no overrides exist in the cluster.
|
|
56
|
-
*/
|
|
57
|
-
overrides?: SerializedClusterOverrides,
|
|
58
|
-
];
|
|
59
|
-
|
|
60
|
-
export type SerializedLocalOverrides = readonly (readonly [LocalCompressedId, string])[];
|
|
61
|
-
|
|
62
|
-
export interface SerializedLocalState {
|
|
63
|
-
/**
|
|
64
|
-
* The total number of local IDs created by this session
|
|
65
|
-
*/
|
|
66
|
-
readonly localIdCount: number;
|
|
67
|
-
/**
|
|
68
|
-
* Overrides generated by this session. Omitted if no local overrides exist in the session.
|
|
69
|
-
*/
|
|
70
|
-
readonly overrides?: SerializedLocalOverrides;
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* The most recent local ID in a range returned by `takeNextCreationRange`.
|
|
74
|
-
*/
|
|
75
|
-
readonly lastTakenLocalId: LocalCompressedId | undefined;
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Serialized table for normalizing IDs made by the local session.
|
|
79
|
-
*/
|
|
80
|
-
readonly sessionNormalizer: SerializedSessionIdNormalizer;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Serialized table for normalizing IDs made by the local session.
|
|
85
|
-
*/
|
|
86
|
-
export interface SerializedSessionIdNormalizer {
|
|
87
|
-
readonly nextLocalId: LocalCompressedId;
|
|
88
|
-
readonly localRanges: readonly (readonly [
|
|
89
|
-
firstLocal: LocalCompressedId,
|
|
90
|
-
lastLocal: LocalCompressedId,
|
|
91
|
-
finalRanges?: readonly (readonly [
|
|
92
|
-
alignedLocal: LocalCompressedId,
|
|
93
|
-
firstFinal: FinalCompressedId,
|
|
94
|
-
lastFinal: FinalCompressedId,
|
|
95
|
-
])[],
|
|
96
|
-
])[];
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* The minimal required contents of a serialized IdCompressor.
|
|
101
|
-
*/
|
|
102
|
-
export interface VersionedSerializedIdCompressor {
|
|
103
|
-
readonly _versionedSerializedIdCompressor: "8c73c57c-1cf4-4278-8915-6444cb4f6af5";
|
|
104
|
-
readonly version: string;
|
|
105
|
-
}
|
|
6
|
+
import type { SessionId } from "../identifiers";
|
|
106
7
|
|
|
107
8
|
/**
|
|
108
9
|
* The serialized contents of an IdCompressor, suitable for persistence in a summary.
|
|
109
10
|
*/
|
|
110
|
-
export
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
/** All sessions except the local session. */
|
|
114
|
-
readonly sessions: readonly SerializedSessionData[];
|
|
115
|
-
/** All clusters in the compressor in the order they were created. */
|
|
116
|
-
readonly clusters: readonly SerializedCluster[];
|
|
117
|
-
}
|
|
11
|
+
export type SerializedIdCompressor = string & {
|
|
12
|
+
readonly _serializedIdCompressor: "8c73c57c-1cf4-4278-8915-6444cb4f6af5";
|
|
13
|
+
};
|
|
118
14
|
|
|
119
15
|
/**
|
|
120
16
|
* The serialized contents of an IdCompressor, suitable for persistence in a summary.
|
|
121
17
|
*/
|
|
122
|
-
export
|
|
18
|
+
export type SerializedIdCompressorWithNoSession = SerializedIdCompressor & {
|
|
123
19
|
readonly _noLocalState: "3aa2e1e8-cc28-4ea7-bc1a-a11dc3f26dfb";
|
|
124
|
-
}
|
|
20
|
+
};
|
|
125
21
|
|
|
126
22
|
/**
|
|
127
23
|
* The serialized contents of an IdCompressor, suitable for persistence in a summary.
|
|
128
24
|
*/
|
|
129
|
-
export
|
|
25
|
+
export type SerializedIdCompressorWithOngoingSession = SerializedIdCompressor & {
|
|
130
26
|
readonly _hasLocalState: "1281acae-6d14-47e7-bc92-71c8ee0819cb";
|
|
131
|
-
|
|
132
|
-
readonly localSessionIndex: number;
|
|
133
|
-
/** This is only present if the local session made any IDs. */
|
|
134
|
-
readonly localState?: SerializedLocalState;
|
|
135
|
-
}
|
|
27
|
+
};
|
|
136
28
|
|
|
137
29
|
/**
|
|
138
30
|
* Data describing a range of session-local IDs (from a remote or local session).
|
|
139
31
|
*
|
|
140
|
-
* A range is composed of local IDs that were generated.
|
|
141
|
-
*
|
|
142
|
-
* @example
|
|
143
|
-
* Suppose an IdCompressor generated a sequence of local IDs as follows:
|
|
144
|
-
* ```
|
|
145
|
-
* compressor.generateLocalId()
|
|
146
|
-
* compressor.generateLocalId('0093cf29-9454-4034-8940-33b1077b41c3')
|
|
147
|
-
* compressor.generateLocalId()
|
|
148
|
-
* compressor.generateLocalId('0ed545f8-e97e-4dc1-acf9-c4a783258bdf')
|
|
149
|
-
* compressor.generateLocalId()
|
|
150
|
-
* compressor.generateLocalId()
|
|
151
|
-
* compressor.takeNextCreationRange()
|
|
152
|
-
* ```
|
|
153
|
-
* This would result in the following range:
|
|
154
|
-
* ```
|
|
155
|
-
* {
|
|
156
|
-
* first: localId1,
|
|
157
|
-
* last: localId6,
|
|
158
|
-
* overrides: [[localId2, '0093cf29-9454-4034-8940-33b1077b41c3'], [localId4, '0ed545f8-e97e-4dc1-acf9-c4a783258bdf']]
|
|
159
|
-
* }
|
|
160
|
-
* ```
|
|
32
|
+
* A range is composed of local IDs that were generated.
|
|
161
33
|
*/
|
|
162
34
|
export interface IdCreationRange {
|
|
163
35
|
readonly sessionId: SessionId;
|
|
164
|
-
readonly ids?:
|
|
36
|
+
readonly ids?: {
|
|
37
|
+
readonly firstGenCount: number;
|
|
38
|
+
readonly count: number;
|
|
39
|
+
};
|
|
165
40
|
}
|
|
166
41
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
| {
|
|
173
|
-
readonly first: UnackedLocalId;
|
|
174
|
-
readonly last: UnackedLocalId;
|
|
175
|
-
}
|
|
176
|
-
| ({
|
|
177
|
-
readonly first?: UnackedLocalId;
|
|
178
|
-
readonly last?: UnackedLocalId;
|
|
179
|
-
} & HasOverrides);
|
|
180
|
-
|
|
181
|
-
export interface HasOverrides {
|
|
182
|
-
readonly overrides: Overrides;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
export type Override = readonly [id: UnackedLocalId, override: string];
|
|
186
|
-
export type Overrides = readonly [Override, ...Override[]];
|
|
187
|
-
}
|
|
42
|
+
/**
|
|
43
|
+
* Roughly equates to a minimum of 1M sessions before we start allocating 64 bit IDs.
|
|
44
|
+
* This value must *NOT* change without careful consideration to compatibility.
|
|
45
|
+
*/
|
|
46
|
+
export const initialClusterCapacity = 512;
|
|
188
47
|
|
|
189
48
|
export type IdCreationRangeWithStashedState = IdCreationRange & {
|
|
190
49
|
stashedState: SerializedIdCompressorWithOngoingSession;
|
|
@@ -5,16 +5,9 @@
|
|
|
5
5
|
|
|
6
6
|
export {
|
|
7
7
|
IdCreationRange,
|
|
8
|
-
SerializedCluster,
|
|
9
|
-
SerializedClusterOverrides,
|
|
10
8
|
SerializedIdCompressor,
|
|
11
9
|
SerializedIdCompressorWithNoSession,
|
|
12
10
|
SerializedIdCompressorWithOngoingSession,
|
|
13
|
-
SerializedLocalOverrides,
|
|
14
|
-
SerializedLocalState,
|
|
15
|
-
SerializedSessionData,
|
|
16
|
-
SerializedSessionIdNormalizer,
|
|
17
|
-
UnackedLocalId,
|
|
18
|
-
VersionedSerializedIdCompressor,
|
|
19
11
|
IdCreationRangeWithStashedState,
|
|
12
|
+
initialClusterCapacity,
|
|
20
13
|
} from "./0.0.1";
|
package/src/index.ts
CHANGED
|
@@ -74,20 +74,8 @@ export {
|
|
|
74
74
|
SessionSpaceCompressedId,
|
|
75
75
|
OpSpaceCompressedId,
|
|
76
76
|
SessionId,
|
|
77
|
-
FinalCompressedId,
|
|
78
77
|
StableId,
|
|
79
|
-
UuidString,
|
|
80
|
-
CompressedId,
|
|
81
|
-
SessionUnique,
|
|
82
|
-
LocalCompressedId,
|
|
83
78
|
IdCreationRange,
|
|
84
|
-
VersionedSerializedIdCompressor,
|
|
85
|
-
SerializedCluster,
|
|
86
|
-
SerializedSessionData,
|
|
87
|
-
SerializedLocalState,
|
|
88
|
-
SerializedClusterOverrides,
|
|
89
|
-
SerializedLocalOverrides,
|
|
90
|
-
SerializedSessionIdNormalizer,
|
|
91
|
-
UnackedLocalId,
|
|
92
79
|
IdCreationRangeWithStashedState,
|
|
80
|
+
initialClusterCapacity,
|
|
93
81
|
} from "./id-compressor";
|
package/src/summary.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { TelemetryEventPropertyType } from "@fluidframework/
|
|
6
|
+
import { TelemetryEventPropertyType } from "@fluidframework/core-interfaces";
|
|
7
7
|
import {
|
|
8
8
|
SummaryTree,
|
|
9
9
|
ISummaryTree,
|
|
@@ -56,7 +56,8 @@ export interface ISummarizeResult {
|
|
|
56
56
|
* the data store summaries are wrapped around an array of labels identified by pathPartsForChildren.
|
|
57
57
|
*
|
|
58
58
|
* @example
|
|
59
|
-
*
|
|
59
|
+
*
|
|
60
|
+
* ```typescript
|
|
60
61
|
* id:""
|
|
61
62
|
* pathPartsForChildren: ["path1"]
|
|
62
63
|
* stats: ...
|