@fluidframework/datastore 2.0.0-internal.6.4.0 → 2.0.0-internal.7.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/CHANGELOG.md +69 -0
- package/api-extractor.json +1 -1
- package/api-report/datastore.api.md +172 -0
- package/dist/channelDeltaConnection.js +6 -6
- package/dist/channelDeltaConnection.js.map +1 -1
- package/dist/channelStorageService.js +10 -10
- package/dist/channelStorageService.js.map +1 -1
- package/dist/dataStoreRuntime.d.ts +15 -11
- package/dist/dataStoreRuntime.d.ts.map +1 -1
- package/dist/dataStoreRuntime.js +86 -90
- package/dist/dataStoreRuntime.js.map +1 -1
- package/dist/datastore-alpha.d.ts +327 -0
- package/dist/datastore-beta.d.ts +327 -0
- package/dist/datastore-public.d.ts +327 -0
- package/dist/datastore.d.ts +326 -0
- package/dist/fluidHandle.d.ts +2 -0
- package/dist/fluidHandle.d.ts.map +1 -1
- package/dist/fluidHandle.js +21 -19
- package/dist/fluidHandle.js.map +1 -1
- package/dist/remoteChannelContext.js.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/lib/channelDeltaConnection.js +6 -6
- package/lib/channelDeltaConnection.js.map +1 -1
- package/lib/channelStorageService.js +10 -10
- package/lib/channelStorageService.js.map +1 -1
- package/lib/dataStoreRuntime.d.ts +15 -11
- package/lib/dataStoreRuntime.d.ts.map +1 -1
- package/lib/dataStoreRuntime.js +86 -90
- package/lib/dataStoreRuntime.js.map +1 -1
- package/lib/fluidHandle.d.ts +2 -0
- package/lib/fluidHandle.d.ts.map +1 -1
- package/lib/fluidHandle.js +21 -19
- package/lib/fluidHandle.js.map +1 -1
- package/lib/remoteChannelContext.js.map +1 -1
- package/package.json +25 -26
- package/src/dataStoreRuntime.ts +21 -24
- package/src/fluidHandle.ts +2 -0
package/src/dataStoreRuntime.ts
CHANGED
|
@@ -63,7 +63,6 @@ import {
|
|
|
63
63
|
createResponseError,
|
|
64
64
|
exceptionToResponse,
|
|
65
65
|
GCDataBuilder,
|
|
66
|
-
requestFluidObject,
|
|
67
66
|
unpackChildNodesUsedRoutes,
|
|
68
67
|
} from "@fluidframework/runtime-utils";
|
|
69
68
|
import {
|
|
@@ -82,12 +81,18 @@ import {
|
|
|
82
81
|
import { RemoteChannelContext } from "./remoteChannelContext";
|
|
83
82
|
import { FluidObjectHandle } from "./fluidHandle";
|
|
84
83
|
|
|
84
|
+
/**
|
|
85
|
+
* @public
|
|
86
|
+
*/
|
|
85
87
|
export enum DataStoreMessageType {
|
|
86
88
|
// Creates a new channel
|
|
87
89
|
Attach = "attach",
|
|
88
90
|
ChannelOp = "op",
|
|
89
91
|
}
|
|
90
92
|
|
|
93
|
+
/**
|
|
94
|
+
* @public
|
|
95
|
+
*/
|
|
91
96
|
export interface ISharedObjectRegistry {
|
|
92
97
|
// TODO consider making this async. A consequence is that either the creation of a distributed data type
|
|
93
98
|
// is async or we need a new API to split the synchronous vs. asynchronous creation.
|
|
@@ -96,6 +101,8 @@ export interface ISharedObjectRegistry {
|
|
|
96
101
|
|
|
97
102
|
/**
|
|
98
103
|
* Base data store class
|
|
104
|
+
*
|
|
105
|
+
* @public
|
|
99
106
|
*/
|
|
100
107
|
export class FluidDataStoreRuntime
|
|
101
108
|
extends TypedEventEmitter<IFluidDataStoreRuntimeEvents>
|
|
@@ -118,14 +125,14 @@ export class FluidDataStoreRuntime
|
|
|
118
125
|
context,
|
|
119
126
|
sharedObjectRegistry,
|
|
120
127
|
existing,
|
|
121
|
-
async (dataStoreRuntime) =>
|
|
128
|
+
async (dataStoreRuntime) => dataStoreRuntime.entryPoint,
|
|
122
129
|
);
|
|
123
130
|
}
|
|
124
131
|
|
|
125
132
|
/**
|
|
126
133
|
* {@inheritDoc @fluidframework/datastore-definitions#IFluidDataStoreRuntime.entryPoint}
|
|
127
134
|
*/
|
|
128
|
-
public readonly entryPoint
|
|
135
|
+
public readonly entryPoint: IFluidHandle<FluidObject>;
|
|
129
136
|
|
|
130
137
|
/**
|
|
131
138
|
* @deprecated - Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
|
|
@@ -235,7 +242,7 @@ export class FluidDataStoreRuntime
|
|
|
235
242
|
* @param dataStoreContext - Context object for the runtime.
|
|
236
243
|
* @param sharedObjectRegistry - The registry of shared objects that this data store will be able to instantiate.
|
|
237
244
|
* @param existing - Pass 'true' if loading this datastore from an existing file; pass 'false' otherwise.
|
|
238
|
-
* @param
|
|
245
|
+
* @param provideEntryPoint - Function to initialize the entryPoint object for the data store runtime. The
|
|
239
246
|
* handle to this data store runtime will point to the object returned by this function. If this function is not
|
|
240
247
|
* provided, the handle will be left undefined. This is here so we can start making handles a first-class citizen
|
|
241
248
|
* and the primary way of interacting with some Fluid objects, and should be used if possible.
|
|
@@ -244,7 +251,7 @@ export class FluidDataStoreRuntime
|
|
|
244
251
|
private readonly dataStoreContext: IFluidDataStoreContext,
|
|
245
252
|
private readonly sharedObjectRegistry: ISharedObjectRegistry,
|
|
246
253
|
existing: boolean,
|
|
247
|
-
|
|
254
|
+
provideEntryPoint: (runtime: IFluidDataStoreRuntime) => Promise<FluidObject>,
|
|
248
255
|
) {
|
|
249
256
|
super();
|
|
250
257
|
|
|
@@ -329,14 +336,11 @@ export class FluidDataStoreRuntime
|
|
|
329
336
|
});
|
|
330
337
|
}
|
|
331
338
|
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
this.objectsRoutingContext,
|
|
338
|
-
);
|
|
339
|
-
}
|
|
339
|
+
this.entryPoint = new FluidObjectHandle<FluidObject>(
|
|
340
|
+
new LazyPromise(async () => provideEntryPoint(this)),
|
|
341
|
+
"",
|
|
342
|
+
this.objectsRoutingContext,
|
|
343
|
+
);
|
|
340
344
|
|
|
341
345
|
this.attachListener();
|
|
342
346
|
this._attachState = dataStoreContext.attachState;
|
|
@@ -525,17 +529,6 @@ export class FluidDataStoreRuntime
|
|
|
525
529
|
this.makeVisibleAndAttachGraph();
|
|
526
530
|
}
|
|
527
531
|
|
|
528
|
-
/**
|
|
529
|
-
* @deprecated - Not necessary if consumers add a new dataStore to the container by storing its handle.
|
|
530
|
-
* Binds this runtime to the container
|
|
531
|
-
* This includes the following:
|
|
532
|
-
* 1. Sending an Attach op that includes all existing state
|
|
533
|
-
* 2. Attaching the graph if the data store becomes attached.
|
|
534
|
-
*/
|
|
535
|
-
public bindToContext() {
|
|
536
|
-
this.makeVisibleAndAttachGraph();
|
|
537
|
-
}
|
|
538
|
-
|
|
539
532
|
public bind(handle: IFluidHandle): void {
|
|
540
533
|
// If visible, attach the incoming handle's graph. Else, this will be done when we become visible.
|
|
541
534
|
if (this.visibilityState !== VisibilityState.NotVisible) {
|
|
@@ -1129,6 +1122,8 @@ export class FluidDataStoreRuntime
|
|
|
1129
1122
|
* Request handler is only called when data store can't resolve request, i.e. for custom requests.
|
|
1130
1123
|
* @param Base - base class, inherits from FluidDataStoreRuntime
|
|
1131
1124
|
* @param requestHandler - request handler to mix in
|
|
1125
|
+
*
|
|
1126
|
+
* @public
|
|
1132
1127
|
*/
|
|
1133
1128
|
export const mixinRequestHandler = (
|
|
1134
1129
|
requestHandler: (request: IRequest, runtime: FluidDataStoreRuntime) => Promise<IResponse>,
|
|
@@ -1149,6 +1144,8 @@ export const mixinRequestHandler = (
|
|
|
1149
1144
|
* @param handler - handler that returns info about blob to be added to summary.
|
|
1150
1145
|
* Or undefined not to add anything to summary.
|
|
1151
1146
|
* @param Base - base class, inherits from FluidDataStoreRuntime
|
|
1147
|
+
*
|
|
1148
|
+
* @public
|
|
1152
1149
|
*/
|
|
1153
1150
|
export const mixinSummaryHandler = (
|
|
1154
1151
|
handler: (
|
package/src/fluidHandle.ts
CHANGED
|
@@ -8,6 +8,8 @@ import { generateHandleContextPath } from "@fluidframework/runtime-utils";
|
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Handle for a shared {@link @fluidframework/core-interfaces#FluidObject}.
|
|
11
|
+
*
|
|
12
|
+
* @public
|
|
11
13
|
*/
|
|
12
14
|
export class FluidObjectHandle<T extends FluidObject = FluidObject> implements IFluidHandle {
|
|
13
15
|
private readonly pendingHandlesToMakeVisible: Set<IFluidHandle> = new Set();
|