@fluidframework/runtime-definitions 2.0.0-internal.3.0.1 → 2.0.0-internal.3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +5 -7
- package/README.md +6 -6
- package/api-extractor.json +2 -2
- package/dist/attribution.d.ts +66 -0
- package/dist/attribution.d.ts.map +1 -0
- package/dist/attribution.js +7 -0
- package/dist/attribution.js.map +1 -0
- package/dist/dataStoreContext.d.ts +3 -3
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStoreFactory.d.ts.map +1 -1
- package/dist/dataStoreFactory.js.map +1 -1
- package/dist/dataStoreRegistry.d.ts +1 -1
- package/dist/dataStoreRegistry.d.ts.map +1 -1
- package/dist/dataStoreRegistry.js.map +1 -1
- package/dist/garbageCollection.d.ts.map +1 -1
- package/dist/garbageCollection.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/protocol.d.ts +2 -2
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js.map +1 -1
- package/dist/summary.d.ts.map +1 -1
- package/dist/summary.js.map +1 -1
- package/package.json +64 -74
- package/prettier.config.cjs +1 -1
- package/src/attribution.ts +72 -0
- package/src/dataStoreContext.ts +405 -407
- package/src/dataStoreFactory.ts +14 -11
- package/src/dataStoreRegistry.ts +8 -6
- package/src/garbageCollection.ts +12 -12
- package/src/index.ts +21 -9
- package/src/protocol.ts +39 -38
- package/src/summary.ts +210 -211
- package/tsconfig.json +8 -12
package/src/dataStoreContext.ts
CHANGED
|
@@ -3,58 +3,60 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { ITelemetryBaseLogger, IDisposable, IEvent, IEventProvider } from "@fluidframework/common-definitions";
|
|
7
6
|
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
ITelemetryBaseLogger,
|
|
8
|
+
IDisposable,
|
|
9
|
+
IEvent,
|
|
10
|
+
IEventProvider,
|
|
11
|
+
} from "@fluidframework/common-definitions";
|
|
12
|
+
import {
|
|
13
|
+
IFluidRouter,
|
|
14
|
+
IProvideFluidHandleContext,
|
|
15
|
+
IFluidHandle,
|
|
16
|
+
IRequest,
|
|
17
|
+
IResponse,
|
|
18
|
+
FluidObject,
|
|
14
19
|
} from "@fluidframework/core-interfaces";
|
|
15
20
|
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
21
|
+
IAudience,
|
|
22
|
+
IDeltaManager,
|
|
23
|
+
AttachState,
|
|
24
|
+
ILoaderOptions,
|
|
20
25
|
} from "@fluidframework/container-definitions";
|
|
21
26
|
import { IDocumentStorageService } from "@fluidframework/driver-definitions";
|
|
22
27
|
import {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
IClientDetails,
|
|
29
|
+
IDocumentMessage,
|
|
30
|
+
IQuorumClients,
|
|
31
|
+
ISequencedDocumentMessage,
|
|
32
|
+
ISnapshotTree,
|
|
28
33
|
} from "@fluidframework/protocol-definitions";
|
|
29
34
|
import { IProvideFluidDataStoreFactory } from "./dataStoreFactory";
|
|
30
35
|
import { IProvideFluidDataStoreRegistry } from "./dataStoreRegistry";
|
|
31
|
-
import {
|
|
32
|
-
IGarbageCollectionData,
|
|
33
|
-
IGarbageCollectionDetailsBase,
|
|
34
|
-
} from "./garbageCollection";
|
|
36
|
+
import { IGarbageCollectionData, IGarbageCollectionDetailsBase } from "./garbageCollection";
|
|
35
37
|
import { IInboundSignalMessage } from "./protocol";
|
|
36
38
|
import {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
CreateChildSummarizerNodeParam,
|
|
40
|
+
ISummarizerNodeWithGC,
|
|
41
|
+
ISummaryTreeWithStats,
|
|
42
|
+
ITelemetryContext,
|
|
43
|
+
SummarizeInternalFn,
|
|
42
44
|
} from "./summary";
|
|
43
45
|
|
|
44
46
|
/**
|
|
45
47
|
* Runtime flush mode handling
|
|
46
48
|
*/
|
|
47
49
|
export enum FlushMode {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
50
|
+
/**
|
|
51
|
+
* In Immediate flush mode the runtime will immediately send all operations to the driver layer.
|
|
52
|
+
*/
|
|
53
|
+
Immediate,
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* When in TurnBased flush mode the runtime will buffer operations in the current turn and send them as a single
|
|
57
|
+
* batch at the end of the turn. The flush call on the runtime can be used to force send the current batch.
|
|
58
|
+
*/
|
|
59
|
+
TurnBased,
|
|
58
60
|
}
|
|
59
61
|
|
|
60
62
|
/**
|
|
@@ -62,40 +64,40 @@ export enum FlushMode {
|
|
|
62
64
|
* locally within the container only or visible globally to all clients.
|
|
63
65
|
*/
|
|
64
66
|
export const VisibilityState = {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
67
|
+
/**
|
|
68
|
+
* Indicates that the object is not visible. This is the state when an object is first created.
|
|
69
|
+
*/
|
|
70
|
+
NotVisible: "NotVisible",
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Indicates that the object is visible locally within the container. This is the state when an object is attached
|
|
74
|
+
* to the container's graph but the container itself isn't globally visible. The object's state goes from not
|
|
75
|
+
* visible to locally visible.
|
|
76
|
+
*/
|
|
77
|
+
LocallyVisible: "LocallyVisible",
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Indicates that the object is visible globally to all clients. This is the state of an object in 2 scenarios:
|
|
81
|
+
*
|
|
82
|
+
* 1. It is attached to the container's graph when the container is globally visible. The object's state goes from
|
|
83
|
+
* not visible to globally visible.
|
|
84
|
+
*
|
|
85
|
+
* 2. When a container becomes globally visible, all locally visible objects go from locally visible to globally
|
|
86
|
+
* visible.
|
|
87
|
+
*/
|
|
88
|
+
GloballyVisible: "GloballyVisible",
|
|
87
89
|
};
|
|
88
90
|
export type VisibilityState = typeof VisibilityState[keyof typeof VisibilityState];
|
|
89
91
|
|
|
90
92
|
export interface IContainerRuntimeBaseEvents extends IEvent {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
93
|
+
(event: "batchBegin", listener: (op: ISequencedDocumentMessage) => void);
|
|
94
|
+
/**
|
|
95
|
+
* @param runtimeMessage - tells if op is runtime op. If it is, it was unpacked, i.e. it's type and content
|
|
96
|
+
* represent internal container runtime type / content.
|
|
97
|
+
*/
|
|
98
|
+
(event: "op", listener: (op: ISequencedDocumentMessage, runtimeMessage?: boolean) => void);
|
|
99
|
+
(event: "batchEnd", listener: (error: any, op: ISequencedDocumentMessage) => void);
|
|
100
|
+
(event: "signal", listener: (message: IInboundSignalMessage, local: boolean) => void);
|
|
99
101
|
}
|
|
100
102
|
|
|
101
103
|
/**
|
|
@@ -116,109 +118,108 @@ export type AliasResult = "Success" | "Conflict" | "AlreadyAliased";
|
|
|
116
118
|
* - Can be assigned an alias
|
|
117
119
|
*/
|
|
118
120
|
export interface IDataStore extends IFluidRouter {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
121
|
+
/**
|
|
122
|
+
* Attempt to assign an alias to the datastore.
|
|
123
|
+
* If the operation succeeds, the datastore can be referenced
|
|
124
|
+
* by the supplied alias and will not be garbage collected.
|
|
125
|
+
*
|
|
126
|
+
* @param alias - Given alias for this datastore.
|
|
127
|
+
*/
|
|
128
|
+
trySetAlias(alias: string): Promise<AliasResult>;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Exposes a handle to the root object / entryPoint of the data store. Use this as the primary way of interacting
|
|
132
|
+
* with it. If this property is undefined (meaning that exposing the entryPoint hasn't been implemented in a
|
|
133
|
+
* particular scenario) fall back to the current approach of requesting the root object through the request pattern.
|
|
134
|
+
*
|
|
135
|
+
* @remarks The plan is that eventually the data store will stop providing IFluidRouter functionality, this property
|
|
136
|
+
* will become non-optional and return an IFluidHandle (no undefined) and will become the only way to access
|
|
137
|
+
* the data store's entryPoint.
|
|
138
|
+
*/
|
|
139
|
+
readonly entryPoint?: IFluidHandle<FluidObject>;
|
|
138
140
|
}
|
|
139
141
|
|
|
140
142
|
/**
|
|
141
143
|
* A reduced set of functionality of IContainerRuntime that a data store context/data store runtime will need
|
|
142
144
|
* TODO: this should be merged into IFluidDataStoreContext
|
|
143
145
|
*/
|
|
144
|
-
export interface IContainerRuntimeBase
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
getAudience(): IAudience;
|
|
146
|
+
export interface IContainerRuntimeBase
|
|
147
|
+
extends IEventProvider<IContainerRuntimeBaseEvents>,
|
|
148
|
+
IProvideFluidHandleContext {
|
|
149
|
+
readonly logger: ITelemetryBaseLogger;
|
|
150
|
+
readonly clientDetails: IClientDetails;
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Invokes the given callback and guarantees that all operations generated within the callback will be ordered
|
|
154
|
+
* sequentially. Total size of all messages must be less than maxOpSize.
|
|
155
|
+
*/
|
|
156
|
+
orderSequentially(callback: () => void): void;
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Executes a request against the container runtime
|
|
160
|
+
*/
|
|
161
|
+
request(request: IRequest): Promise<IResponse>;
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Submits a container runtime level signal to be sent to other clients.
|
|
165
|
+
* @param type - Type of the signal.
|
|
166
|
+
* @param content - Content of the signal.
|
|
167
|
+
*/
|
|
168
|
+
submitSignal(type: string, content: any): void;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* @deprecated 0.16 Issue #1537, #3631
|
|
172
|
+
* @internal
|
|
173
|
+
*/
|
|
174
|
+
_createDataStoreWithProps(
|
|
175
|
+
pkg: string | string[],
|
|
176
|
+
props?: any,
|
|
177
|
+
id?: string,
|
|
178
|
+
): Promise<IDataStore>;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Creates a data store and returns an object that exposes a handle to the data store's entryPoint, and also serves
|
|
182
|
+
* as the data store's router. The data store is not bound to a container, and in such state is not persisted to
|
|
183
|
+
* storage (file). Storing the entryPoint handle (or any other handle inside the data store, e.g. for DDS) into an
|
|
184
|
+
* already attached DDS (or non-attached DDS that will eventually get attached to storage) will result in this
|
|
185
|
+
* store being attached to storage.
|
|
186
|
+
* @param pkg - Package name of the data store factory
|
|
187
|
+
*/
|
|
188
|
+
createDataStore(pkg: string | string[]): Promise<IDataStore>;
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Creates detached data store context. Only after context.attachRuntime() is called,
|
|
192
|
+
* data store initialization is considered complete.
|
|
193
|
+
*/
|
|
194
|
+
createDetachedDataStore(pkg: Readonly<string[]>): IFluidDataStoreContextDetached;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Get an absolute url for a provided container-relative request.
|
|
198
|
+
* Returns undefined if the container or data store isn't attached to storage.
|
|
199
|
+
* @param relativeUrl - A relative request within the container
|
|
200
|
+
*/
|
|
201
|
+
getAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;
|
|
202
|
+
|
|
203
|
+
uploadBlob(blob: ArrayBufferLike): Promise<IFluidHandle<ArrayBufferLike>>;
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Returns the current quorum.
|
|
207
|
+
*/
|
|
208
|
+
getQuorum(): IQuorumClients;
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Returns the current audience.
|
|
212
|
+
*/
|
|
213
|
+
getAudience(): IAudience;
|
|
213
214
|
}
|
|
214
215
|
|
|
215
216
|
/**
|
|
216
217
|
* @deprecated Used only in deprecated API bindToContext
|
|
217
218
|
*/
|
|
218
219
|
export enum BindState {
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
220
|
+
NotBound = "NotBound",
|
|
221
|
+
Binding = "Binding",
|
|
222
|
+
Bound = "Bound",
|
|
222
223
|
}
|
|
223
224
|
|
|
224
225
|
/**
|
|
@@ -227,270 +228,267 @@ export enum BindState {
|
|
|
227
228
|
* Functionality include attach, snapshot, op/signal processing, request routes, expose an entryPoint,
|
|
228
229
|
* and connection state notifications
|
|
229
230
|
*/
|
|
230
|
-
export interface IFluidDataStoreChannel extends
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
* the component's entryPoint.
|
|
331
|
-
*/
|
|
332
|
-
readonly entryPoint?: IFluidHandle<FluidObject>;
|
|
231
|
+
export interface IFluidDataStoreChannel extends IFluidRouter, IDisposable {
|
|
232
|
+
readonly id: string;
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Indicates the attachment state of the channel to a host service.
|
|
236
|
+
*/
|
|
237
|
+
readonly attachState: AttachState;
|
|
238
|
+
|
|
239
|
+
readonly visibilityState?: VisibilityState;
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Runs through the graph and attaches the bound handles. Then binds this runtime to the container.
|
|
243
|
+
* @deprecated This will be removed in favor of {@link IFluidDataStoreChannel.makeVisibleAndAttachGraph}.
|
|
244
|
+
*/
|
|
245
|
+
attachGraph(): void;
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Makes the data store channel visible in the container. Also, runs through its graph and attaches all
|
|
249
|
+
* bound handles that represent its dependencies in the container's graph.
|
|
250
|
+
*/
|
|
251
|
+
makeVisibleAndAttachGraph(): void;
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Retrieves the summary used as part of the initial summary message
|
|
255
|
+
*/
|
|
256
|
+
getAttachSummary(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Processes the op.
|
|
260
|
+
*/
|
|
261
|
+
process(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Processes the signal.
|
|
265
|
+
*/
|
|
266
|
+
processSignal(message: any, local: boolean): void;
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Generates a summary for the channel.
|
|
270
|
+
* Introduced with summarizerNode - will be required in a future release.
|
|
271
|
+
* @param fullTree - true to bypass optimizations and force a full summary tree.
|
|
272
|
+
* @param trackState - This tells whether we should track state from this summary.
|
|
273
|
+
* @param telemetryContext - summary data passed through the layers for telemetry purposes
|
|
274
|
+
*/
|
|
275
|
+
summarize(
|
|
276
|
+
fullTree?: boolean,
|
|
277
|
+
trackState?: boolean,
|
|
278
|
+
telemetryContext?: ITelemetryContext,
|
|
279
|
+
): Promise<ISummaryTreeWithStats>;
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Returns the data used for garbage collection. This includes a list of GC nodes that represent this context
|
|
283
|
+
* including any of its children. Each node has a list of outbound routes to other GC nodes in the document.
|
|
284
|
+
* @param fullGC - true to bypass optimizations and force full generation of GC data.
|
|
285
|
+
*/
|
|
286
|
+
getGCData(fullGC?: boolean): Promise<IGarbageCollectionData>;
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* After GC has run, called to notify this channel of routes that are used in it.
|
|
290
|
+
* @param usedRoutes - The routes that are used in this channel.
|
|
291
|
+
*/
|
|
292
|
+
updateUsedRoutes(usedRoutes: string[]): void;
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Notifies this object about changes in the connection state.
|
|
296
|
+
* @param value - New connection state.
|
|
297
|
+
* @param clientId - ID of the client. It's old ID when in disconnected state and
|
|
298
|
+
* it's new client ID when we are connecting or connected.
|
|
299
|
+
*/
|
|
300
|
+
setConnectionState(connected: boolean, clientId?: string);
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* Ask the DDS to resubmit a message. This could be because we reconnected and this message was not acked.
|
|
304
|
+
* @param type - The type of the original message.
|
|
305
|
+
* @param content - The content of the original message.
|
|
306
|
+
* @param localOpMetadata - The local metadata associated with the original message.
|
|
307
|
+
*/
|
|
308
|
+
reSubmit(type: string, content: any, localOpMetadata: unknown);
|
|
309
|
+
|
|
310
|
+
applyStashedOp(content: any): Promise<unknown>;
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Revert a local message.
|
|
314
|
+
* @param type - The type of the original message.
|
|
315
|
+
* @param content - The content of the original message.
|
|
316
|
+
* @param localOpMetadata - The local metadata associated with the original message.
|
|
317
|
+
*/
|
|
318
|
+
rollback?(type: string, content: any, localOpMetadata: unknown): void;
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Exposes a handle to the root object / entryPoint of the component. Use this as the primary way of interacting
|
|
322
|
+
* with the component. If this property is undefined (meaning that exposing the entryPoint hasn't been implemented
|
|
323
|
+
* in a particular scenario) fall back to the current approach of requesting the root object through the request
|
|
324
|
+
* pattern.
|
|
325
|
+
*
|
|
326
|
+
* @remarks The plan is that eventually the component will stop providing IFluidRouter functionality, this property
|
|
327
|
+
* will become non-optional and return an IFluidHandle (no undefined) and will become the only way to access
|
|
328
|
+
* the component's entryPoint.
|
|
329
|
+
*/
|
|
330
|
+
readonly entryPoint?: IFluidHandle<FluidObject>;
|
|
333
331
|
}
|
|
334
332
|
|
|
335
333
|
export type CreateChildSummarizerNodeFn = (
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
334
|
+
summarizeInternal: SummarizeInternalFn,
|
|
335
|
+
getGCDataFn: (fullGC?: boolean) => Promise<IGarbageCollectionData>,
|
|
336
|
+
/**
|
|
337
|
+
* @deprecated - The functionality to get base GC details has been moved to summarizer node.
|
|
338
|
+
*/
|
|
339
|
+
getBaseGCDetailsFn?: () => Promise<IGarbageCollectionDetailsBase>,
|
|
342
340
|
) => ISummarizerNodeWithGC;
|
|
343
341
|
|
|
344
342
|
export interface IFluidDataStoreContextEvents extends IEvent {
|
|
345
|
-
|
|
343
|
+
(event: "attaching" | "attached", listener: () => void);
|
|
346
344
|
}
|
|
347
345
|
|
|
348
346
|
/**
|
|
349
347
|
* Represents the context for the data store. It is used by the data store runtime to
|
|
350
348
|
* get information and call functionality to the container.
|
|
351
349
|
*/
|
|
352
|
-
export interface IFluidDataStoreContext
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
350
|
+
export interface IFluidDataStoreContext
|
|
351
|
+
extends IEventProvider<IFluidDataStoreContextEvents>,
|
|
352
|
+
Partial<IProvideFluidDataStoreRegistry>,
|
|
353
|
+
IProvideFluidHandleContext {
|
|
354
|
+
readonly id: string;
|
|
355
|
+
/**
|
|
356
|
+
* A data store created by a client, is a local data store for that client. Also, when a detached container loads
|
|
357
|
+
* from a snapshot, all the data stores are treated as local data stores because at that stage the container
|
|
358
|
+
* still doesn't exists in storage and so the data store couldn't have been created by any other client.
|
|
359
|
+
* Value of this never changes even after the data store is attached.
|
|
360
|
+
* As implementer of data store runtime, you can use this property to check that this data store belongs to this
|
|
361
|
+
* client and hence implement any scenario based on that.
|
|
362
|
+
*/
|
|
363
|
+
readonly isLocalDataStore: boolean;
|
|
364
|
+
/**
|
|
365
|
+
* The package path of the data store as per the package factory.
|
|
366
|
+
*/
|
|
367
|
+
readonly packagePath: readonly string[];
|
|
368
|
+
readonly options: ILoaderOptions;
|
|
369
|
+
readonly clientId: string | undefined;
|
|
370
|
+
readonly connected: boolean;
|
|
371
|
+
readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
|
|
372
|
+
readonly storage: IDocumentStorageService;
|
|
373
|
+
readonly baseSnapshot: ISnapshotTree | undefined;
|
|
374
|
+
readonly logger: ITelemetryBaseLogger;
|
|
375
|
+
readonly clientDetails: IClientDetails;
|
|
376
|
+
/**
|
|
377
|
+
* Indicates the attachment state of the data store to a host service.
|
|
378
|
+
*/
|
|
379
|
+
readonly attachState: AttachState;
|
|
380
|
+
|
|
381
|
+
readonly containerRuntime: IContainerRuntimeBase;
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* @deprecated 0.16 Issue #1635, #3631
|
|
385
|
+
*/
|
|
386
|
+
readonly createProps?: any;
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* Ambient services provided with the context
|
|
390
|
+
*/
|
|
391
|
+
readonly scope: FluidObject;
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* Returns the current quorum.
|
|
395
|
+
*/
|
|
396
|
+
getQuorum(): IQuorumClients;
|
|
397
|
+
|
|
398
|
+
/**
|
|
399
|
+
* Returns the current audience.
|
|
400
|
+
*/
|
|
401
|
+
getAudience(): IAudience;
|
|
402
|
+
|
|
403
|
+
/**
|
|
404
|
+
* Invokes the given callback and expects that no ops are submitted
|
|
405
|
+
* until execution finishes. If an op is submitted, an error will be raised.
|
|
406
|
+
*
|
|
407
|
+
* Can be disabled by feature gate `Fluid.ContainerRuntime.DisableOpReentryCheck`
|
|
408
|
+
*
|
|
409
|
+
* @param callback - the callback to be invoked
|
|
410
|
+
*/
|
|
411
|
+
ensureNoDataModelChanges<T>(callback: () => T): T;
|
|
412
|
+
|
|
413
|
+
/**
|
|
414
|
+
* Submits the message to be sent to other clients.
|
|
415
|
+
* @param type - Type of the message.
|
|
416
|
+
* @param content - Content of the message.
|
|
417
|
+
* @param localOpMetadata - The local metadata associated with the message. This is kept locally and not sent to
|
|
418
|
+
* the server. This will be sent back when this message is received back from the server. This is also sent if
|
|
419
|
+
* we are asked to resubmit the message.
|
|
420
|
+
*/
|
|
421
|
+
submitMessage(type: string, content: any, localOpMetadata: unknown): void;
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* Submits the signal to be sent to other clients.
|
|
425
|
+
* @param type - Type of the signal.
|
|
426
|
+
* @param content - Content of the signal.
|
|
427
|
+
*/
|
|
428
|
+
submitSignal(type: string, content: any): void;
|
|
429
|
+
|
|
430
|
+
/**
|
|
431
|
+
* @deprecated To be removed in favor of makeVisible.
|
|
432
|
+
* Register the runtime to the container
|
|
433
|
+
*/
|
|
434
|
+
bindToContext(): void;
|
|
435
|
+
|
|
436
|
+
/**
|
|
437
|
+
* Called to make the data store locally visible in the container. This happens automatically for root data stores
|
|
438
|
+
* when they are marked as root. For non-root data stores, this happens when their handle is added to a visible DDS.
|
|
439
|
+
*/
|
|
440
|
+
makeLocallyVisible(): void;
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* Call by IFluidDataStoreChannel, indicates that a channel is dirty and needs to be part of the summary.
|
|
444
|
+
* @param address - The address of the channel that is dirty.
|
|
445
|
+
*/
|
|
446
|
+
setChannelDirty(address: string): void;
|
|
447
|
+
|
|
448
|
+
/**
|
|
449
|
+
* Get an absolute url to the container based on the provided relativeUrl.
|
|
450
|
+
* Returns undefined if the container or data store isn't attached to storage.
|
|
451
|
+
* @param relativeUrl - A relative request within the container
|
|
452
|
+
*/
|
|
453
|
+
getAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;
|
|
454
|
+
|
|
455
|
+
getCreateChildSummarizerNodeFn(
|
|
456
|
+
/**
|
|
457
|
+
* Initial id or path part of this node
|
|
458
|
+
*/
|
|
459
|
+
id: string,
|
|
460
|
+
/**
|
|
461
|
+
* Information needed to create the node.
|
|
462
|
+
* If it is from a base summary, it will assert that a summary has been seen.
|
|
463
|
+
* Attach information if it is created from an attach op.
|
|
464
|
+
* If it is local, it will throw unsupported errors on calls to summarize.
|
|
465
|
+
*/
|
|
466
|
+
createParam: CreateChildSummarizerNodeParam,
|
|
467
|
+
): CreateChildSummarizerNodeFn;
|
|
468
|
+
|
|
469
|
+
uploadBlob(blob: ArrayBufferLike): Promise<IFluidHandle<ArrayBufferLike>>;
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* Returns the GC details in the initial summary of this data store. This is used to initialize the data store
|
|
473
|
+
* and its children with the GC details from the previous summary.
|
|
474
|
+
*/
|
|
475
|
+
getBaseGCDetails(): Promise<IGarbageCollectionDetailsBase>;
|
|
476
|
+
|
|
477
|
+
/**
|
|
478
|
+
* Called when a new outbound reference is added to another node. This is used by garbage collection to identify
|
|
479
|
+
* all references added in the system.
|
|
480
|
+
* @param srcHandle - The handle of the node that added the reference.
|
|
481
|
+
* @param outboundHandle - The handle of the outbound node that is referenced.
|
|
482
|
+
*/
|
|
483
|
+
addedGCOutboundReference?(srcHandle: IFluidHandle, outboundHandle: IFluidHandle): void;
|
|
486
484
|
}
|
|
487
485
|
|
|
488
486
|
export interface IFluidDataStoreContextDetached extends IFluidDataStoreContext {
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
487
|
+
/**
|
|
488
|
+
* Binds a runtime to the context.
|
|
489
|
+
*/
|
|
490
|
+
attachRuntime(
|
|
491
|
+
factory: IProvideFluidDataStoreFactory,
|
|
492
|
+
dataStoreRuntime: IFluidDataStoreChannel,
|
|
493
|
+
): Promise<void>;
|
|
496
494
|
}
|