@fluidframework/datastore 2.0.0-dev.7.4.0.215747 → 2.0.0-dev.7.4.0.216897

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.
@@ -1,342 +1,64 @@
1
- import { AttachState } from '@fluidframework/container-definitions';
2
- import { FluidObject } from '@fluidframework/core-interfaces';
3
- import { IAudience } from '@fluidframework/container-definitions';
4
- import { IChannel } from '@fluidframework/datastore-definitions';
5
- import { IChannelFactory } from '@fluidframework/datastore-definitions';
6
1
  import { IClientDetails } from '@fluidframework/protocol-definitions';
7
- import { IDeltaManager } from '@fluidframework/container-definitions';
8
2
  import { IDocumentMessage } from '@fluidframework/protocol-definitions';
9
- import { IFluidDataStoreChannel } from '@fluidframework/runtime-definitions';
10
- import { IFluidDataStoreContext } from '@fluidframework/runtime-definitions';
11
- import { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions';
12
- import { IFluidDataStoreRuntimeEvents } from '@fluidframework/datastore-definitions';
13
- import { IFluidHandle } from '@fluidframework/core-interfaces';
14
- import { IFluidHandleContext } from '@fluidframework/core-interfaces';
15
- import { IGarbageCollectionData } from '@fluidframework/runtime-definitions';
16
- import { IIdCompressor } from '@fluidframework/runtime-definitions';
17
- import { IInboundSignalMessage } from '@fluidframework/runtime-definitions';
18
- import { ILoaderOptions } from '@fluidframework/container-definitions';
19
3
  import { IQuorumClients } from '@fluidframework/protocol-definitions';
20
- import { IRequest } from '@fluidframework/core-interfaces';
21
- import { IResponse } from '@fluidframework/core-interfaces';
22
4
  import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
23
- import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
24
- import { ITelemetryContext } from '@fluidframework/runtime-definitions';
25
- import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
26
- import { VisibilityState } from '@fluidframework/runtime-definitions';
27
5
 
28
- /**
29
- * @public
30
- */
31
- export declare enum DataStoreMessageType {
32
- Attach = "attach",
33
- ChannelOp = "op"
34
- }
6
+ /* Excluded from this release type: AttachState */
35
7
 
36
- /**
37
- * Base data store class
38
- *
39
- * @public
40
- */
41
- export declare class FluidDataStoreRuntime extends TypedEventEmitter<IFluidDataStoreRuntimeEvents> implements IFluidDataStoreChannel, IFluidDataStoreRuntime, IFluidHandleContext {
42
- private readonly dataStoreContext;
43
- private readonly sharedObjectRegistry;
44
- /**
45
- * @deprecated Instantiate the class using its constructor instead.
46
- *
47
- * Loads the data store runtime
48
- * @param context - The data store context
49
- * @param sharedObjectRegistry - The registry of shared objects used by this data store
50
- * @param existing - If loading from an existing file.
51
- */
52
- static load(context: IFluidDataStoreContext, sharedObjectRegistry: ISharedObjectRegistry, existing: boolean): FluidDataStoreRuntime;
53
- /**
54
- * {@inheritDoc @fluidframework/datastore-definitions#IFluidDataStoreRuntime.entryPoint}
55
- */
56
- readonly entryPoint: IFluidHandle<FluidObject>;
57
- /**
58
- * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
59
- */
60
- get IFluidRouter(): this;
61
- get connected(): boolean;
62
- get clientId(): string | undefined;
63
- get clientDetails(): IClientDetails;
64
- get isAttached(): boolean;
65
- get attachState(): AttachState;
66
- get absolutePath(): string;
67
- get routeContext(): IFluidHandleContext;
68
- get idCompressor(): IIdCompressor | undefined;
69
- get IFluidHandleContext(): this;
70
- get rootRoutingContext(): this;
71
- get channelsRoutingContext(): this;
72
- get objectsRoutingContext(): this;
73
- private _disposed;
74
- get disposed(): boolean;
75
- private readonly contexts;
76
- private readonly pendingAttach;
77
- private readonly deferredAttached;
78
- private readonly localChannelContextQueue;
79
- private readonly notBoundedChannelContextSet;
80
- private _attachState;
81
- visibilityState: VisibilityState;
82
- private readonly pendingHandlesToMakeVisible;
83
- readonly id: string;
84
- readonly options: ILoaderOptions;
85
- readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
86
- private readonly quorum;
87
- private readonly audience;
88
- private readonly mc;
89
- get logger(): ITelemetryLoggerExt;
90
- /**
91
- * If the summarizer makes local changes, a telemetry event is logged. This has the potential to be very noisy.
92
- * So, adding a count of how many telemetry events are logged per data store context. This can be
93
- * controlled via feature flags.
94
- */
95
- private localChangesTelemetryCount;
96
- /**
97
- * Invokes the given callback and expects that no ops are submitted
98
- * until execution finishes. If an op is submitted, an error will be raised.
99
- *
100
- * Can be disabled by feature gate `Fluid.ContainerRuntime.DisableOpReentryCheck`
101
- *
102
- * @param callback - the callback to be invoked
103
- */
104
- ensureNoDataModelChanges<T>(callback: () => T): T;
105
- /**
106
- * Create an instance of a DataStore runtime.
107
- *
108
- * @param dataStoreContext - Context object for the runtime.
109
- * @param sharedObjectRegistry - The registry of shared objects that this data store will be able to instantiate.
110
- * @param existing - Pass 'true' if loading this datastore from an existing file; pass 'false' otherwise.
111
- * @param provideEntryPoint - Function to initialize the entryPoint object for the data store runtime. The
112
- * handle to this data store runtime will point to the object returned by this function. If this function is not
113
- * provided, the handle will be left undefined. This is here so we can start making handles a first-class citizen
114
- * and the primary way of interacting with some Fluid objects, and should be used if possible.
115
- */
116
- constructor(dataStoreContext: IFluidDataStoreContext, sharedObjectRegistry: ISharedObjectRegistry, existing: boolean, provideEntryPoint: (runtime: IFluidDataStoreRuntime) => Promise<FluidObject>);
117
- dispose(): void;
118
- resolveHandle(request: IRequest): Promise<IResponse>;
119
- request(request: IRequest): Promise<IResponse>;
120
- getChannel(id: string): Promise<IChannel>;
121
- /**
122
- * Api which allows caller to create the channel first and then add it to the runtime.
123
- * The channel type should be present in the registry, otherwise the runtime would reject
124
- * the channel. Also the runtime used to create the channel object should be same to which
125
- * it is added.
126
- * @param channel - channel which needs to be added to the runtime.
127
- */
128
- addChannel(channel: IChannel): void;
129
- createChannel(id: string | undefined, type: string): IChannel;
130
- private createChannelContext;
131
- /**
132
- * Binds a channel with the runtime. If the runtime is attached we will attach the channel right away.
133
- * If the runtime is not attached we will defer the attach until the runtime attaches.
134
- * @param channel - channel to be registered.
135
- */
136
- bindChannel(channel: IChannel): void;
137
- /**
138
- * This function is called when a data store becomes root. It does the following:
139
- *
140
- * 1. Marks the data store locally visible in the container.
141
- *
142
- * 2. Attaches the graph of all the handles bound to it.
143
- *
144
- * 3. Calls into the data store context to mark it visible in the container too. If the container is globally
145
- * visible, it will mark us globally visible. Otherwise, it will mark us globally visible when it becomes
146
- * globally visible.
147
- */
148
- makeVisibleAndAttachGraph(): void;
149
- /**
150
- * This function is called when a handle to this data store is added to a visible DDS.
151
- */
152
- attachGraph(): void;
153
- bind(handle: IFluidHandle): void;
154
- setConnectionState(connected: boolean, clientId?: string): void;
155
- getQuorum(): IQuorumClients;
156
- getAudience(): IAudience;
157
- uploadBlob(blob: ArrayBufferLike, signal?: AbortSignal): Promise<IFluidHandle<ArrayBufferLike>>;
158
- private createRemoteChannelContext;
159
- process(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;
160
- processSignal(message: IInboundSignalMessage, local: boolean): void;
161
- private isChannelAttached;
162
- /**
163
- * Returns the outbound routes of this channel. Currently, all contexts in this channel are considered
164
- * referenced and are hence outbound. This will change when we have root and non-root channel contexts.
165
- * The only root contexts will be considered as referenced.
166
- */
167
- private getOutboundRoutes;
168
- /**
169
- * Updates the GC nodes of this channel. It does the following:
170
- * - Adds a back route to self to all its child GC nodes.
171
- * - Adds a node for this channel.
172
- * @param builder - The builder that contains the GC nodes for this channel's children.
173
- */
174
- private updateGCNodes;
175
- /**
176
- * Generates data used for garbage collection. This includes a list of GC nodes that represent this channel
177
- * including any of its child channel contexts. Each node has a set of outbound routes to other GC nodes in the
178
- * document. It does the following:
179
- *
180
- * 1. Calls into each child context to get its GC data.
181
- *
182
- * 2. Prefixes the child context's id to the GC nodes in the child's GC data. This makes sure that the node can be
183
- * identified as belonging to the child.
184
- *
185
- * 3. Adds a GC node for this channel to the nodes received from the children. All these nodes together represent
186
- * the GC data of this channel.
187
- *
188
- * @param fullGC - true to bypass optimizations and force full generation of GC data.
189
- */
190
- getGCData(fullGC?: boolean): Promise<IGarbageCollectionData>;
191
- /**
192
- * After GC has run, called to notify this channel of routes that are used in it. It calls the child contexts to
193
- * update their used routes.
194
- * @param usedRoutes - The routes that are used in all contexts in this channel.
195
- */
196
- updateUsedRoutes(usedRoutes: string[]): void;
197
- /**
198
- * Called when a new outbound reference is added to another node. This is used by garbage collection to identify
199
- * all references added in the system.
200
- * @param srcHandle - The handle of the node that added the reference.
201
- * @param outboundHandle - The handle of the outbound node that is referenced.
202
- */
203
- private addedGCOutboundReference;
204
- /**
205
- * Returns a summary at the current sequence number.
206
- * @param fullTree - true to bypass optimizations and force a full summary tree
207
- * @param trackState - This tells whether we should track state from this summary.
208
- * @param telemetryContext - summary data passed through the layers for telemetry purposes
209
- */
210
- summarize(fullTree?: boolean, trackState?: boolean, telemetryContext?: ITelemetryContext): Promise<ISummaryTreeWithStats>;
211
- getAttachSummary(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;
212
- submitMessage(type: DataStoreMessageType, content: any, localOpMetadata: unknown): void;
213
- /**
214
- * Submits the signal to be sent to other clients.
215
- * @param type - Type of the signal.
216
- * @param content - Content of the signal.
217
- * @param targetClientId - When specified, the signal is only sent to the provided client id.
218
- */
219
- submitSignal(type: string, content: any, targetClientId?: string): void;
220
- /**
221
- * Will return when the data store is attached.
222
- */
223
- waitAttached(): Promise<void>;
224
- /**
225
- * Attach channel should only be called after the data store has been attached
226
- */
227
- private attachChannel;
228
- private submitChannelOp;
229
- private submit;
230
- /**
231
- * For messages of type MessageType.Operation, finds the right channel and asks it to resubmit the message.
232
- * For all other messages, just submit it again.
233
- * This typically happens when we reconnect and there are unacked messages.
234
- * @param content - The content of the original message.
235
- * @param localOpMetadata - The local metadata associated with the original message.
236
- */
237
- reSubmit(type: DataStoreMessageType, content: any, localOpMetadata: unknown): void;
238
- /**
239
- * Revert a local op.
240
- * @param content - The content of the original message.
241
- * @param localOpMetadata - The local metadata associated with the original message.
242
- */
243
- rollback?(type: DataStoreMessageType, content: any, localOpMetadata: unknown): void;
244
- applyStashedOp(content: any): Promise<unknown>;
245
- private setChannelDirty;
246
- private processChannelOp;
247
- private attachListener;
248
- private verifyNotClosed;
249
- /**
250
- * Summarizer client should not have local changes. These changes can become part of the summary and can break
251
- * eventual consistency. For example, the next summary (say at ref seq# 100) may contain these changes whereas
252
- * other clients that are up-to-date till seq# 100 may not have them yet.
253
- */
254
- private identifyLocalChangeInSummarizer;
255
- }
8
+ /* Excluded from this release type: DataStoreMessageType */
256
9
 
257
- /**
258
- * Handle for a shared {@link @fluidframework/core-interfaces#FluidObject}.
259
- *
260
- * @public
261
- */
262
- export declare class FluidObjectHandle<T extends FluidObject = FluidObject> implements IFluidHandle {
263
- protected readonly value: T | Promise<T>;
264
- readonly path: string;
265
- readonly routeContext: IFluidHandleContext;
266
- private readonly pendingHandlesToMakeVisible;
267
- /**
268
- * {@inheritDoc @fluidframework/core-interfaces#IFluidHandle.absolutePath}
269
- */
270
- readonly absolutePath: string;
271
- /**
272
- * {@inheritDoc @fluidframework/core-interfaces#IProvideFluidHandle.IFluidHandle}
273
- */
274
- get IFluidHandle(): IFluidHandle;
275
- /**
276
- * {@inheritDoc @fluidframework/core-interfaces#IFluidHandle.isAttached}
277
- */
278
- get isAttached(): boolean;
279
- /**
280
- * Tells whether the object of this handle is visible in the container locally or globally.
281
- */
282
- private get visible();
283
- /**
284
- * Tracks whether this handle is locally visible in the container.
285
- */
286
- private locallyVisible;
287
- /**
288
- * Creates a new `FluidObjectHandle`.
289
- *
290
- * @param value - The {@link @fluidframework/core-interfaces#FluidObject} object this handle is for.
291
- * @param path - The path to this handle relative to the `routeContext`.
292
- * @param routeContext - The parent {@link @fluidframework/core-interfaces#IFluidHandleContext} that has a route
293
- * to this handle.
294
- */
295
- constructor(value: T | Promise<T>, path: string, routeContext: IFluidHandleContext);
296
- /**
297
- * {@inheritDoc @fluidframework/core-interfaces#IFluidHandle.get}
298
- */
299
- get(): Promise<any>;
300
- /**
301
- * {@inheritDoc @fluidframework/core-interfaces#IFluidHandle.attachGraph }
302
- */
303
- attachGraph(): void;
304
- /**
305
- * {@inheritDoc @fluidframework/core-interfaces#IFluidHandle.bind}
306
- */
307
- bind(handle: IFluidHandle): void;
308
- }
10
+ /* Excluded from this release type: FluidDataStoreRuntime */
309
11
 
310
- /**
311
- * @public
312
- */
313
- export declare interface ISharedObjectRegistry {
314
- get(name: string): IChannelFactory | undefined;
315
- }
12
+ /* Excluded from this release type: FluidObject */
316
13
 
317
- /**
318
- * Mixin class that adds request handler to FluidDataStoreRuntime
319
- * Request handler is only called when data store can't resolve request, i.e. for custom requests.
320
- * @param Base - base class, inherits from FluidDataStoreRuntime
321
- * @param requestHandler - request handler to mix in
322
- *
323
- * @public
324
- */
325
- export declare const mixinRequestHandler: (requestHandler: (request: IRequest, runtime: FluidDataStoreRuntime) => Promise<IResponse>, Base?: typeof FluidDataStoreRuntime) => typeof FluidDataStoreRuntime;
14
+ /* Excluded from this release type: FluidObjectHandle */
326
15
 
327
- /**
328
- * Mixin class that adds await for DataObject to finish initialization before we proceed to summary.
329
- * @param handler - handler that returns info about blob to be added to summary.
330
- * Or undefined not to add anything to summary.
331
- * @param Base - base class, inherits from FluidDataStoreRuntime
332
- *
333
- * @public
334
- */
335
- export declare const mixinSummaryHandler: (handler: (runtime: FluidDataStoreRuntime) => Promise<{
336
- path: string[];
337
- content: string;
338
- } | undefined>, Base?: typeof FluidDataStoreRuntime) => typeof FluidDataStoreRuntime;
16
+ /* Excluded from this release type: IAudience */
17
+
18
+ /* Excluded from this release type: IChannel */
19
+
20
+ /* Excluded from this release type: IChannelFactory */
21
+
22
+ /* Excluded from this release type: IDeltaManager */
23
+
24
+ /* Excluded from this release type: IFluidDataStoreChannel */
25
+
26
+ /* Excluded from this release type: IFluidDataStoreContext */
27
+
28
+ /* Excluded from this release type: IFluidDataStoreRuntime */
29
+
30
+ /* Excluded from this release type: IFluidDataStoreRuntimeEvents */
31
+
32
+ /* Excluded from this release type: IFluidHandle */
33
+
34
+ /* Excluded from this release type: IFluidHandleContext */
35
+
36
+ /* Excluded from this release type: IGarbageCollectionData */
37
+
38
+ /* Excluded from this release type: IIdCompressor */
39
+
40
+ /* Excluded from this release type: IInboundSignalMessage */
41
+
42
+ /* Excluded from this release type: ILoaderOptions */
43
+
44
+ /* Excluded from this release type: IRequest */
45
+
46
+ /* Excluded from this release type: IResponse */
47
+
48
+ /* Excluded from this release type: ISharedObjectRegistry */
49
+
50
+ /* Excluded from this release type: ISummaryTreeWithStats */
51
+
52
+ /* Excluded from this release type: ITelemetryContext */
53
+
54
+ /* Excluded from this release type: ITelemetryLoggerExt */
55
+
56
+ /* Excluded from this release type: mixinRequestHandler */
57
+
58
+ /* Excluded from this release type: mixinSummaryHandler */
339
59
 
340
60
  /* Excluded from this release type: TypedEventEmitter */
341
61
 
62
+ /* Excluded from this release type: VisibilityState */
63
+
342
64
  export { }