@fluidframework/shared-object-base 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.
- package/CHANGELOG.md +8 -0
- package/api-extractor-lint.json +13 -0
- package/api-extractor.json +3 -6
- package/api-report/shared-object-base.api.md +14 -15
- package/dist/packageVersion.cjs +1 -1
- package/dist/packageVersion.cjs.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/remoteObjectHandle.cjs +0 -22
- package/dist/remoteObjectHandle.cjs.map +1 -1
- package/dist/remoteObjectHandle.d.ts +1 -9
- package/dist/remoteObjectHandle.d.ts.map +1 -1
- package/dist/serializer.cjs +4 -0
- package/dist/serializer.cjs.map +1 -1
- package/dist/serializer.d.ts +8 -0
- package/dist/serializer.d.ts.map +1 -1
- package/dist/shared-object-base-alpha.d.ts +28 -64
- package/dist/shared-object-base-beta.d.ts +59 -456
- package/dist/shared-object-base-public.d.ts +59 -456
- package/dist/shared-object-base-untrimmed.d.ts +18 -3
- package/dist/sharedObject.cjs +2 -3
- package/dist/sharedObject.cjs.map +1 -1
- package/dist/sharedObject.d.ts +2 -3
- package/dist/sharedObject.d.ts.map +1 -1
- package/dist/summarySerializer.cjs +1 -0
- package/dist/summarySerializer.cjs.map +1 -1
- package/dist/summarySerializer.d.ts +1 -0
- package/dist/summarySerializer.d.ts.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils.cjs +4 -0
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.ts +4 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/valueType.cjs +1 -0
- package/dist/valueType.cjs.map +1 -1
- package/dist/valueType.d.ts +1 -0
- package/dist/valueType.d.ts.map +1 -1
- package/lib/handle.d.ts +1 -1
- package/lib/handle.d.ts.map +1 -1
- package/lib/index.d.ts +6 -6
- package/lib/index.d.ts.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.mjs +1 -1
- package/lib/packageVersion.mjs.map +1 -1
- package/lib/remoteObjectHandle.d.ts +1 -9
- package/lib/remoteObjectHandle.d.ts.map +1 -1
- package/lib/remoteObjectHandle.mjs +1 -23
- package/lib/remoteObjectHandle.mjs.map +1 -1
- package/lib/serializer.d.ts +8 -0
- package/lib/serializer.d.ts.map +1 -1
- package/lib/serializer.mjs +4 -0
- package/lib/serializer.mjs.map +1 -1
- package/lib/shared-object-base-alpha.d.ts +28 -64
- package/lib/shared-object-base-beta.d.ts +59 -456
- package/lib/shared-object-base-public.d.ts +59 -456
- package/lib/shared-object-base-untrimmed.d.ts +18 -3
- package/lib/sharedObject.d.ts +5 -6
- package/lib/sharedObject.d.ts.map +1 -1
- package/lib/sharedObject.mjs +2 -3
- package/lib/sharedObject.mjs.map +1 -1
- package/lib/summarySerializer.d.ts +2 -1
- package/lib/summarySerializer.d.ts.map +1 -1
- package/lib/summarySerializer.mjs +1 -0
- package/lib/summarySerializer.mjs.map +1 -1
- package/lib/types.d.ts +2 -0
- package/lib/types.d.ts.map +1 -1
- package/lib/types.mjs.map +1 -1
- package/lib/utils.d.ts +5 -1
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.mjs +4 -0
- package/lib/utils.mjs.map +1 -1
- package/lib/valueType.d.ts +1 -0
- package/lib/valueType.d.ts.map +1 -1
- package/lib/valueType.mjs +1 -0
- package/lib/valueType.mjs.map +1 -1
- package/package.json +20 -29
- package/src/packageVersion.ts +1 -1
- package/src/remoteObjectHandle.ts +1 -31
- package/src/serializer.ts +8 -0
- package/src/sharedObject.ts +2 -3
- package/src/summarySerializer.ts +1 -0
- package/src/types.ts +2 -0
- package/src/utils.ts +4 -0
- package/src/valueType.ts +1 -0
|
@@ -9,16 +9,9 @@ import {
|
|
|
9
9
|
IFluidHandle,
|
|
10
10
|
IFluidHandleContext,
|
|
11
11
|
IRequest,
|
|
12
|
-
IResponse,
|
|
13
12
|
FluidObject,
|
|
14
|
-
// eslint-disable-next-line import/no-deprecated
|
|
15
|
-
IFluidRouter,
|
|
16
13
|
} from "@fluidframework/core-interfaces";
|
|
17
|
-
import {
|
|
18
|
-
create404Response,
|
|
19
|
-
exceptionToResponse,
|
|
20
|
-
responseToException,
|
|
21
|
-
} from "@fluidframework/runtime-utils";
|
|
14
|
+
import { responseToException } from "@fluidframework/runtime-utils";
|
|
22
15
|
|
|
23
16
|
/**
|
|
24
17
|
* This handle is used to dynamically load a Fluid object on a remote client and is created on parsing a serialized
|
|
@@ -28,12 +21,6 @@ import {
|
|
|
28
21
|
* IFluidHandle can be retrieved by calling `get` on it.
|
|
29
22
|
*/
|
|
30
23
|
export class RemoteFluidObjectHandle implements IFluidHandle {
|
|
31
|
-
/**
|
|
32
|
-
* @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
|
|
33
|
-
*/
|
|
34
|
-
public get IFluidRouter() {
|
|
35
|
-
return this;
|
|
36
|
-
}
|
|
37
24
|
public get IFluidHandleContext() {
|
|
38
25
|
return this;
|
|
39
26
|
}
|
|
@@ -86,21 +73,4 @@ export class RemoteFluidObjectHandle implements IFluidHandle {
|
|
|
86
73
|
public bind(handle: IFluidHandle): void {
|
|
87
74
|
handle.attachGraph();
|
|
88
75
|
}
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
|
|
92
|
-
*/
|
|
93
|
-
public async request(request: IRequest): Promise<IResponse> {
|
|
94
|
-
try {
|
|
95
|
-
// eslint-disable-next-line import/no-deprecated
|
|
96
|
-
const object: FluidObject<IFluidRouter> = await this.get();
|
|
97
|
-
const router = object.IFluidRouter;
|
|
98
|
-
|
|
99
|
-
return router === undefined
|
|
100
|
-
? create404Response(request)
|
|
101
|
-
: await router.request(request);
|
|
102
|
-
} catch (error) {
|
|
103
|
-
return exceptionToResponse(error);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
76
|
}
|
package/src/serializer.ts
CHANGED
|
@@ -12,6 +12,7 @@ import { RemoteFluidObjectHandle } from "./remoteObjectHandle";
|
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* JSON serialized form of an IFluidHandle
|
|
15
|
+
* @internal
|
|
15
16
|
*/
|
|
16
17
|
export interface ISerializedHandle {
|
|
17
18
|
// Marker to indicate to JSON.parse that the object is a Fluid handle
|
|
@@ -21,9 +22,15 @@ export interface ISerializedHandle {
|
|
|
21
22
|
url: string;
|
|
22
23
|
}
|
|
23
24
|
|
|
25
|
+
/**
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
24
28
|
export const isSerializedHandle = (value: any): value is ISerializedHandle =>
|
|
25
29
|
value?.type === "__fluid_handle__";
|
|
26
30
|
|
|
31
|
+
/**
|
|
32
|
+
* @alpha
|
|
33
|
+
*/
|
|
27
34
|
export interface IFluidSerializer {
|
|
28
35
|
/**
|
|
29
36
|
* Given a mostly-plain object that may have handle objects embedded within, will return a fully-plain object
|
|
@@ -59,6 +66,7 @@ export interface IFluidSerializer {
|
|
|
59
66
|
|
|
60
67
|
/**
|
|
61
68
|
* Data Store serializer implementation
|
|
69
|
+
* @alpha
|
|
62
70
|
*/
|
|
63
71
|
export class FluidSerializer implements IFluidSerializer {
|
|
64
72
|
private readonly root: IFluidHandleContext;
|
package/src/sharedObject.ts
CHANGED
|
@@ -40,6 +40,7 @@ import { ISharedObject, ISharedObjectEvents } from "./types";
|
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
* Base class from which all shared objects derive.
|
|
43
|
+
* @alpha
|
|
43
44
|
*/
|
|
44
45
|
export abstract class SharedObjectCore<TEvent extends ISharedObjectEvents = ISharedObjectEvents>
|
|
45
46
|
extends EventEmitterWithErrorHandling<TEvent>
|
|
@@ -543,9 +544,6 @@ export abstract class SharedObjectCore<TEvent extends ISharedObjectEvents = ISha
|
|
|
543
544
|
* attached to them by the consumers of the DDS). It should not be called from outside the class or to emit events
|
|
544
545
|
* which are only internal to the DDS. Support for calling it from outside the DDS instance might be removed in the
|
|
545
546
|
* future.
|
|
546
|
-
*
|
|
547
|
-
* @internal
|
|
548
|
-
*
|
|
549
547
|
* @param event - The event to emit.
|
|
550
548
|
* @param args - Arguments to pass to the event listeners.
|
|
551
549
|
* @returns `true` if the event had listeners, `false` otherwise.
|
|
@@ -583,6 +581,7 @@ export abstract class SharedObjectCore<TEvent extends ISharedObjectEvents = ISha
|
|
|
583
581
|
/**
|
|
584
582
|
* SharedObject with simplified, synchronous summarization and GC.
|
|
585
583
|
* DDS implementations with async and incremental summarization should extend SharedObjectCore directly instead.
|
|
584
|
+
* @alpha
|
|
586
585
|
*/
|
|
587
586
|
export abstract class SharedObject<
|
|
588
587
|
TEvent extends ISharedObjectEvents = ISharedObjectEvents,
|
package/src/summarySerializer.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { FluidSerializer } from "./serializer";
|
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Serializer implementation for serializing handles during summary.
|
|
11
|
+
* @alpha
|
|
11
12
|
*/
|
|
12
13
|
export class SummarySerializer extends FluidSerializer {
|
|
13
14
|
private readonly serializedRoutes: Set<string> = new Set();
|
package/src/types.ts
CHANGED
|
@@ -14,6 +14,7 @@ import { IGarbageCollectionData } from "@fluidframework/runtime-definitions";
|
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Events emitted by {@link ISharedObject}.
|
|
17
|
+
* @alpha
|
|
17
18
|
*/
|
|
18
19
|
export interface ISharedObjectEvents extends IErrorEvent {
|
|
19
20
|
/**
|
|
@@ -53,6 +54,7 @@ export interface ISharedObjectEvents extends IErrorEvent {
|
|
|
53
54
|
|
|
54
55
|
/**
|
|
55
56
|
* Base interface for shared objects from which other interfaces derive. Implemented by SharedObject
|
|
57
|
+
* @alpha
|
|
56
58
|
*/
|
|
57
59
|
export interface ISharedObject<TEvent extends ISharedObjectEvents = ISharedObjectEvents>
|
|
58
60
|
extends IChannel,
|
package/src/utils.ts
CHANGED
|
@@ -16,6 +16,7 @@ import { IFluidSerializer } from "./serializer";
|
|
|
16
16
|
* @param context - The handle context for the container
|
|
17
17
|
* @param bind - Bind any other handles we find in the object against this given handle.
|
|
18
18
|
* @returns Result of strigifying an object
|
|
19
|
+
* @internal
|
|
19
20
|
*/
|
|
20
21
|
export function serializeHandles(
|
|
21
22
|
value: any,
|
|
@@ -37,6 +38,7 @@ export function serializeHandles(
|
|
|
37
38
|
* @param context - The handle context for the container
|
|
38
39
|
* @param bind - Bind any other handles we find in the object against this given handle.
|
|
39
40
|
* @returns The fully-plain object
|
|
41
|
+
* @internal
|
|
40
42
|
*/
|
|
41
43
|
export function makeHandlesSerializable(
|
|
42
44
|
value: any,
|
|
@@ -54,6 +56,7 @@ export function makeHandlesSerializable(
|
|
|
54
56
|
* @param serializer - The serializer that knows how to convert serializable-form handles into handle objects
|
|
55
57
|
* @param context - The handle context for the container
|
|
56
58
|
* @returns The mostly-plain object with handle objects within
|
|
59
|
+
* @internal
|
|
57
60
|
*/
|
|
58
61
|
export function parseHandles(value: any, serializer: IFluidSerializer) {
|
|
59
62
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
@@ -65,6 +68,7 @@ export function parseHandles(value: any, serializer: IFluidSerializer) {
|
|
|
65
68
|
* @param key - the key for the blob in the summary
|
|
66
69
|
* @param content - blob content
|
|
67
70
|
* @returns The summary containing the blob
|
|
71
|
+
* @internal
|
|
68
72
|
*/
|
|
69
73
|
export function createSingleBlobSummary(
|
|
70
74
|
key: string,
|