@fluidframework/datastore 2.0.0-internal.7.3.0 → 2.0.0-internal.8.0.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.
Files changed (40) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/api-extractor-lint.json +13 -0
  3. package/api-extractor.json +9 -1
  4. package/api-report/datastore.api.md +7 -10
  5. package/dist/dataStoreRuntime.d.ts +14 -21
  6. package/dist/dataStoreRuntime.d.ts.map +1 -1
  7. package/dist/dataStoreRuntime.js +40 -28
  8. package/dist/dataStoreRuntime.js.map +1 -1
  9. package/dist/datastore-alpha.d.ts +257 -0
  10. package/dist/datastore-beta.d.ts +87 -0
  11. package/dist/datastore-public.d.ts +87 -0
  12. package/dist/datastore-untrimmed.d.ts +324 -0
  13. package/dist/fluidHandle.d.ts +1 -2
  14. package/dist/fluidHandle.d.ts.map +1 -1
  15. package/dist/fluidHandle.js +1 -2
  16. package/dist/fluidHandle.js.map +1 -1
  17. package/dist/localChannelContext.d.ts +2 -2
  18. package/dist/localChannelContext.d.ts.map +1 -1
  19. package/dist/localChannelContext.js +13 -17
  20. package/dist/localChannelContext.js.map +1 -1
  21. package/lib/dataStoreRuntime.d.ts +14 -21
  22. package/lib/dataStoreRuntime.d.ts.map +1 -1
  23. package/lib/dataStoreRuntime.js +40 -28
  24. package/lib/dataStoreRuntime.js.map +1 -1
  25. package/lib/datastore-alpha.d.ts +257 -0
  26. package/lib/datastore-beta.d.ts +87 -0
  27. package/lib/datastore-public.d.ts +87 -0
  28. package/lib/datastore-untrimmed.d.ts +324 -0
  29. package/lib/fluidHandle.d.ts +1 -2
  30. package/lib/fluidHandle.d.ts.map +1 -1
  31. package/lib/fluidHandle.js +1 -2
  32. package/lib/fluidHandle.js.map +1 -1
  33. package/lib/localChannelContext.d.ts +2 -2
  34. package/lib/localChannelContext.d.ts.map +1 -1
  35. package/lib/localChannelContext.js +13 -17
  36. package/lib/localChannelContext.js.map +1 -1
  37. package/package.json +43 -19
  38. package/src/dataStoreRuntime.ts +53 -48
  39. package/src/fluidHandle.ts +1 -2
  40. package/src/localChannelContext.ts +14 -21
@@ -0,0 +1,87 @@
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
+ import { IClientDetails } from '@fluidframework/protocol-definitions';
7
+ import { IDeltaManager } from '@fluidframework/container-definitions';
8
+ 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
+ import { IQuorumClients } from '@fluidframework/protocol-definitions';
20
+ import { IRequest } from '@fluidframework/core-interfaces';
21
+ import { IResponse } from '@fluidframework/core-interfaces';
22
+ 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 { TypedEventEmitter } from '@fluid-internal/client-utils';
27
+ import { VisibilityState } from '@fluidframework/runtime-definitions';
28
+
29
+ /* Excluded from this release type: AttachState */
30
+
31
+ /* Excluded from this release type: DataStoreMessageType */
32
+
33
+ /* Excluded from this release type: FluidDataStoreRuntime */
34
+
35
+ /* Excluded from this release type: FluidObject */
36
+
37
+ /* Excluded from this release type: FluidObjectHandle */
38
+
39
+ /* Excluded from this release type: IAudience */
40
+
41
+ /* Excluded from this release type: IChannel */
42
+
43
+ /* Excluded from this release type: IChannelFactory */
44
+
45
+ /* Excluded from this release type: IDeltaManager */
46
+
47
+ /* Excluded from this release type: IFluidDataStoreChannel */
48
+
49
+ /* Excluded from this release type: IFluidDataStoreContext */
50
+
51
+ /* Excluded from this release type: IFluidDataStoreRuntime */
52
+
53
+ /* Excluded from this release type: IFluidDataStoreRuntimeEvents */
54
+
55
+ /* Excluded from this release type: IFluidHandle */
56
+
57
+ /* Excluded from this release type: IFluidHandleContext */
58
+
59
+ /* Excluded from this release type: IGarbageCollectionData */
60
+
61
+ /* Excluded from this release type: IIdCompressor */
62
+
63
+ /* Excluded from this release type: IInboundSignalMessage */
64
+
65
+ /* Excluded from this release type: ILoaderOptions */
66
+
67
+ /* Excluded from this release type: IRequest */
68
+
69
+ /* Excluded from this release type: IResponse */
70
+
71
+ /* Excluded from this release type: ISharedObjectRegistry */
72
+
73
+ /* Excluded from this release type: ISummaryTreeWithStats */
74
+
75
+ /* Excluded from this release type: ITelemetryContext */
76
+
77
+ /* Excluded from this release type: ITelemetryLoggerExt */
78
+
79
+ /* Excluded from this release type: mixinRequestHandler */
80
+
81
+ /* Excluded from this release type: mixinSummaryHandler */
82
+
83
+ /* Excluded from this release type: TypedEventEmitter */
84
+
85
+ /* Excluded from this release type: VisibilityState */
86
+
87
+ export { }
@@ -0,0 +1,87 @@
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
+ import { IClientDetails } from '@fluidframework/protocol-definitions';
7
+ import { IDeltaManager } from '@fluidframework/container-definitions';
8
+ 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
+ import { IQuorumClients } from '@fluidframework/protocol-definitions';
20
+ import { IRequest } from '@fluidframework/core-interfaces';
21
+ import { IResponse } from '@fluidframework/core-interfaces';
22
+ 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 { TypedEventEmitter } from '@fluid-internal/client-utils';
27
+ import { VisibilityState } from '@fluidframework/runtime-definitions';
28
+
29
+ /* Excluded from this release type: AttachState */
30
+
31
+ /* Excluded from this release type: DataStoreMessageType */
32
+
33
+ /* Excluded from this release type: FluidDataStoreRuntime */
34
+
35
+ /* Excluded from this release type: FluidObject */
36
+
37
+ /* Excluded from this release type: FluidObjectHandle */
38
+
39
+ /* Excluded from this release type: IAudience */
40
+
41
+ /* Excluded from this release type: IChannel */
42
+
43
+ /* Excluded from this release type: IChannelFactory */
44
+
45
+ /* Excluded from this release type: IDeltaManager */
46
+
47
+ /* Excluded from this release type: IFluidDataStoreChannel */
48
+
49
+ /* Excluded from this release type: IFluidDataStoreContext */
50
+
51
+ /* Excluded from this release type: IFluidDataStoreRuntime */
52
+
53
+ /* Excluded from this release type: IFluidDataStoreRuntimeEvents */
54
+
55
+ /* Excluded from this release type: IFluidHandle */
56
+
57
+ /* Excluded from this release type: IFluidHandleContext */
58
+
59
+ /* Excluded from this release type: IGarbageCollectionData */
60
+
61
+ /* Excluded from this release type: IIdCompressor */
62
+
63
+ /* Excluded from this release type: IInboundSignalMessage */
64
+
65
+ /* Excluded from this release type: ILoaderOptions */
66
+
67
+ /* Excluded from this release type: IRequest */
68
+
69
+ /* Excluded from this release type: IResponse */
70
+
71
+ /* Excluded from this release type: ISharedObjectRegistry */
72
+
73
+ /* Excluded from this release type: ISummaryTreeWithStats */
74
+
75
+ /* Excluded from this release type: ITelemetryContext */
76
+
77
+ /* Excluded from this release type: ITelemetryLoggerExt */
78
+
79
+ /* Excluded from this release type: mixinRequestHandler */
80
+
81
+ /* Excluded from this release type: mixinSummaryHandler */
82
+
83
+ /* Excluded from this release type: TypedEventEmitter */
84
+
85
+ /* Excluded from this release type: VisibilityState */
86
+
87
+ export { }
@@ -0,0 +1,324 @@
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
+ import { IClientDetails } from '@fluidframework/protocol-definitions';
7
+ import { IDeltaManager } from '@fluidframework/container-definitions';
8
+ 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
+ import { IQuorumClients } from '@fluidframework/protocol-definitions';
20
+ import { IRequest } from '@fluidframework/core-interfaces';
21
+ import { IResponse } from '@fluidframework/core-interfaces';
22
+ 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 { TypedEventEmitter } from '@fluid-internal/client-utils';
27
+ import { VisibilityState } from '@fluidframework/runtime-definitions';
28
+
29
+ /**
30
+ * @alpha
31
+ */
32
+ export declare enum DataStoreMessageType {
33
+ Attach = "attach",
34
+ ChannelOp = "op"
35
+ }
36
+
37
+ /**
38
+ * Base data store class
39
+ * @alpha
40
+ */
41
+ export declare class FluidDataStoreRuntime extends TypedEventEmitter<IFluidDataStoreRuntimeEvents> implements IFluidDataStoreChannel, IFluidDataStoreRuntime, IFluidHandleContext {
42
+ private readonly dataStoreContext;
43
+ private readonly sharedObjectRegistry;
44
+ /**
45
+ * {@inheritDoc @fluidframework/datastore-definitions#IFluidDataStoreRuntime.entryPoint}
46
+ */
47
+ readonly entryPoint: IFluidHandle<FluidObject>;
48
+ get connected(): boolean;
49
+ get clientId(): string | undefined;
50
+ get clientDetails(): IClientDetails;
51
+ get isAttached(): boolean;
52
+ get attachState(): AttachState;
53
+ get absolutePath(): string;
54
+ get routeContext(): IFluidHandleContext;
55
+ get idCompressor(): IIdCompressor | undefined;
56
+ get IFluidHandleContext(): this;
57
+ get rootRoutingContext(): this;
58
+ get channelsRoutingContext(): this;
59
+ get objectsRoutingContext(): this;
60
+ private _disposed;
61
+ get disposed(): boolean;
62
+ private readonly contexts;
63
+ private readonly pendingAttach;
64
+ private readonly deferredAttached;
65
+ private readonly localChannelContextQueue;
66
+ private readonly notBoundedChannelContextSet;
67
+ private _attachState;
68
+ visibilityState: VisibilityState;
69
+ private readonly pendingHandlesToMakeVisible;
70
+ readonly id: string;
71
+ readonly options: ILoaderOptions;
72
+ readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
73
+ private readonly quorum;
74
+ private readonly audience;
75
+ private readonly mc;
76
+ get logger(): ITelemetryLoggerExt;
77
+ /**
78
+ * If the summarizer makes local changes, a telemetry event is logged. This has the potential to be very noisy.
79
+ * So, adding a count of how many telemetry events are logged per data store context. This can be
80
+ * controlled via feature flags.
81
+ */
82
+ private localChangesTelemetryCount;
83
+ /**
84
+ * Invokes the given callback and expects that no ops are submitted
85
+ * until execution finishes. If an op is submitted, an error will be raised.
86
+ *
87
+ * Can be disabled by feature gate `Fluid.ContainerRuntime.DisableOpReentryCheck`
88
+ *
89
+ * @param callback - the callback to be invoked
90
+ */
91
+ ensureNoDataModelChanges<T>(callback: () => T): T;
92
+ /**
93
+ * Create an instance of a DataStore runtime.
94
+ *
95
+ * @param dataStoreContext - Context object for the runtime.
96
+ * @param sharedObjectRegistry - The registry of shared objects that this data store will be able to instantiate.
97
+ * @param existing - Pass 'true' if loading this datastore from an existing file; pass 'false' otherwise.
98
+ * @param provideEntryPoint - Function to initialize the entryPoint object for the data store runtime. The
99
+ * handle to this data store runtime will point to the object returned by this function. If this function is not
100
+ * provided, the handle will be left undefined. This is here so we can start making handles a first-class citizen
101
+ * and the primary way of interacting with some Fluid objects, and should be used if possible.
102
+ */
103
+ constructor(dataStoreContext: IFluidDataStoreContext, sharedObjectRegistry: ISharedObjectRegistry, existing: boolean, provideEntryPoint: (runtime: IFluidDataStoreRuntime) => Promise<FluidObject>);
104
+ dispose(): void;
105
+ resolveHandle(request: IRequest): Promise<IResponse>;
106
+ request(request: IRequest): Promise<IResponse>;
107
+ getChannel(id: string): Promise<IChannel>;
108
+ /**
109
+ * Api which allows caller to create the channel first and then add it to the runtime.
110
+ * The channel type should be present in the registry, otherwise the runtime would reject
111
+ * the channel. Also the runtime used to create the channel object should be same to which
112
+ * it is added.
113
+ * @param channel - channel which needs to be added to the runtime.
114
+ */
115
+ addChannel(channel: IChannel): void;
116
+ createChannel(id: string | undefined, type: string): IChannel;
117
+ private createChannelContext;
118
+ /**
119
+ * Binds a channel with the runtime. If the runtime is attached we will attach the channel right away.
120
+ * If the runtime is not attached we will defer the attach until the runtime attaches.
121
+ * @param channel - channel to be registered.
122
+ */
123
+ bindChannel(channel: IChannel): void;
124
+ /**
125
+ * This function is called when a data store becomes root. It does the following:
126
+ *
127
+ * 1. Marks the data store locally visible in the container.
128
+ *
129
+ * 2. Attaches the graph of all the handles bound to it.
130
+ *
131
+ * 3. Calls into the data store context to mark it visible in the container too. If the container is globally
132
+ * visible, it will mark us globally visible. Otherwise, it will mark us globally visible when it becomes
133
+ * globally visible.
134
+ */
135
+ makeVisibleAndAttachGraph(): void;
136
+ /**
137
+ * This function is called when a handle to this data store is added to a visible DDS.
138
+ */
139
+ attachGraph(): void;
140
+ bind(handle: IFluidHandle): void;
141
+ setConnectionState(connected: boolean, clientId?: string): void;
142
+ getQuorum(): IQuorumClients;
143
+ getAudience(): IAudience;
144
+ uploadBlob(blob: ArrayBufferLike, signal?: AbortSignal): Promise<IFluidHandle<ArrayBufferLike>>;
145
+ private createRemoteChannelContext;
146
+ process(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;
147
+ processSignal(message: IInboundSignalMessage, local: boolean): void;
148
+ private isChannelAttached;
149
+ /**
150
+ * Returns the outbound routes of this channel. Currently, all contexts in this channel are considered
151
+ * referenced and are hence outbound. This will change when we have root and non-root channel contexts.
152
+ * The only root contexts will be considered as referenced.
153
+ */
154
+ private getOutboundRoutes;
155
+ /**
156
+ * Updates the GC nodes of this channel. It does the following:
157
+ * - Adds a back route to self to all its child GC nodes.
158
+ * - Adds a node for this channel.
159
+ * @param builder - The builder that contains the GC nodes for this channel's children.
160
+ */
161
+ private updateGCNodes;
162
+ /**
163
+ * Generates data used for garbage collection. This includes a list of GC nodes that represent this channel
164
+ * including any of its child channel contexts. Each node has a set of outbound routes to other GC nodes in the
165
+ * document. It does the following:
166
+ *
167
+ * 1. Calls into each child context to get its GC data.
168
+ *
169
+ * 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
170
+ * identified as belonging to the child.
171
+ *
172
+ * 3. Adds a GC node for this channel to the nodes received from the children. All these nodes together represent
173
+ * the GC data of this channel.
174
+ *
175
+ * @param fullGC - true to bypass optimizations and force full generation of GC data.
176
+ */
177
+ getGCData(fullGC?: boolean): Promise<IGarbageCollectionData>;
178
+ /**
179
+ * After GC has run, called to notify this channel of routes that are used in it. It calls the child contexts to
180
+ * update their used routes.
181
+ * @param usedRoutes - The routes that are used in all contexts in this channel.
182
+ */
183
+ updateUsedRoutes(usedRoutes: string[]): void;
184
+ /**
185
+ * Called when a new outbound reference is added to another node. This is used by garbage collection to identify
186
+ * all references added in the system.
187
+ * @param srcHandle - The handle of the node that added the reference.
188
+ * @param outboundHandle - The handle of the outbound node that is referenced.
189
+ */
190
+ private addedGCOutboundReference;
191
+ /**
192
+ * Returns a summary at the current sequence number.
193
+ * @param fullTree - true to bypass optimizations and force a full summary tree
194
+ * @param trackState - This tells whether we should track state from this summary.
195
+ * @param telemetryContext - summary data passed through the layers for telemetry purposes
196
+ */
197
+ summarize(fullTree?: boolean, trackState?: boolean, telemetryContext?: ITelemetryContext): Promise<ISummaryTreeWithStats>;
198
+ getAttachSummary(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;
199
+ submitMessage(type: DataStoreMessageType, content: any, localOpMetadata: unknown): void;
200
+ /**
201
+ * Submits the signal to be sent to other clients.
202
+ * @param type - Type of the signal.
203
+ * @param content - Content of the signal.
204
+ * @param targetClientId - When specified, the signal is only sent to the provided client id.
205
+ */
206
+ submitSignal(type: string, content: any, targetClientId?: string): void;
207
+ /**
208
+ * Will return when the data store is attached.
209
+ */
210
+ waitAttached(): Promise<void>;
211
+ /**
212
+ * Attach channel should only be called after the data store has been attached
213
+ */
214
+ private attachChannel;
215
+ private submitChannelOp;
216
+ private submit;
217
+ /**
218
+ * For messages of type MessageType.Operation, finds the right channel and asks it to resubmit the message.
219
+ * For all other messages, just submit it again.
220
+ * This typically happens when we reconnect and there are unacked messages.
221
+ * @param content - The content of the original message.
222
+ * @param localOpMetadata - The local metadata associated with the original message.
223
+ */
224
+ reSubmit(type: DataStoreMessageType, content: any, localOpMetadata: unknown): void;
225
+ /**
226
+ * Revert a local op.
227
+ * @param content - The content of the original message.
228
+ * @param localOpMetadata - The local metadata associated with the original message.
229
+ */
230
+ rollback?(type: DataStoreMessageType, content: any, localOpMetadata: unknown): void;
231
+ applyStashedOp(content: any): Promise<unknown>;
232
+ private setChannelDirty;
233
+ private processChannelOp;
234
+ private attachListener;
235
+ private verifyNotClosed;
236
+ /**
237
+ * Summarizer client should not have local changes. These changes can become part of the summary and can break
238
+ * eventual consistency. For example, the next summary (say at ref seq# 100) may contain these changes whereas
239
+ * other clients that are up-to-date till seq# 100 may not have them yet.
240
+ */
241
+ private identifyLocalChangeInSummarizer;
242
+ }
243
+
244
+ /**
245
+ * Handle for a shared {@link @fluidframework/core-interfaces#FluidObject}.
246
+ * @internal
247
+ */
248
+ export declare class FluidObjectHandle<T extends FluidObject = FluidObject> implements IFluidHandle {
249
+ protected readonly value: T | Promise<T>;
250
+ readonly path: string;
251
+ readonly routeContext: IFluidHandleContext;
252
+ private readonly pendingHandlesToMakeVisible;
253
+ /**
254
+ * {@inheritDoc @fluidframework/core-interfaces#IFluidHandle.absolutePath}
255
+ */
256
+ readonly absolutePath: string;
257
+ /**
258
+ * {@inheritDoc @fluidframework/core-interfaces#IProvideFluidHandle.IFluidHandle}
259
+ */
260
+ get IFluidHandle(): IFluidHandle;
261
+ /**
262
+ * {@inheritDoc @fluidframework/core-interfaces#IFluidHandle.isAttached}
263
+ */
264
+ get isAttached(): boolean;
265
+ /**
266
+ * Tells whether the object of this handle is visible in the container locally or globally.
267
+ */
268
+ private get visible();
269
+ /**
270
+ * Tracks whether this handle is locally visible in the container.
271
+ */
272
+ private locallyVisible;
273
+ /**
274
+ * Creates a new `FluidObjectHandle`.
275
+ *
276
+ * @param value - The {@link @fluidframework/core-interfaces#FluidObject} object this handle is for.
277
+ * @param path - The path to this handle relative to the `routeContext`.
278
+ * @param routeContext - The parent {@link @fluidframework/core-interfaces#IFluidHandleContext} that has a route
279
+ * to this handle.
280
+ */
281
+ constructor(value: T | Promise<T>, path: string, routeContext: IFluidHandleContext);
282
+ /**
283
+ * {@inheritDoc @fluidframework/core-interfaces#IFluidHandle.get}
284
+ */
285
+ get(): Promise<any>;
286
+ /**
287
+ * {@inheritDoc @fluidframework/core-interfaces#IFluidHandle.attachGraph }
288
+ */
289
+ attachGraph(): void;
290
+ /**
291
+ * {@inheritDoc @fluidframework/core-interfaces#IFluidHandle.bind}
292
+ */
293
+ bind(handle: IFluidHandle): void;
294
+ }
295
+
296
+ /**
297
+ * @alpha
298
+ */
299
+ export declare interface ISharedObjectRegistry {
300
+ get(name: string): IChannelFactory | undefined;
301
+ }
302
+
303
+ /**
304
+ * Mixin class that adds request handler to FluidDataStoreRuntime
305
+ * Request handler is only called when data store can't resolve request, i.e. for custom requests.
306
+ * @param Base - base class, inherits from FluidDataStoreRuntime
307
+ * @param requestHandler - request handler to mix in
308
+ * @internal
309
+ */
310
+ export declare const mixinRequestHandler: (requestHandler: (request: IRequest, runtime: FluidDataStoreRuntime) => Promise<IResponse>, Base?: typeof FluidDataStoreRuntime) => typeof FluidDataStoreRuntime;
311
+
312
+ /**
313
+ * Mixin class that adds await for DataObject to finish initialization before we proceed to summary.
314
+ * @param handler - handler that returns info about blob to be added to summary.
315
+ * Or undefined not to add anything to summary.
316
+ * @param Base - base class, inherits from FluidDataStoreRuntime
317
+ * @internal
318
+ */
319
+ export declare const mixinSummaryHandler: (handler: (runtime: FluidDataStoreRuntime) => Promise<{
320
+ path: string[];
321
+ content: string;
322
+ } | undefined>, Base?: typeof FluidDataStoreRuntime) => typeof FluidDataStoreRuntime;
323
+
324
+ export { }
@@ -5,8 +5,7 @@
5
5
  import { IFluidHandle, IFluidHandleContext, FluidObject } from "@fluidframework/core-interfaces";
6
6
  /**
7
7
  * Handle for a shared {@link @fluidframework/core-interfaces#FluidObject}.
8
- *
9
- * @public
8
+ * @internal
10
9
  */
11
10
  export declare class FluidObjectHandle<T extends FluidObject = FluidObject> implements IFluidHandle {
12
11
  protected readonly value: T | Promise<T>;
@@ -1 +1 @@
1
- {"version":3,"file":"fluidHandle.d.ts","sourceRoot":"","sources":["../src/fluidHandle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAGjG;;;;GAIG;AACH,qBAAa,iBAAiB,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,CAAE,YAAW,YAAY;IAuDzF,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;aACxB,IAAI,EAAE,MAAM;aACZ,YAAY,EAAE,mBAAmB;IAxDlD,OAAO,CAAC,QAAQ,CAAC,2BAA2B,CAAgC;IAE5E;;OAEG;IACH,SAAgB,YAAY,EAAE,MAAM,CAAC;IAErC;;OAEG;IACH,IAAW,YAAY,IAAI,YAAY,CAEtC;IAED;;OAEG;IACH,IAAW,UAAU,IAAI,OAAO,CAE/B;IAED;;OAEG;IACH,OAAO,KAAK,OAAO,GAclB;IAED;;OAEG;IACH,OAAO,CAAC,cAAc,CAAkB;IAExC;;;;;;;OAOG;gBAEiB,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,EACxB,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,mBAAmB;IAKlD;;OAEG;IACU,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;IAKhC;;OAEG;IACI,WAAW,IAAI,IAAI;IAa1B;;OAEG;IACI,IAAI,CAAC,MAAM,EAAE,YAAY;CAQhC"}
1
+ {"version":3,"file":"fluidHandle.d.ts","sourceRoot":"","sources":["../src/fluidHandle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAGjG;;;GAGG;AACH,qBAAa,iBAAiB,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,CAAE,YAAW,YAAY;IAuDzF,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;aACxB,IAAI,EAAE,MAAM;aACZ,YAAY,EAAE,mBAAmB;IAxDlD,OAAO,CAAC,QAAQ,CAAC,2BAA2B,CAAgC;IAE5E;;OAEG;IACH,SAAgB,YAAY,EAAE,MAAM,CAAC;IAErC;;OAEG;IACH,IAAW,YAAY,IAAI,YAAY,CAEtC;IAED;;OAEG;IACH,IAAW,UAAU,IAAI,OAAO,CAE/B;IAED;;OAEG;IACH,OAAO,KAAK,OAAO,GAclB;IAED;;OAEG;IACH,OAAO,CAAC,cAAc,CAAkB;IAExC;;;;;;;OAOG;gBAEiB,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,EACxB,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,mBAAmB;IAKlD;;OAEG;IACU,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;IAKhC;;OAEG;IACI,WAAW,IAAI,IAAI;IAa1B;;OAEG;IACI,IAAI,CAAC,MAAM,EAAE,YAAY;CAQhC"}
@@ -5,8 +5,7 @@
5
5
  import { generateHandleContextPath } from "@fluidframework/runtime-utils";
6
6
  /**
7
7
  * Handle for a shared {@link @fluidframework/core-interfaces#FluidObject}.
8
- *
9
- * @public
8
+ * @internal
10
9
  */
11
10
  export class FluidObjectHandle {
12
11
  /**
@@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CAAC,YAAY,CAAC,WAAW,EAAE,CAAC;IACjC,CAAC;IAED;;OAEG;IACI,IAAI,CAAC,MAAoB;QAC/B,8EAA8E;QAC9E,IAAI,IAAI,CAAC,OAAO,EAAE;YACjB,MAAM,CAAC,WAAW,EAAE,CAAC;YACrB,OAAO;SACP;QACD,IAAI,CAAC,2BAA2B,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC9C,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IFluidHandle, IFluidHandleContext, FluidObject } from \"@fluidframework/core-interfaces\";\nimport { generateHandleContextPath } from \"@fluidframework/runtime-utils\";\n\n/**\n * Handle for a shared {@link @fluidframework/core-interfaces#FluidObject}.\n *\n * @public\n */\nexport class FluidObjectHandle<T extends FluidObject = FluidObject> implements IFluidHandle {\n\tprivate readonly pendingHandlesToMakeVisible: Set<IFluidHandle> = new Set();\n\n\t/**\n\t * {@inheritDoc @fluidframework/core-interfaces#IFluidHandle.absolutePath}\n\t */\n\tpublic readonly absolutePath: string;\n\n\t/**\n\t * {@inheritDoc @fluidframework/core-interfaces#IProvideFluidHandle.IFluidHandle}\n\t */\n\tpublic get IFluidHandle(): IFluidHandle {\n\t\treturn this;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/core-interfaces#IFluidHandle.isAttached}\n\t */\n\tpublic get isAttached(): boolean {\n\t\treturn this.routeContext.isAttached;\n\t}\n\n\t/**\n\t * Tells whether the object of this handle is visible in the container locally or globally.\n\t */\n\tprivate get visible(): boolean {\n\t\t/**\n\t\t * If the object of this handle is attached, it is visible in the container. Ideally, checking local visibility\n\t\t * should be enough for a handle. However, there are scenarios where the object becomes locally visible but the\n\t\t * handle does not know this - This will happen is attachGraph is never called on the handle. Couple of examples\n\t\t * where this can happen:\n\t\t *\n\t\t * 1. Handles to DDS other than the default handle won't know if the DDS becomes visible after the handle was\n\t\t * created.\n\t\t *\n\t\t * 2. Handles to root data stores will never know that it was visible because the handle will not be stores in\n\t\t * another DDS and so, attachGraph will never be called on it.\n\t\t */\n\t\treturn this.isAttached || this.locallyVisible;\n\t}\n\n\t/**\n\t * Tracks whether this handle is locally visible in the container.\n\t */\n\tprivate locallyVisible: boolean = false;\n\n\t/**\n\t * Creates a new `FluidObjectHandle`.\n\t *\n\t * @param value - The {@link @fluidframework/core-interfaces#FluidObject} object this handle is for.\n\t * @param path - The path to this handle relative to the `routeContext`.\n\t * @param routeContext - The parent {@link @fluidframework/core-interfaces#IFluidHandleContext} that has a route\n\t * to this handle.\n\t */\n\tconstructor(\n\t\tprotected readonly value: T | Promise<T>,\n\t\tpublic readonly path: string,\n\t\tpublic readonly routeContext: IFluidHandleContext,\n\t) {\n\t\tthis.absolutePath = generateHandleContextPath(path, this.routeContext);\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/core-interfaces#IFluidHandle.get}\n\t */\n\tpublic async get(): Promise<any> {\n\t\t// Note that this return works whether we received a T or a Promise<T> for this.value in the constructor.\n\t\treturn this.value;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/core-interfaces#IFluidHandle.attachGraph }\n\t */\n\tpublic attachGraph(): void {\n\t\tif (this.visible) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.locallyVisible = true;\n\t\tthis.pendingHandlesToMakeVisible.forEach((handle) => {\n\t\t\thandle.attachGraph();\n\t\t});\n\t\tthis.pendingHandlesToMakeVisible.clear();\n\t\tthis.routeContext.attachGraph();\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/core-interfaces#IFluidHandle.bind}\n\t */\n\tpublic bind(handle: IFluidHandle) {\n\t\t// If this handle is visible, attach the graph of the incoming handle as well.\n\t\tif (this.visible) {\n\t\t\thandle.attachGraph();\n\t\t\treturn;\n\t\t}\n\t\tthis.pendingHandlesToMakeVisible.add(handle);\n\t}\n}\n"]}
1
+ {"version":3,"file":"fluidHandle.js","sourceRoot":"","sources":["../src/fluidHandle.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AI,CAAC,MAAoB;QAC/B,8EAA8E;QAC9E,IAAI,IAAI,CAAC,OAAO,EAAE;YACjB,MAAM,CAAC,WAAW,EAAE,CAAC;YACrB,OAAO;SACP;QACD,IAAI,CAAC,2BAA2B,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC9C,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IFluidHandle, IFluidHandleContext, FluidObject } from \"@fluidframework/core-interfaces\";\nimport { generateHandleContextPath } from \"@fluidframework/runtime-utils\";\n\n/**\n * Handle for a shared {@link @fluidframework/core-interfaces#FluidObject}.\n * @internal\n */\nexport class FluidObjectHandle<T extends FluidObject = FluidObject> implements IFluidHandle {\n\tprivate readonly pendingHandlesToMakeVisible: Set<IFluidHandle> = new Set();\n\n\t/**\n\t * {@inheritDoc @fluidframework/core-interfaces#IFluidHandle.absolutePath}\n\t */\n\tpublic readonly absolutePath: string;\n\n\t/**\n\t * {@inheritDoc @fluidframework/core-interfaces#IProvideFluidHandle.IFluidHandle}\n\t */\n\tpublic get IFluidHandle(): IFluidHandle {\n\t\treturn this;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/core-interfaces#IFluidHandle.isAttached}\n\t */\n\tpublic get isAttached(): boolean {\n\t\treturn this.routeContext.isAttached;\n\t}\n\n\t/**\n\t * Tells whether the object of this handle is visible in the container locally or globally.\n\t */\n\tprivate get visible(): boolean {\n\t\t/**\n\t\t * If the object of this handle is attached, it is visible in the container. Ideally, checking local visibility\n\t\t * should be enough for a handle. However, there are scenarios where the object becomes locally visible but the\n\t\t * handle does not know this - This will happen is attachGraph is never called on the handle. Couple of examples\n\t\t * where this can happen:\n\t\t *\n\t\t * 1. Handles to DDS other than the default handle won't know if the DDS becomes visible after the handle was\n\t\t * created.\n\t\t *\n\t\t * 2. Handles to root data stores will never know that it was visible because the handle will not be stores in\n\t\t * another DDS and so, attachGraph will never be called on it.\n\t\t */\n\t\treturn this.isAttached || this.locallyVisible;\n\t}\n\n\t/**\n\t * Tracks whether this handle is locally visible in the container.\n\t */\n\tprivate locallyVisible: boolean = false;\n\n\t/**\n\t * Creates a new `FluidObjectHandle`.\n\t *\n\t * @param value - The {@link @fluidframework/core-interfaces#FluidObject} object this handle is for.\n\t * @param path - The path to this handle relative to the `routeContext`.\n\t * @param routeContext - The parent {@link @fluidframework/core-interfaces#IFluidHandleContext} that has a route\n\t * to this handle.\n\t */\n\tconstructor(\n\t\tprotected readonly value: T | Promise<T>,\n\t\tpublic readonly path: string,\n\t\tpublic readonly routeContext: IFluidHandleContext,\n\t) {\n\t\tthis.absolutePath = generateHandleContextPath(path, this.routeContext);\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/core-interfaces#IFluidHandle.get}\n\t */\n\tpublic async get(): Promise<any> {\n\t\t// Note that this return works whether we received a T or a Promise<T> for this.value in the constructor.\n\t\treturn this.value;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/core-interfaces#IFluidHandle.attachGraph }\n\t */\n\tpublic attachGraph(): void {\n\t\tif (this.visible) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.locallyVisible = true;\n\t\tthis.pendingHandlesToMakeVisible.forEach((handle) => {\n\t\t\thandle.attachGraph();\n\t\t});\n\t\tthis.pendingHandlesToMakeVisible.clear();\n\t\tthis.routeContext.attachGraph();\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/core-interfaces#IFluidHandle.bind}\n\t */\n\tpublic bind(handle: IFluidHandle) {\n\t\t// If this handle is visible, attach the graph of the incoming handle as well.\n\t\tif (this.visible) {\n\t\t\thandle.attachGraph();\n\t\t\treturn;\n\t\t}\n\t\tthis.pendingHandlesToMakeVisible.add(handle);\n\t}\n}\n"]}
@@ -56,8 +56,8 @@ export declare class RehydratedLocalChannelContext extends LocalChannelContextBa
56
56
  private sanitizeSnapshot;
57
57
  }
58
58
  export declare class LocalChannelContext extends LocalChannelContextBase {
59
- private readonly dirtyFn;
60
59
  readonly channel: IChannel;
61
- constructor(id: string, registry: ISharedObjectRegistry, type: string, runtime: IFluidDataStoreRuntime, dataStoreContext: IFluidDataStoreContext, storageService: IDocumentStorageService, logger: ITelemetryLoggerExt, submitFn: (content: any, localOpMetadata: unknown) => void, dirtyFn: (address: string) => void, addedGCOutboundReferenceFn: (srcHandle: IFluidHandle, outboundHandle: IFluidHandle) => void);
60
+ private readonly dirtyFn;
61
+ constructor(channel: IChannel, runtime: IFluidDataStoreRuntime, dataStoreContext: IFluidDataStoreContext, storageService: IDocumentStorageService, logger: ITelemetryLoggerExt, submitFn: (content: any, localOpMetadata: unknown) => void, dirtyFn: (address: string) => void, addedGCOutboundReferenceFn: (srcHandle: IFluidHandle, outboundHandle: IFluidHandle) => void);
62
62
  }
63
63
  //# sourceMappingURL=localChannelContext.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"localChannelContext.d.ts","sourceRoot":"","sources":["../src/localChannelContext.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAuB,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAC3F,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,yBAAyB,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAChG,OAAO,EAAE,QAAQ,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AACzF,OAAO,EACN,sBAAsB,EACtB,sBAAsB,EACtB,gBAAgB,EAChB,iBAAiB,EACjB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAU,IAAI,EAAe,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EACN,uBAAuB,EAEvB,eAAe,EAKf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE3D;;GAEG;AACH,8BAAsB,uBAAwB,Y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AAoC;IAoB5C,OAAO,CAAC,gBAAgB;CAaxB;AAED,qBAAa,mBAAoB,SAAQ,uBAAuB;aAG9C,OAAO,EAAE,QAAQ;IAFlC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAa;gBAEpB,OAAO,EAAE,QAAQ,EACjC,OAAO,EAAE,sBAAsB,EAC/B,gBAAgB,EAAE,sBAAsB,EACxC,cAAc,EAAE,uBAAuB,EACvC,MAAM,EAAE,mBAAmB,EAC3B,QAAQ,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,OAAO,KAAK,IAAI,EAC1D,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,EAClC,0BAA0B,EAAE,CAAC,SAAS,EAAE,YAAY,EAAE,cAAc,EAAE,YAAY,KAAK,IAAI;CAwB5F"}
@@ -137,14 +137,15 @@ export class RehydratedLocalChannelContext extends LocalChannelContextBase {
137
137
  }
138
138
  isSnapshotInOldFormatAndCollectBlobs(snapshotTree, blobMap) {
139
139
  let sanitize = false;
140
- const blobsContents = snapshotTree
141
- .blobsContents;
142
- Object.entries(blobsContents).forEach(([key, value]) => {
143
- blobMap.set(key, value);
144
- if (snapshotTree.blobs[key] !== undefined) {
145
- sanitize = true;
146
- }
147
- });
140
+ const blobsContents = snapshotTree.blobsContents;
141
+ if (blobsContents !== undefined) {
142
+ Object.entries(blobsContents).forEach(([key, value]) => {
143
+ blobMap.set(key, value);
144
+ if (snapshotTree.blobs[key] !== undefined) {
145
+ sanitize = true;
146
+ }
147
+ });
148
+ }
148
149
  for (const value of Object.values(snapshotTree.trees)) {
149
150
  sanitize = sanitize || this.isSnapshotInOldFormatAndCollectBlobs(value, blobMap);
150
151
  }
@@ -165,19 +166,14 @@ export class RehydratedLocalChannelContext extends LocalChannelContextBase {
165
166
  }
166
167
  }
167
168
  export class LocalChannelContext extends LocalChannelContextBase {
168
- constructor(id, registry, type, runtime, dataStoreContext, storageService, logger, submitFn, dirtyFn, addedGCOutboundReferenceFn) {
169
- assert(type !== undefined, 0x209 /* "Factory Type should be defined" */);
170
- const factory = registry.get(type);
171
- if (factory === undefined) {
172
- throw new Error(`Channel Factory ${type} not registered`);
173
- }
174
- const channel = factory.create(runtime, id);
175
- super(id, runtime, new Lazy(() => {
169
+ constructor(channel, runtime, dataStoreContext, storageService, logger, submitFn, dirtyFn, addedGCOutboundReferenceFn) {
170
+ super(channel.id, runtime, new Lazy(() => {
176
171
  return createChannelServiceEndpoints(dataStoreContext.connected, submitFn, this.dirtyFn, addedGCOutboundReferenceFn, storageService, logger);
177
172
  }), Promise.resolve(channel), channel);
178
173
  this.channel = channel;
174
+ this.channel = channel;
179
175
  this.dirtyFn = () => {
180
- dirtyFn(id);
176
+ dirtyFn(channel.id);
181
177
  };
182
178
  }
183
179
  }