@fluidframework/datastore 2.33.0-333010 → 2.33.1
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 +4 -0
- package/api-report/datastore.legacy.alpha.api.md +8 -6
- package/dist/dataStoreRuntime.d.ts +19 -0
- package/dist/dataStoreRuntime.d.ts.map +1 -1
- package/dist/dataStoreRuntime.js +43 -2
- package/dist/dataStoreRuntime.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/lib/dataStoreRuntime.d.ts +19 -0
- package/lib/dataStoreRuntime.d.ts.map +1 -1
- package/lib/dataStoreRuntime.js +45 -4
- package/lib/dataStoreRuntime.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/tsdoc-metadata.json +1 -1
- package/package.json +16 -17
- package/src/dataStoreRuntime.ts +79 -4
- package/src/packageVersion.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,2BAA2B,CAAC;AACnD,MAAM,CAAC,MAAM,UAAU,GAAG,
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,2BAA2B,CAAC;AACnD,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/datastore\";\nexport const pkgVersion = \"2.33.1\";\n"]}
|
package/lib/tsdoc-metadata.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/datastore",
|
|
3
|
-
"version": "2.33.
|
|
3
|
+
"version": "2.33.1",
|
|
4
4
|
"description": "Fluid data store implementation",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -69,30 +69,30 @@
|
|
|
69
69
|
"temp-directory": "nyc/.nyc_output"
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@fluid-internal/client-utils": "2.33.
|
|
73
|
-
"@fluidframework/container-definitions": "2.33.
|
|
74
|
-
"@fluidframework/core-interfaces": "2.33.
|
|
75
|
-
"@fluidframework/core-utils": "2.33.
|
|
76
|
-
"@fluidframework/datastore-definitions": "2.33.
|
|
77
|
-
"@fluidframework/driver-definitions": "2.33.
|
|
78
|
-
"@fluidframework/driver-utils": "2.33.
|
|
79
|
-
"@fluidframework/id-compressor": "2.33.
|
|
80
|
-
"@fluidframework/runtime-definitions": "2.33.
|
|
81
|
-
"@fluidframework/runtime-utils": "2.33.
|
|
82
|
-
"@fluidframework/telemetry-utils": "2.33.
|
|
72
|
+
"@fluid-internal/client-utils": "~2.33.1",
|
|
73
|
+
"@fluidframework/container-definitions": "~2.33.1",
|
|
74
|
+
"@fluidframework/core-interfaces": "~2.33.1",
|
|
75
|
+
"@fluidframework/core-utils": "~2.33.1",
|
|
76
|
+
"@fluidframework/datastore-definitions": "~2.33.1",
|
|
77
|
+
"@fluidframework/driver-definitions": "~2.33.1",
|
|
78
|
+
"@fluidframework/driver-utils": "~2.33.1",
|
|
79
|
+
"@fluidframework/id-compressor": "~2.33.1",
|
|
80
|
+
"@fluidframework/runtime-definitions": "~2.33.1",
|
|
81
|
+
"@fluidframework/runtime-utils": "~2.33.1",
|
|
82
|
+
"@fluidframework/telemetry-utils": "~2.33.1",
|
|
83
83
|
"uuid": "^9.0.0"
|
|
84
84
|
},
|
|
85
85
|
"devDependencies": {
|
|
86
86
|
"@arethetypeswrong/cli": "^0.17.1",
|
|
87
87
|
"@biomejs/biome": "~1.9.3",
|
|
88
|
-
"@fluid-internal/mocha-test-setup": "2.33.
|
|
88
|
+
"@fluid-internal/mocha-test-setup": "~2.33.1",
|
|
89
89
|
"@fluid-tools/build-cli": "^0.55.0",
|
|
90
90
|
"@fluidframework/build-common": "^2.0.3",
|
|
91
91
|
"@fluidframework/build-tools": "^0.55.0",
|
|
92
|
-
"@fluidframework/datastore-previous": "npm:@fluidframework/datastore@2.
|
|
92
|
+
"@fluidframework/datastore-previous": "npm:@fluidframework/datastore@2.33.0",
|
|
93
93
|
"@fluidframework/eslint-config-fluid": "^5.7.3",
|
|
94
|
-
"@fluidframework/test-runtime-utils": "2.33.
|
|
95
|
-
"@microsoft/api-extractor": "7.
|
|
94
|
+
"@fluidframework/test-runtime-utils": "~2.33.1",
|
|
95
|
+
"@microsoft/api-extractor": "7.52.5",
|
|
96
96
|
"@types/lodash": "^4.14.118",
|
|
97
97
|
"@types/mocha": "^10.0.10",
|
|
98
98
|
"@types/node": "^18.19.0",
|
|
@@ -105,7 +105,6 @@
|
|
|
105
105
|
"eslint": "~8.55.0",
|
|
106
106
|
"mocha": "^10.8.2",
|
|
107
107
|
"mocha-multi-reporters": "^1.5.1",
|
|
108
|
-
"moment": "^2.21.0",
|
|
109
108
|
"rimraf": "^4.4.0",
|
|
110
109
|
"sinon": "^18.0.1",
|
|
111
110
|
"typescript": "~5.4.5"
|
package/src/dataStoreRuntime.ts
CHANGED
|
@@ -16,6 +16,7 @@ import { IFluidHandleContext } from "@fluidframework/core-interfaces/internal";
|
|
|
16
16
|
import type { IFluidHandleInternal } from "@fluidframework/core-interfaces/internal";
|
|
17
17
|
import {
|
|
18
18
|
assert,
|
|
19
|
+
debugAssert,
|
|
19
20
|
Deferred,
|
|
20
21
|
LazyPromise,
|
|
21
22
|
unreachableCase,
|
|
@@ -56,6 +57,10 @@ import {
|
|
|
56
57
|
IInboundSignalMessage,
|
|
57
58
|
type IRuntimeMessageCollection,
|
|
58
59
|
type IRuntimeMessagesContent,
|
|
60
|
+
// eslint-disable-next-line import/no-deprecated
|
|
61
|
+
type IContainerRuntimeBaseExperimental,
|
|
62
|
+
notifiesReadOnlyState,
|
|
63
|
+
encodeHandlesInContainerRuntime,
|
|
59
64
|
} from "@fluidframework/runtime-definitions/internal";
|
|
60
65
|
import {
|
|
61
66
|
GCDataBuilder,
|
|
@@ -102,6 +107,22 @@ import {
|
|
|
102
107
|
import { pkgVersion } from "./packageVersion.js";
|
|
103
108
|
import { RemoteChannelContext } from "./remoteChannelContext.js";
|
|
104
109
|
|
|
110
|
+
type PickRequired<T extends Record<never, unknown>, K extends keyof T> = Omit<T, K> &
|
|
111
|
+
Required<Pick<T, K>>;
|
|
112
|
+
|
|
113
|
+
interface IFluidDataStoreContextFeaturesToTypes {
|
|
114
|
+
[encodeHandlesInContainerRuntime]: IFluidDataStoreContext; // No difference in typing with this feature
|
|
115
|
+
[notifiesReadOnlyState]: PickRequired<IFluidDataStoreContext, "isReadOnly">;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function contextSupportsFeature<K extends keyof IFluidDataStoreContextFeaturesToTypes>(
|
|
119
|
+
obj: IFluidDataStoreContext,
|
|
120
|
+
feature: K,
|
|
121
|
+
): obj is IFluidDataStoreContextFeaturesToTypes[K] {
|
|
122
|
+
const { ILayerCompatDetails } = obj as FluidObject<ILayerCompatDetails>;
|
|
123
|
+
return ILayerCompatDetails?.supportedFeatures.has(feature) ?? false;
|
|
124
|
+
}
|
|
125
|
+
|
|
105
126
|
/**
|
|
106
127
|
* @legacy
|
|
107
128
|
* @alpha
|
|
@@ -140,6 +161,11 @@ export class FluidDataStoreRuntime
|
|
|
140
161
|
return this.dataStoreContext.connected;
|
|
141
162
|
}
|
|
142
163
|
|
|
164
|
+
/**
|
|
165
|
+
* {@inheritDoc @fluidframework/datastore-definitions#IFluidDataStoreRuntime.isReadOnly}
|
|
166
|
+
*/
|
|
167
|
+
public readonly isReadOnly = (): boolean => this._readonly;
|
|
168
|
+
|
|
143
169
|
public get clientId(): string | undefined {
|
|
144
170
|
return this.dataStoreContext.clientId;
|
|
145
171
|
}
|
|
@@ -229,6 +255,15 @@ export class FluidDataStoreRuntime
|
|
|
229
255
|
*/
|
|
230
256
|
public readonly ILayerCompatDetails?: unknown = dataStoreCompatDetailsForRuntime;
|
|
231
257
|
|
|
258
|
+
/**
|
|
259
|
+
* See IFluidDataStoreRuntimeInternalConfig.submitMessagesWithoutEncodingHandles
|
|
260
|
+
*
|
|
261
|
+
* Note: this class doesn't declare that it implements IFluidDataStoreRuntimeInternalConfig,
|
|
262
|
+
* and we keep this property as private, but consumers may optimistically cast
|
|
263
|
+
* to the internal interface to access this property.
|
|
264
|
+
*/
|
|
265
|
+
private readonly submitMessagesWithoutEncodingHandles: boolean;
|
|
266
|
+
|
|
232
267
|
/**
|
|
233
268
|
* Create an instance of a DataStore runtime.
|
|
234
269
|
*
|
|
@@ -254,11 +289,25 @@ export class FluidDataStoreRuntime
|
|
|
254
289
|
);
|
|
255
290
|
|
|
256
291
|
// Validate that the Runtime is compatible with this DataStore.
|
|
257
|
-
const
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
292
|
+
const { ILayerCompatDetails: runtimeCompatDetails } =
|
|
293
|
+
dataStoreContext as FluidObject<ILayerCompatDetails>;
|
|
294
|
+
validateRuntimeCompatibility(runtimeCompatDetails, this.dispose.bind(this));
|
|
295
|
+
|
|
296
|
+
if (contextSupportsFeature(dataStoreContext, notifiesReadOnlyState)) {
|
|
297
|
+
this._readonly = dataStoreContext.isReadOnly();
|
|
298
|
+
} else {
|
|
299
|
+
this._readonly = this.dataStoreContext.deltaManager.readOnlyInfo.readonly === true;
|
|
300
|
+
this.dataStoreContext.deltaManager.on("readonly", (readonly) =>
|
|
301
|
+
this.notifyReadOnlyState(readonly),
|
|
302
|
+
);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
this.submitMessagesWithoutEncodingHandles = contextSupportsFeature(
|
|
306
|
+
dataStoreContext,
|
|
307
|
+
encodeHandlesInContainerRuntime,
|
|
261
308
|
);
|
|
309
|
+
// We read this property here to avoid a compiler error (unused private member)
|
|
310
|
+
debugAssert(() => this.submitMessagesWithoutEncodingHandles !== undefined);
|
|
262
311
|
|
|
263
312
|
this.mc = createChildMonitoringContext({
|
|
264
313
|
logger: dataStoreContext.baseLogger,
|
|
@@ -356,6 +405,18 @@ export class FluidDataStoreRuntime
|
|
|
356
405
|
// By default, a data store can log maximum 10 local changes telemetry in summarizer.
|
|
357
406
|
this.localChangesTelemetryCount =
|
|
358
407
|
this.mc.config.getNumber("Fluid.Telemetry.LocalChangesTelemetryCount") ?? 10;
|
|
408
|
+
|
|
409
|
+
// eslint-disable-next-line import/no-deprecated
|
|
410
|
+
const base: IContainerRuntimeBaseExperimental | undefined =
|
|
411
|
+
// eslint-disable-next-line import/no-deprecated
|
|
412
|
+
this.dataStoreContext.containerRuntime satisfies IContainerRuntimeBaseExperimental;
|
|
413
|
+
if (base !== undefined && "inStagingMode" in base) {
|
|
414
|
+
Object.defineProperty(this, "inStagingMode", {
|
|
415
|
+
get: () => {
|
|
416
|
+
return base.inStagingMode;
|
|
417
|
+
},
|
|
418
|
+
});
|
|
419
|
+
}
|
|
359
420
|
}
|
|
360
421
|
|
|
361
422
|
get deltaManager(): IDeltaManagerErased {
|
|
@@ -640,6 +701,20 @@ export class FluidDataStoreRuntime
|
|
|
640
701
|
raiseConnectedEvent(this.logger, this, connected, clientId);
|
|
641
702
|
}
|
|
642
703
|
|
|
704
|
+
private _readonly: boolean;
|
|
705
|
+
/**
|
|
706
|
+
* This function is used by the datastore context to configure the
|
|
707
|
+
* readonly state of this object. It should not be invoked by
|
|
708
|
+
* any other callers.
|
|
709
|
+
*/
|
|
710
|
+
public notifyReadOnlyState(readonly: boolean): void {
|
|
711
|
+
this.verifyNotClosed();
|
|
712
|
+
if (readonly !== this._readonly) {
|
|
713
|
+
this._readonly = readonly;
|
|
714
|
+
this.emit("readonly", readonly);
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
|
|
643
718
|
public getQuorum(): IQuorumClients {
|
|
644
719
|
return this.quorum;
|
|
645
720
|
}
|
package/src/packageVersion.ts
CHANGED